← x402
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 noAuthorization 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
| Field | Type | Description |
|---|---|---|
productUrl | string | URL of the product to purchase |
quantity | integer | Quantity to purchase |
buyer | object | Buyer name, email, phone, and shipping address |
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.
amountis in atomic units (USDC has 6 decimals —"20000"= $0.02).assetis the USDC contract address on the named chain.payTois a freshly minted Stripe deposit address; it changes on every challenge.extra.{name, version}are the EIP-712 domain parameters required to sign theTransferWithAuthorizationmessage.
Retry — with signature
PAYMENT-SIGNATURE header is a base64-encoded canonical x402 v2 PaymentPayload:
transferWithAuthorization on Base and pays the gas.
Success
The success response carries anX-PAYMENT-RESPONSE header containing a base64-encoded SettleResponse with the on-chain transaction hash.
X-PAYMENT-RESPONSE body:
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.
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
| Field | Type | Description |
|---|---|---|
id | string | Checkout intent id (e.g., ci_abc123) |
paymentMethod.type | string | Must be "x402" |
paymentMethod.network | string | One of "base", "solana", "tempo" |
First call — no signature
402 response
Retry — with signature
Success
The success response carriesX-PAYMENT-RESPONSE with the settle envelope, same shape as the create gate.
state is placing_order, poll GET /v1/checkout-intents?id=<intent-id> until it reaches completed (with orderId) or failed.
Networks
Set thenetwork field on paymentMethod for /confirm to one of:
| Value | Chain ID (CAIP-2) |
|---|---|
base | eip155:8453 |
solana | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp |
tempo | eip155:4217 |
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.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:

