{ }HttpStatus.com

402 Payment Required

Reserved for future use; increasingly reused by APIs to signal billing failures like an expired subscription or exhausted quota.

Defined in RFC 9110 §15.5.3

What 402 means

402 Payment Required is reserved in RFC 9110 for future use. It was defined in the earliest HTTP specifications with the idea of supporting digital cash or micropayment schemes directly at the protocol level, but no such mechanism was ever standardized, and browsers have no built-in handling for it. For decades it sat almost entirely unused in real traffic, unlike its 4xx siblings which describe concrete, well-understood failure modes.

In the last several years, a growing number of APIs and platforms have repurposed 402 informally to signal billing-related failures: an expired subscription, an exhausted usage quota that requires an upgrade, insufficient account credit, or a free tier limit reached. Because the code is officially reserved rather than formally redefined for this purpose, there is no standardized error body format the way OAuth defines one for 401, so each provider documents its own JSON error shape.

Because 402 has no native browser or proxy behavior tied to it, it is safe to reuse for application-level billing errors as long as the meaning is documented and the response body carries actionable detail, such as which plan is required, current usage versus limit, and a link to resolve billing. Some providers instead layer this information onto a 403 or a custom 4xx-adjacent code paired with a JSON error field, so a caller should not assume 402 exclusively means billing without checking the specific API's docs.

Common causes

  • The account's subscription has lapsed or a payment failed to process.
  • The API usage quota for the current billing period has been exhausted.
  • The account balance or prepaid credit has run out.
  • A free-tier limit was reached and continued use requires upgrading to a paid plan.

How to fix a 402

If you are the client (browser user or API caller)

  • Check the account's billing status and payment method in the provider's dashboard or billing API.
  • Update the payment method or upgrade the plan, then retry the request.
  • Read the response body for provider-specific billing error details, since 402 has no standardized error format.

If you run the server

  • Document 402's meaning for your API explicitly, since it is reserved rather than formally defined for billing use.
  • Include the current usage, limit, and an upgrade URL in the response body.
  • Keep 402 for billing and 429 for rate limiting distinct so clients can tell a quota problem from a temporary throttle.

Example

POST /api/reports/generate HTTP/1.1
Host: api.example.com
Authorization: Bearer <token>

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

{"error": "quota_exceeded", "message": "Monthly report quota exhausted", "upgrade_url": "https://example.com/billing"}
A provider reusing 402 to signal that the account's plan needs upgrading, with an actionable link in the body.

Try it live

Our free status responder returns a real HTTP 402 you can point tests, monitors or a browser at.

GET https://mcp.httpstatus.com/status/402

Related status codes

Tools for debugging this