# HTTP 402 Payment Required

**Code:** `402` · **Category:** HTTP · **Seen on:** REST API

The service wants payment before it will process the request — an unpaid invoice, exhausted credits or a failed card.

## 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

1. Check the billing page or invoice for the account the API key belongs to
2. Top up credits or update the payment method
3. For Stripe, read error.decline_code and ask the customer for another card

## Detailed fix by platform

### Node.js

1. 

```javascript
try { await stripe.paymentIntents.confirm(id); }
catch (e) { if (e.statusCode === 402) console.log(e.code, e.decline_code); }
```


## How to diagnose

1. **Account** — Which account/key is being charged?
2. **Body** — Error type/decline_code
3. **Billing** — Overdue invoices or zero credit?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/http/402-payment-required)
