ReferenceExamples

Examples

Minimal copy-paste examples for the two supported external surfaces.

Business quote request

curl
curl -X POST "https://mindswap.fun/api/v3/quotes" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_partner_key" \
  -H "X-API-SIGN: <lowercase_hex_hmac_sha256_signature>" \
  -H "X-API-TIMESTAMP: 1712534400" \
  -H "X-API-NONCE: 6b6f2f4b9f2f4d4b8e6d0f2d5f7c8a1b" \
  -H "Idempotency-Key: idem_business_quote_1" \
  -d '{"fromCcy":"BTC","toCcy":"ETH","amount":"0.5","direction":"from","type":"fixed"}'

x402 quote flow

Step 1: Initial request

Request
POST https://mindswap.fun/api/x402/quotes
Idempotency-Key: idem_x402_quote_1
Content-Type: application/json

{
  "fromCcy": "BTC",
  "toCcy": "ETH",
  "amount": "0.5",
  "direction": "from",
  "type": "fixed"
}

Step 2: Challenge response

402 Payment Required
HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: <base64-encoded PaymentRequired>

Step 3: Replay with proof

Replay
POST https://mindswap.fun/api/x402/quotes
Idempotency-Key: idem_x402_quote_1
PAYMENT-SIGNATURE: <base64-encoded PaymentPayload>
Content-Type: application/json

{
  "fromCcy": "BTC",
  "toCcy": "ETH",
  "amount": "0.5",
  "direction": "from",
  "type": "fixed"
}

x402 wallet-bound read

Order read with SIWX
GET https://mindswap.fun/api/x402/orders/ord_123
SIGN-IN-WITH-X: <base64-encoded SIWX payload>