The x402 version 2 402 response

When a resource costs money, an x402 seller answers with HTTP 402 and puts its quote in the PAYMENT-REQUIRED response header. The value is base64 of a UTF-8 JSON object. The response body is free-form and clients should not depend on it.

Headers in the exchange

HeaderSent byCarries
PAYMENT-REQUIREDSeller, on the 402The quote: what to pay, to whom, on which network
PAYMENT-SIGNATUREBuyer, on the retryThe option it accepted and its signed payment
PAYMENT-RESPONSESeller, on the final responseThe settlement result, including the transaction hash

Version 1 used an X-PAYMENT request header and put the quote in the response body. The endpoint checker reports which version an endpoint speaks.

A decoded quote

This is what https://x402testendpoint.com/t/ok sends, after base64 decoding:

{
  "x402Version": 2,
  "resource": {
    "url": "https://x402testendpoint.com/t/ok",
    "description": "What is being sold",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:84532",
      "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
      "amount": "1000",
      "payTo": "0xSellerWalletAddress",
      "maxTimeoutSeconds": 60,
      "extra": {
        "name": "USDC",
        "version": "2"
      }
    }
  ]
}

Fields

FieldMeaning
x402Version2 for this format.
errorOptional. Why the previous payment attempt was rejected. See the error reference.
resource.urlThe URL being paid for. Buyers can compare it with what they requested.
resource.descriptionOptional but useful: tells agents and catalogs what is being sold.
acceptsOne or more ways to pay. The buyer picks one it supports.
accepts[].schemeHow the payment works. exact means a fixed amount.
accepts[].networkA CAIP-2 identifier, such as eip155:8453 for Base or eip155:84532 for Base Sepolia.
accepts[].assetThe token contract address.
accepts[].amountThe price in the token's smallest unit, as a string. USDC has six decimals, so 1000 is 0.001 USDC.
accepts[].payToThe seller's receiving address.
accepts[].maxTimeoutSecondsHow long the buyer's signed payment should stay valid.
accepts[].extraScheme-specific data. For exact on EVM, the token's EIP-712 name and version, which the buyer needs in order to sign.
extensionsOptional add-ons, such as the Bazaar extension that lets facilitator catalogs index the endpoint.

Check or decode one

Field names and the header encoding follow the types and helpers in @x402/core 2.31.