HTTP 402 Payment Required
HTTP 402 Payment Required is reserved for future use in the HTTP standard, but some services use it to signal a billing problem: an unpaid invoice, an…
Quick answer
HTTP 402 Payment Required is reserved for future use in the HTTP standard, but some services use it to signal a billing problem: an unpaid invoice, an expired subscription or exhausted credits. Its meaning depends entirely on the API that returns it.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 402 Payment Required mean?
There is no standard behaviour for 402. Stripe uses it for failed card payments, and many SaaS APIs use it when a plan limit or balance is reached. Some newer agent-payment protocols also use 402 to request payment.
| Status code | 402 |
|---|---|
| Name | Payment Required |
| Class | 4xx Client Error |
| Defined in | RFC 9110 §15.5.3 |
| Cacheable by default | No, unless Cache-Control says so |
| Safe to retry automatically? | No: change the request first |
What causes HTTP 402?
- Billing issue on the account (expired card, unpaid plan).
- Usage credits exhausted.
How do I fix HTTP 402?
- Return a clear message and a link to the billing page.
- Prefer 403 or 429 if the issue is a plan restriction or rate limit rather than payment.
What should a client do after HTTP 402?
Do not retry. Resolve the billing problem first.
Does HTTP 402 affect SEO?
Not indexed. Avoid on public pages.
Example 402 response
HTTP/1.1 402 Payment Required
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json
{"error":{"status":402,"message":"Payment Required"}} How to return 402 Payment Required in code
Express (Node.js)
res.status(402).json({ error: 'Payment Required' }); Next.js route handler
return Response.json({ error: 'Payment Required' }, { status: 402 }); FastAPI (Python)
raise HTTPException(status_code=402, detail="Payment Required") PHP
http_response_code(402); Nginx
location = /example {
return 402;
} Other 4xx status codes
The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request
Frequently asked questions
Is 402 a standard error?
Should I use 402 for paywalls?
Is 402 a client or server error?
Related
- 403 Forbidden HTTP 403 Forbidden means the server understood the request but refuses to allow it.
- 429 Too Many Requests HTTP 429 Too Many Requests means the client has sent too many requests in a given time and is being rate limit.
- 401 Unauthorized HTTP 401 Unauthorized means the request lacks valid authentication credentials: no token, an expired token or .
- Open the HTTP Status Codes Reference → Free, no signup.