Common Data Structures#
PaymentPayload#
After signing, the Buyer passes this to the Seller via the X-PAYMENT header (base64-encoded), and the Seller forwards it as-is to the Facilitator.
| Parameter | Type | Required | Description |
|---|---|---|---|
| x402Version | Integer | Yes | Protocol version, e.g. 2 |
| resource | Object | No | Protected resource description |
| resource.url | String | Yes | URL of the protected resource |
| resource.description | String | No | Resource description |
| resource.mimeType | String | No | Expected response MIME type |
| accepted | Object | Yes | Payment method selected by the Buyer (picked from the accepts array), structure identical to PaymentRequirements |
| payload | Object | Yes | Signed data |
| payload.signature | String | Yes | EIP-712 signature. exact: EOA signature; aggr_deferred: session key signature |
| payload.authorization | Object | Yes | EIP-3009 authorization parameters |
Authorization#
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | String | Yes | Payer wallet address |
| to | String | Yes | Payee wallet address |
| value | String | Yes | Payment amount (atomic units, with precision) |
| validAfter | String | Yes | Unix timestamp when the authorization becomes valid |
| validBefore | String | Yes | Unix timestamp when the authorization expires |
| nonce | String | Yes | 32-byte random nonce (0x hex format, replay protection) |
PaymentRequirements#
Used both as an element of the 402 response accepts array and as paymentPayload.accepted.
| Parameter | Type | Required | Description |
|---|---|---|---|
| scheme | String | Yes | Settlement scheme: exact / aggr_deferred |
| network | String | Yes | CAIP-2 chain identifier, e.g. eip155:196 |
| amount | String | Yes | Payment amount (atomic unit string) |
| asset | String | Yes | Token contract address |
| payTo | String | Yes | Payee wallet address |
| maxTimeoutSeconds | Integer | No | Maximum timeout for payment completion (seconds) |
| extra | Object | No | Scheme-specific extensions. For aggr_deferred, the Buyer includes the session key certificate in accepted.extra.sessionCert |
Table of contents