402 Payment Required

The HTTP 402 Payment Required status code is a client error returned by the server to indicate payment is required before the client accesses the requested resource.

Usage

When a 402 Payment Required error arrives, the client understands access to the requested resource is not granted at this time.

Reserved status

402 Payment Required is reserved for future use. Currently its behavior is non-standard and varies across implementations.

Because this is a non-standard response, different providers have used the status in different ways. For example, the Shopify API returns 402 Payment Required to indicate the online shop is frozen and the store administrator must pay an outstanding balance to restore access.

The Stripe API returns 402 Payment Required when a payment attempt fails, such as a declined card or insufficient funds.

SEO impact

Search engines like Google do not index a URL returning a 402 Payment Required status. Previously indexed URLs returning this status code are removed from search results.

Example

The client requests a resource and the server responds with 402 Payment Required to indicate access is blocked until payment is made. The response body explains the reason and provides a link to resolve the issue.

Request

GET /tech-news HTTP/1.1
Host: www.example.re

Response

HTTP/1.1 402 Payment Required
Content-Type: text/html
Content-Length: 187

<html>
  <head>
    <title>Payment Required</title>
  </head>
  <body>
    <p>Access to this resource requires an active
    subscription. Renew at /account/billing.</p>
  </body>
</html>

How to fix

A 402 Payment Required means the service expects payment or an active subscription before granting access. Because this status is non-standard, the fix depends on the specific service returning the error.

  1. Check payment and subscription status. Log into the service dashboard and verify the account is active. An expired trial, lapsed subscription, or outstanding balance triggers this status. Shopify returns 402 when a store is frozen due to unpaid invoices. Stripe returns 402 when a charge fails (declined card, insufficient funds).

  2. Verify billing information is current. An expired credit card, failed charge, or removed payment method blocks access. Update payment details through the provider's billing portal. Check for holds or fraud blocks on the payment method by contacting the card issuer.

  3. Review API plan limits. Some services return 402 when usage exceeds the current plan tier. Check the provider's usage dashboard for quota consumption. Upgrade the plan or wait for the billing cycle to reset.

  4. Inspect the response body for resolution details. Most providers include a specific error message, error code, or link to a billing page in the 402 response body. Stripe responses include a decline_code field (insufficient_funds, card_declined, expired_card) pinpointing the failure reason.

  5. Retry with an alternative payment method. When a specific card or bank account fails, switch to a different payment method and resubmit. Some providers allow fallback payment sources configured in advance.

  6. Contact the API provider or service administrator. Because 402 behavior is non-standard, provider documentation defines the exact resolution steps. If the response body lacks detail, open a support ticket with the request ID and timestamp.

Code references

.NET

HttpStatusCode.PaymentRequired

Rust

http::StatusCode::PAYMENT_REQUIRED

Rails

:payment_required

Go

http.StatusPaymentRequired

Symfony

Response::HTTP_PAYMENT_REQUIRED

Python3.5+

http.HTTPStatus.PAYMENT_REQUIRED

Java

java.net.HttpURLConnection.HTTP_PAYMENT_REQUIRED

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_PAYMENT_REQUIRED

Angular

@angular/common/http/HttpStatusCode.PaymentRequired

Takeaway

The 402 Payment Required status code is reserved for future use and its current behavior is non-standard. The intended purpose is to support digital cash or micro-payment schemes for content access.

See also

Last updated: March 4, 2026