Open APIs V1
Settle Payment
This is the V1 API. For new integrations we recommend Settle Payment (V2), which is conformant with the x402 v2 specification.
Code
Executes on-chain settlement — submits the payment transaction to BNB Smart Chain. This operation
is irreversible. Always call /verify first to validate the payment. Gas is sponsored; the
merchant does not need to hold BNB for gas fees.
Request Body
The request body has the same structure as /verify, with one additional field:
| Field | Type | Mandatory | Remarks |
|---|---|---|---|
| x402Version | integer | Yes | x402 protocol version (currently 1) |
| paymentPayload | object | Yes | Same structure as /verify request. See Verify Payment for full field descriptions. |
| paymentRequirements | object | Yes | Same structure as /verify request. See Verify Payment for full field descriptions. |
| settleAmount | string | Only for permit2-upto | The actual amount to settle, in the token's smallest unit. Must be ≤ the authorized amount in the signature. Ignored for eip3009 and permit2-exact modes. |
Example — EIP-3009 Settle
Code
Example — Permit2 Upto Settle (with settleAmount)
Code
In this example, the buyer authorized up to 100 USDT (
"100000000") but the merchant only charges 3 USDT ("3000000") for this request.
Response Body
| Field | Type | Presence | Remarks |
|---|---|---|---|
| success | boolean | Always | Whether the settlement succeeded |
| transaction | string | When TX submitted | On-chain transaction hash. 0x-prefixed, 32-byte hex string. Present on both success and on-chain failure. |
| payer | string | Always | Payer wallet address |
| network | string | When success=true | Settlement network in CAIP-2 format (e.g. "eip155:56") |
| amount | string | When success=true | Actual settled amount in token's smallest unit. For permit2-upto, equals the requested settleAmount; for other methods, equals the full signed amount. |
| confirmations | integer | When success=true | Number of block confirmations waited |
| errorReason | string | Only when success=false | Machine-readable failure reason |
| errorMessage | string | Only when success=false | Human-readable failure description |
Example — Successful Settlement
Code
Example — Failed Settlement
Code
Notes:
- An on-chain failure (e.g., nonce already used, token revert) still returns HTTP
200withcode: "000000". Check thesuccessfield indatafor the settlement outcome.- Irreversible operation. Once a settlement transaction is broadcast and confirmed on-chain, it cannot be reversed.
- Idempotent. A given
(nonce, network, payer)tuple can only be settled once. Duplicate calls return the cached result without re-broadcasting.settleAmountbehavior by mode:
eip3009/permit2-exact— thesettleAmountfield is ignored; the full signed amount is always transferred.permit2-upto—settleAmountis required and specifies the actual transfer amount. Must be ≤permit2Authorization.permitted.amount.- Settlement response times vary by amount. Small payments typically settle in ~10 seconds; medium payments in ~25 seconds; large payments may take up to ~45 seconds.
- Rate limit: 20 requests per second per merchant (
X-Tesla-ClientId).- All token transfers occur strictly peer-to-peer on the public blockchain from the buyer's wallet directly to the merchant's wallet. The Facilitator contract validates signatures and forwards the transfer on-chain but never holds tokens in custody.
ErrorReason Values
Machine-readable reasons returned in the errorReason field when success is false:
| Value | Description |
|---|---|
settle_exact_failed_onchain | On-chain transaction reverted |
settle_exact_evm_transaction_confirmation_timed_out | Transaction confirmation timed out |
settle_exact_node_failure | BSC RPC node unavailable |
settle_service_unavailable | Settle service is temporarily unavailable |
| (any InvalidReason value) | Payment validation failed during settle — see InvalidReason Values for the full list |
Was this page helpful?
Last modified on