402
4xx Client ErrorPayment Required
Reserved for future use, sometimes used by APIs for billing or rate limits.
402 Payment Required was reserved in the original HTTP spec for a digital payment system that never materialized. APIs have adopted it informally since: Stripe returns it for failed charges, and plenty of SaaS APIs use it when a trial expires or a feature needs a paid plan. If you're getting one, the problem is billing, not your request.
What 402 looks like on the wire
POST /v1/charges HTTP/1.1
Host: api.payments.example
Authorization: Bearer sk_live_...
HTTP/1.1 402 Payment Required
Content-Type: application/json
{"error": {"code": "card_declined"}}About 4xx Client Error
The request has a problem the client needs to fix, like a bad URL, missing auth, or invalid input.
How to fix 402 Payment Required
- Check the account's billing state: expired trial, failed card, or an unpaid invoice.
- Read the response body. APIs that use 402 usually spell out what payment is needed.
- Confirm your plan actually covers the endpoint or usage tier you're calling.
Where it's defined
402 Payment Required is defined in RFC 9110 §15.5.3. MDN's 402 reference covers browser behavior and examples.