HTTP 402 Payment Required
The service wants payment before it will process the request — an unpaid invoice, exhausted credits or a failed card.
Seen on:
REST API
Meaning
402 was reserved for future use in the HTTP spec, but many APIs use it: Stripe returns 402 for declined cards (card_error), Vercel/Netlify/Shopify when a plan limit or invoice is unpaid, and AI/SaaS APIs when credits run out.
Common causes
- Card declined (Stripe card_error)
- Account billing overdue or trial expired
- Prepaid credits/quota exhausted
- Feature requires a paid plan
⚡ Quick fix
- Check the billing page or invoice for the account the API key belongs to
- Top up credits or update the payment method
- For Stripe, read error.decline_code and ask the customer for another card
Detailed fix by platform
Node.js
- javascript
try { await stripe.paymentIntents.confirm(id); } catch (e) { if (e.statusCode === 402) console.log(e.code, e.decline_code); }
How to diagnose
- Account — Which account/key is being charged?
- Body — Error type/decline_code
- Billing — Overdue invoices or zero credit?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in HTTP
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026