Skip to main content

What is x402?

x402 is an open payment standard built on HTTP 402 Payment Required x402 lets AI agents pay programmatically, so they can complete a checkout and purchase from your store without a browser flow or human intervention. As buying behavior shifts, integrating x402 with your store helps you stay ahead of the market and align with the growing trend of AI agents.

Official documentation

For the full specification and concepts, see:

How it works

x402 uses standard HTTP status codes and headers:
  1. Client requests a protected resource (e.g. checkout status).
  2. Server responds with 402 Payment Required, a PAYMENT-REQUIRED header, and a JSON body describing what to pay, how much, and where.
  3. Client (or wallet/agent) signs the transaction using that information.
  4. Client retries the same request with a PAYMENT-SIGNATURE header containing the Base64-encoded proof.
  5. Server verifies the payment and responds with 200 OK and, on success, a PAYMENT-RESPONSE header confirming settlement.

x402 on Zeno Bank

The following endpoint supports x402 for paying for a checkout.

POST /api/v1/checkouts/:checkoutId

BehaviorDescription
First request (no payment)HTTP 402 Payment Required with PAYMENT-REQUIRED header and payment instructions.
Retry with paymentSame POST with PAYMENT-SIGNATURE (Base64 proof). Server verifies and returns 200 + checkout + PAYMENT-RESPONSE.
Path parameter
  • checkoutId (string, required) — Checkout ID (e.g. from Create Checkout).
Example: first request (no payment)
curl -i -X POST https://api.zenobank.io/api/v1/checkouts/ch_2wlOcI7sKr9McroZb
Example response (402)
  • Status: 402 Payment Required
  • Header: PAYMENT-REQUIRED: <Base64-encoded payment requirements>
  • Body: JSON with payment requirements. Example:
{
  "x402Version": 2,
  "resource": {
    "url": "https://api.zenobank.io/api/v1/checkouts/ch_2wlOcI7sKr9McroZb",
    "description": "Checkout ch_2wlOcI7sKr9McroZb (order: order-123)",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "network": "eip155:84532",
      "scheme": "exact",
      "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
      "maxTimeoutSeconds": 300,
      "extra": { "name": "USDC", "version": "2" },
      "amount": "2000000",
      "payTo": "0xfde61cfd236328c3a136a9f876f1ab3e3a6fafe9"
    }
  ]
}
Amount is in the token’s smallest unit. USDC has 6 decimals, so "amount": "2000000" = 2 USDC.
Example: retry with payment
curl -i -X POST https://api.zenobank.io/api/v1/checkouts/ch_2wlOcI7sKr9McroZb \
  -H "PAYMENT-SIGNATURE: <Base64-encoded payment payload>"
Example response (200)
  • Status: 200 OK
  • Header: PAYMENT-RESPONSE: <Base64-encoded settlement response>
  • Body: Checkout object. Example:
{
  "id": "ch_2wlOcI7sKr9McroZb",
  "orderId": "order-1769920141831-vscv3n6",
  "priceCurrency": "USD",
  "priceAmount": "2",
  "status": "COMPLETED",
  "expiresAt": "2026-02-01T04:49:01.908Z",
  "checkoutUrl": "https://pay.zenobank.io/ch_2wlOcI7sKr9McroZb",
  "createdAt": "2026-02-01T04:29:01.900Z",
  "successRedirectUrl": null
}

Supported networks and assets

NetworkAssetCAIP-2 Chain IDZeno Chain ID
Base MainnetUSDCeip155:8453BASE_MAINNET
More tokens will be added over time.