transferWithAuthorization — a gasless USDC transfer signed by the payer and submitted by the facilitator.
Endpoint: GET and POST /v1/invoices/{id}/x402/base
Asset: USDC on Base (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
Network (CAIP-2): eip155:8453
1. Discovery
402 with the PAYMENT-REQUIRED header (base64-encoded JSON):
Key fields
| Field | Description |
|---|---|
amount | USDC minor units (6 decimals). "5000000" = $5.00. |
asset | USDC contract address on Base. |
payTo | Merchant’s Base receive address. |
maxTimeoutSeconds | Time remaining before the settlement challenge expires. |
extra.settlementId | Required in the PAYMENT-SIGNATURE. Also used for recovery. |
extra.name / extra.version | EIP-712 domain fields for USDC on Base. |
extra.assetTransferMethod | Always "eip3009" — signals to use transferWithAuthorization. |
2. Payment signature
After reading the terms, the client constructs an EIP-3009transferWithAuthorization and signs it with the payer’s private key. The signed authorization is sent as a base64-encoded PAYMENT-SIGNATURE header:
PAYMENT-SIGNATURE JSON:
Required payload fields
| Field | Type | Description |
|---|---|---|
payload.authorization.from | string | Payer’s address. |
payload.authorization.to | string | Must match payTo from discovery. |
payload.authorization.value | string | Must match amount from discovery. |
payload.authorization.validAfter | string | Unix timestamp (usually "0"). |
payload.authorization.validBefore | string | Unix timestamp. Must be in the future. |
payload.authorization.nonce | string | Unique nonce (bytes32 hex). |
payload.signature.v | number | ECDSA v value. |
payload.signature.r | string | ECDSA r value. |
payload.signature.s | string | ECDSA s value. |
accepted.extra.settlementId | string | The settlementId from discovery. |
3. Settlement response
On success, the server returns HTTP200 with the PAYMENT-RESPONSE header (base64-encoded JSON):
paid_at, paid_tx_hash, payer_address, paid_amount, and tx_url (Basescan link).
Error diagnostics
Settlement errors returnx402_diagnostics with a reason field:
| Reason | Meaning |
|---|---|
base_authorization_invalid | Authorization payload is malformed. |
base_authorization_replayed | This authorization nonce was already used. |
base_authorization_expired | validBefore is in the past. |
resource_mismatch | resource.url doesn’t match the endpoint. |
chain_mismatch | Network in signature doesn’t match /x402/base. |
verification_failed | On-chain verification failed. |
settlement_failed | Facilitator could not settle the transaction. |
