Settle payment
Changed onSettle an x402 protocol payment with a specific scheme and network.
Request
- Base URLhttps://api.cdp.coinbase.com/platform
- AuthHTTP bearer
Request body
The version of the x402 protocol.
The x402 protocol payment payload that the client attaches to x402-paid API requests to the resource server in the PAYMENT-SIGNATURE header. For EVM networks, smart account signatures can be longer than 65 bytes.
The x402 protocol payment requirements that the resource server expects the client's payment payload to meet.
Example request
{
"x402Version": 2,
"paymentPayload": {
"x402Version": 2,
"accepted": {
"scheme": "exact",
"network": "eip155:84532",
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amount": "1000",
"payTo": "0x122F8Fcaf2152420445Aa424E1D8C0306935B5c9",
"maxTimeoutSeconds": 60,
"extra": {
"name": "USDC",
"version": "2"
}
},
"payload": {
"signature": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b",
"authorization": {
"from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"value": "1000000000000000000",
"validAfter": "1716150000",
"validBefore": "1716150000",
"nonce": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
},
"resource": {
"url": "https://api.example.com/premium/resource/123",
"description": "Premium API access for data analysis.",
"mimeType": "application/json"
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "eip155:8453",
"asset": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"amount": "1000000",
"payTo": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"maxTimeoutSeconds": 10,
"extra": {
"name": "USDC",
"version": "2"
}
}
}Response
Successfully settled payment on the x402 protocol.
Indicates whether the payment settlement is successful.
The reason the payment settlement errored on the x402 protocol.
The message describing the error reason.
The onchain address of the client that is paying for the resource.
For EVM networks, the payer will be a 0x-prefixed, checksum EVM address.
For Solana-based networks, the payer will be a base58-encoded Solana address.
The transaction of the settlement. For EVM networks, the transaction will be a 0x-prefixed, EVM transaction hash. For Solana-based networks, the transaction will be a base58-encoded Solana signature.
The network where the settlement occurred.
The amount that was settled, in atomic units.
Optional scheme-specific success metadata returned by the facilitator.
Example response
{
"errorReason": "insufficient_funds",
"errorMessage": "Insufficient funds",
"payer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"transaction": "0x89c91c789e57059b17285e7ba1716a1f5ff4c5dace0ea5a5135f26158d0421b9",
"network": "base",
"amount": "1000000",
"extra": {
"chargedAmount": "1000000",
"channelState": {
"channelId": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"balance": "9000000",
"totalClaimed": "1000000",
"withdrawRequestedAt": 0,
"refundNonce": "0"
},
"voucherState": {
"signedMaxClaimable": "1000000",
"signature": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f134801234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b"
}
}
}Changes
- warning
added the new
policy_not_applicableenum value to theerrorTyperesponse property for the response status - warning
added the new
policy_not_applicableenum value to theerrorTyperesponse property for the response status - warning
added the new
policy_not_applicableenum value to theerrorTyperesponse property for the response status
1 more change in this revision
- warning