What does HTTP status code 402 mean?
The 402 Payment Required status code is an uncommon standard code reserved for future use, but widely adopted in modern SaaS APIs to indicate financial restrictions.
When to use it in APIs
Use 402 when a tenant’s subscription has expired, credit card processing fails, or a client has exhausted their unpaid plan limits and needs to upgrade to continue.
How it compares to other codes
- 403 Forbidden: Restricts authorization based on roles or rules, whereas 402 restricts access strictly due to billing/payment state.