Reserved in the original spec and now used in practice for quota, billing and insufficient-funds conditions.
Defined in RFC 9110 §15.5.3 — 402 Payment Required · MDN reference
Rare in public APIs and increasingly common in SaaS ones: an exhausted quota, an unpaid invoice, a feature behind a plan the caller is not on.
Rare enough that most clients have never seen one, which is exactly why it is worth provoking before a payment provider sends you one in production.
Never retry. A 402 is resolved by a human doing something commercial, not by the client trying again. Surface the message and the upgrade path; a retry loop here just burns quota that is already exhausted.
7 endpoints in this playground answer with 402. Every one is free, needs no signup, and can be called from the browser or with curl.
POST https://funapi.dev/api/bank/v1/transfers — Transfer money between accounts (Bank API) Open & run this endpointGET https://funapi.dev/api/bank/v1/premium/statements — Premium statements — always 402 (Bank API) Open & run this endpointGET https://funapi.dev/api/fiba/v1/players/{id}/advanced — Tracking data — always 402, it is on the paid analytics tier (FIBA World Cup API) Open & run this endpointPOST https://funapi.dev/api/gta/v1/vehicles/{id}/respray — Respray a vehicle at Pay-n-Spray — spends cash (402 when broke) (GTA API) Open & run this endpointPOST https://funapi.dev/api/gta/v1/weapons/{id}/buy — Buy a weapon — spends cash (402 when broke, 409 if already owned) (GTA API) Open & run this endpointDELETE https://funapi.dev/api/gta/v1/wanted — Bribe the LSPD to clear wanted level — costs $1000/star (402 when broke) (GTA API) Open & run this endpointGET https://funapi.dev/api/faults/v1/status/{code} — Return any status code on demand (200–599) (Fault Injection API) Open & run this endpointAll HTTP status codes · All 55 mock REST APIs · Getting started guide
Last updated