HTTP 402

The reserved HTTP status code 'Payment Required' first defined in RFC 2068 (1997), carried forward in RFC 2616 and RFC 7231, and revived as the foundation for on-demand payment negotiation on the modern web.

HTTP 402 is an HTTP response status code that was reserved for future use in the original HTTP/1.1 specification. For decades it remained unused in production, but protocols such as x402 now use it to signal that a server requires payment before returning a resource. A client that receives a 402 response reads the payment requirements (chain, token, amount, recipient, facilitator) from response headers, signs a payment payload, and retries the request with a signed-payment header. A facilitator then verifies the signature and settles the payment on-chain before the resource is returned.

Related terms

Recent stories

PROTOCOL

See all PROTOCOL stories →

DEV

See all DEV stories →

← Back to glossary

Get these stories as a short daily email.

One email each morning. Free. Unsubscribe anytime.