Skip to main content
POST
/
settle
Settle an x402 v2 payment (co-sign + submit to Solana)
curl --request POST \
  --url https://facilitator.x84.ai/settle \
  --header 'Content-Type: application/json' \
  --data '
{
  "paymentPayload": {
    "x402Version": 1,
    "accepted": {
      "scheme": "exact",
      "network": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
      "asset": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr",
      "amount": "1000000",
      "payTo": "8VF2ZAp9C1RKeV2XmKBnCQdbhGuNZaLZ1x7mTCSGsMH9",
      "maxTimeoutSeconds": 60,
      "resource": "https://api.x84.ai/a2a/agent-abc/tasks/send",
      "description": "Query agent-abc for market analysis",
      "extra": {
        "feePayer": "7iRiHRnj1NofyEZVuj86Z4s5MJwVFZVR71XuAsLnwLYX",
        "name": "Agent Query Fee",
        "agentMint": "6s1irFAQHoiK7VLwrUQEGpN5E1MrLoo5dZVWZCAwsDZS",
        "programId": "X84XHMKT7xvjgVUXFNQLZLSdCEEZu2wAPrAeP4M9Hhi",
        "settlementModes": [
          "atomic",
          "attestation",
          "delegated"
        ]
      }
    },
    "payload": {
      "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjwuBdojnm..."
    },
    "resource": "https://api.x84.ai/a2a/agent-abc/tasks/send",
    "extensions": {
      "mode": "atomic",
      "receiptPda": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",
      "delegationPda": "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
      "delegate": "D6j5dis544qzYmSNixwYwBXqcDqgWiFHpi6hebPEQNVu",
      "signature": "<string>",
      "timestamp": 1708700000,
      "paymentId": "a1b2c3d4e5f6",
      "txSignature": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
      "payer": "D6j5dis544qzYmSNixwYwBXqcDqgWiFHpi6hebPEQNVu",
      "amount": "1000000"
    }
  },
  "paymentRequirements": {
    "scheme": "exact",
    "network": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
    "asset": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr",
    "amount": "1000000",
    "payTo": "8VF2ZAp9C1RKeV2XmKBnCQdbhGuNZaLZ1x7mTCSGsMH9",
    "maxTimeoutSeconds": 60,
    "resource": "https://api.x84.ai/a2a/agent-abc/tasks/send",
    "description": "Query agent-abc for market analysis",
    "extra": {
      "feePayer": "7iRiHRnj1NofyEZVuj86Z4s5MJwVFZVR71XuAsLnwLYX",
      "name": "Agent Query Fee",
      "agentMint": "6s1irFAQHoiK7VLwrUQEGpN5E1MrLoo5dZVWZCAwsDZS",
      "programId": "X84XHMKT7xvjgVUXFNQLZLSdCEEZu2wAPrAeP4M9Hhi",
      "settlementModes": [
        "atomic",
        "attestation",
        "delegated"
      ]
    }
  }
}
'
{
  "success": true,
  "transaction": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
  "network": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
  "payer": "D6j5dis544qzYmSNixwYwBXqcDqgWiFHpi6hebPEQNVu"
}

Body

application/json
paymentPayload
object
required

x402 v2 structured PaymentPayload object. For backward compatibility, a base64-encoded v1 proof string is also accepted.

paymentRequirements
object
required

The payment requirements issued by the resource server in the 402 response

Response

Settlement result — check success to determine outcome

success
boolean
required

Whether the settlement succeeded

Example:

true

transaction
string
required

Solana transaction signature (empty string on failure). REQUIRED per x402 v2.

Example:

"5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"

network
string
required

CAIP-2 network identifier where settlement occurred. REQUIRED per x402 v2.

Example:

"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"

errorReason
string

Machine-readable error reason code

Example:

"SETTLEMENT_FAILED"

errorMessage
string

Human-readable error message

Example:

"Transaction simulation failed: insufficient funds"

payer
string

Wallet address of the payer

Example:

"D6j5dis544qzYmSNixwYwBXqcDqgWiFHpi6hebPEQNVu"

extensions
object

Additional extension data

Example:
{ "mode": "atomic" }