Skip to main content

← x402

This page describes each x402 endpoint as it appears on the wire. If you are using the AgentCash SDK the 402 → sign → retry loop is handled for you — the request and response payloads below are still useful as a reference for the data your code receives. All endpoints are rooted at https://x402.rye.com.

Authentication

There is no Authorization header. Authentication is the signed PAYMENT-SIGNATURE payload — the wallet that signs the USDC transfer is the wallet of record for the request. Wallet identity resolves from authorization.from inside the payload.

POST /v1/checkout-intents

Creates a checkout intent and starts offer retrieval. Fee: $0.02 USDC

Request body

The buyer field follows the same schema as the standard Universal Checkout API.

First call — no signature

402 response

The body is canonical x402 v2 PaymentRequired. The same JSON is base64-encoded into the PAYMENT-REQUIRED header.
Field notes:
  • amount is in atomic units (USDC has 6 decimals — "20000" = $0.02).
  • asset is the USDC contract address on the named chain.
  • payTo is a freshly minted Stripe deposit address; it changes on every challenge.
  • extra.{name, version} are the EIP-712 domain parameters required to sign the TransferWithAuthorization message.

Retry — with signature

The PAYMENT-SIGNATURE header is a base64-encoded canonical x402 v2 PaymentPayload:
The buyer signs an EIP-3009 authorization off-chain. The buyer never broadcasts — the proxy submits transferWithAuthorization on Base and pays the gas.

Success

The success response carries an X-PAYMENT-RESPONSE header containing a base64-encoded SettleResponse with the on-chain transaction hash.
Decoded X-PAYMENT-RESPONSE body:
Spec-compliant x402 SDKs read this header to confirm settlement and surface the tx hash to the caller.

GET /v1/checkout-intents?id=<intent-id>

Returns the current state of an intent. Free — no payment headers required. The call is scoped to the wallet that paid for the intent. Pass the wallet address in the X-Wallet-Address header. Other wallets receive 404.
For a complete list of states and the transitions between them, see Checkout Intent Lifecycle.

POST /v1/checkout-intents/confirm

Confirms the intent and starts order placement. The intent id goes in the request body, not the URL. Fee: purchase total + $0.03 USDC, bundled into a single signed authorization.

Request body

First call — no signature

402 response

Retry — with signature

Success

The success response carries X-PAYMENT-RESPONSE with the settle envelope, same shape as the create gate.
Once state is placing_order, poll GET /v1/checkout-intents?id=<intent-id> until it reaches completed (with orderId) or failed.

Networks

Set the network field on paymentMethod for /confirm to one of: USDC is the only accepted token on every supported network.

Refunds

Order placement failures (out of stock, merchant rejection, etc.) are refunded automatically — Rye returns the purchase amount to the signing wallet on-chain. The 0.02and0.02 and 0.03 API access fees are non-refundable.

Discovery

GET /openapi.json returns an OpenAPI 3.1.0 document with x-payment-info annotations on each paid operation. Use it with AgentCash discovery to introspect prices and schemas: