Payment API failure
- What it usually points to
- The card, account or transfer was rejected
- Where to look
- The JSON error code and message in the body
HTTP 402 is reserved for future use and has no standard behavior. See why some APIs return it anyway, how to read it, and what to send instead.
HTTP 402 Payment Required is reserved for future use in HTTP, and MDN calls it nonstandard: no convention exists, so each system uses it its own way. APIs often return it when a payment, subscription or quota check fails. Read the response body for the reason, then fix the billing issue on that service.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
Because there is no standard, a 402 means whatever the service that sent it says. The service, not your browser or network, is the cause. MDN's example is a payment API that uses 402 as a generic catch-all for failed payment requests, where the body reports an expired card.
Many services put the exact reason on the page or in the response body, such as an expired card.
Open the account's billing page and look at the payment method, plan status and any unpaid invoice.
Once the payment method or plan is valid, repeat the action.
If billing looks fine, send the provider the time, the action and the error text.
HTTP/1.1 402 Payment Required
Content-Type: application/json
{"error": {
"code": "expired_card",
"doc_url": "https://example.com/error-codes#expired-card",
"message": "The card has expired. Verify expiration or use a different card."
}}4 questions people ask next, answered from the sources on this page.
It was meant for digital cash and micro-payments. In practice, some payment APIs use it as a catch-all for failed payment requests, though no standard says so.
RFC 9110 reserves 402 for future use, so it has no standard meaning. A 403 means the server understood the request but refuses to fulfill it.
It is registered, but RFC 9110 says it is reserved for future use and MDN calls it nonstandard.
Read the response body, fix the problem it names, such as the payment method, then retry. If the body gives no reason, ask the provider.
Run the free audit, then approve the fixes. Every change can be undone.