HTTP 402 — Payment Required

Reserved for future use. The original intention was that this code might be used as part of some form of digital cash or micropayment scheme

When to use it

Use status 402 when this is the correct HTTP response semantic: Reserved for future use. The original intention was that this code might be used as part of some form of digital cash or micropayment scheme

Request and response example

GET /protected-resource HTTP/1.1
Host: api.example.com

HTTP/1.1 402 Payment Required
Content-Type: application/json

{"error":"Request cannot be completed"}

Related status codes

400, 401, 403, 404

References

MDN · RFC 9110