HTTP 402 Payment Required
The HTTP status code a server returns when a resource requires payment, which the x402 protocol uses to send payment terms to the client.
HTTP 402 was reserved in the original HTTP specification for future use in digital payments and went almost unused for decades. x402 gives it a concrete job: when a request arrives without a valid payment, the server answers 402 together with the terms of payment, such as the amount, the token, the network and the recipient address.
The client signs a payment that matches those terms and retries the request with the signed payload in a header. If the payment is invalid, already used or too small, the server answers 402 again with the reason.
For security, the terms in the 402 response belong to the server. A server should verify each incoming payment against the terms of the route actually being called, not against terms echoed back by the client. See payment binding.
Related Terms
x402
An open payment protocol that uses the HTTP 402 Payment Required status code so clients, including AI agents, can pay for web resources with signed stablecoin authorizations.
x402 Facilitator
The service in the x402 protocol that verifies a client's signed payment against the server's payment terms and settles it on chain, often paying the gas on the client's behalf.
Payment Binding
The check that a payment matches the exact resource, amount, recipient and expiry of what is being bought, using the seller's own terms rather than terms supplied with the request.
Need expert guidance on HTTP 402 Payment Required?
Our team at Zealynx has deep expertise in blockchain security and DeFi protocols. Whether you need an audit or consultation, we're here to help.
Get a Quote