Protocols
HTTP 402
HTTP 402 is the Payment Required status code. RFC 9110 reserves it for future use and does not define a payment method. x402 and L402 both use 402 anyway, with different headers, to tell a client that a resource needs a payment before the server will complete the request.
Explanation
The IETF text is short: 402 is reserved, and the code is not a general client error with a specified body. A server that sends 402 is using an application convention, not an internet standard. Clients that do not understand the convention should treat it as an unsuccessful response.
x402 puts a base64 PaymentRequired object in the PAYMENT-REQUIRED response header and expects the retry to carry PAYMENT-SIGNATURE. L402 puts a macaroon and a BOLT 11 invoice in WWW-Authenticate and expects Authorization: L402. Both are HTTP 402 designs. They do not interoperate, and a payment under one is not a payment under the other. This index can read x402 chain settlements. It cannot read L402 invoices as a single public log.
Live data
Related terms
Sources
- RFC 9110, HTTP Semantics, section 15.5.3 (402 Payment Required) — IETF
- x402 HTTP transport, version 2 — Coinbase x402
- L402 protocol specification — Lightning Labs