Pre-auditThree days of senior audit time for $1,500, credited in full toward your Zealynx audit.3 audit days, credited toward your auditSee how →

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.

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