← Back to status codes
HTTP Status Code
402 Payment Required
Client ErrorThe request cannot be completed until payment is made or billing requirements are satisfied.
HTTP status code reference, response example, common causes, fixes, and related status codes.
What does HTTP 402 Payment Required mean?
HTTP 402 Payment Required is a status code sent by a server to indicate the result of an HTTP request.
Status codes help browsers, APIs, apps, and backend systems understand whether a request succeeded, failed, was redirected, or needs additional action.
In practice, HTTP 402 Payment Required usually appears when a server responds under specific request, validation, permission, or infrastructure conditions.
Response example
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"error": "payment_required",
"message": "Upgrade your plan to continue."
}HTTP example
HTTP/1.1 402 Payment Required
Common causes
- The requested API feature is behind a paid plan
- The account has reached a billing or usage limit
- A subscription or payment method issue is blocking access
How to fix it
- Check whether the account or API key is linked to an active billing plan
- Upgrade the subscription if the endpoint or feature is paywalled
- Review the payment method, billing status, or account limits
Common mistakes
- Assuming the status code alone explains the full backend issue
- Ignoring related response headers that add important context
- Treating temporary errors as permanent failures
- Retrying too aggressively without checking the cause
- Debugging the frontend only when the problem is server-side
How browsers and APIs use it
Browsers, APIs, and backend services use HTTP status codes to understand the outcome of a request. Depending on the status code, an application may render content, retry a request, redirect the user, show an error, or trigger a different flow in the client or server.
Practical developer insight
402 Payment Required was originally marked as 'reserved for future use' in the HTTP specification. In practice, it is now widely used by APIs and SaaS platforms to signal billing-related restrictions and paid access requirements.
Client-side example
if (response.status === 402) {
console.error("This feature requires payment or an active subscription.");
}