- Home
- Tools
- Developer Tools
- HTTP Status Codes
- 402 Payment Required
402 Payment Required
Reserved for payments since the early days of HTTP and never defined further. Some APIs use it for a failed charge or an empty balance.
- Class
- 4xx Client error. The request is the problem: a wrong address, missing credentials, data the server can't accept.
- Defined in
- RFC 9110
What causes it
The standard only says that the code is reserved for future use. A number of services have given it a meaning of their own: a payment that did not go through, a subscription that has run out, a quota that is used up. What it means exactly is in the documentation of the service you are talking to.
What to do about it
Read the body of the response, and then look at the account: pay the invoice, top up the balance or move to a larger plan. Sending the same request again does not help.
If you build an API, be aware that clients have no fixed expectations of a 402. A 403 with a clear message, or a 429 for a quota, is better understood.
Not to be confused with
| 403 Forbidden | Refused for a reason that has nothing to do with payment. |
|---|---|
| 429 Too Many Requests | Too many requests in a period, the usual code for a quota. |
All codes are on the list of HTTP status codes, which can be searched by number and by word.
Other 4xx codes
- 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
- 424 Failed Dependency
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons