Messages & Fields
PaymentRequired
Also: payment required object
The object a resource server returns when payment is needed. It holds x402Version, an optional error message, a resource description, an accepts list of payment options and optional extensions. On HTTP it is carried base64-encoded in the PAYMENT-REQUIRED response header.
Example
{
"x402Version": 2,
"error": "PAYMENT-SIGNATURE header is required",
"resource": { "url": "https://api.example.com/premium-data" },
"accepts": [ { "scheme": "exact", "network": "eip155:8453", "amount": "10000", "asset": "0x...", "payTo": "0x...", "maxTimeoutSeconds": 60 } ]
}In the spec x402 v2 specification, §5.1
Related terms
Mentioned alongside
More in Messages & Fields
General education, not investment, legal or tax advice. The protocol is young and changes: check the current x402 specification before you build on a detail.