What does HTTP 402 mean?
Reserved for future use; some APIs use it when a payment or plan upgrade is needed. There is no standard behavior, but services such as Stripe, Shopify and various SaaS APIs return 402 when a card is declined, a subscription has lapsed or a quota requires an upgrade.
4xx Client error: The request has a problem the client can fix: wrong URL, missing credentials, bad data or too many requests.
Common causes of a 402 error
- Failed payment or exceeded paid quota on an API.
How to fix 402 Payment Required
- Check the billing status of the account.
402 and SEO
Pages should not return 402 to crawlers.
Example response
HTTP/1.1 402 Payment Required
How to return a 402 response
Node.js (Express)
res.status(402).json({ error: 'Payment Required' });PHP
http_response_code(402);Python (Flask)
return {'error': 'Payment Required'}, 402Go (net/http)
w.WriteHeader(402)nginx
return 402;
Related status codes
- 403 Forbidden — The server understood the request but refuses to authorize it.
- 429 Too Many Requests — The client sent too many requests in a given amount of time.
Check which status code a URL returns with the HTTP header checker.