SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. 4xx Client Error
  3. 402 Payment Required

402 Payment Required

💳
402
Payment Required
!
?

Example HTTP Response

HTTP Response
HTTP/1.1 402 Payment Required
Content-Type: application/json

{"error": "Payment required to access this resource"}
Common Causes
  • Paywall or subscription required
  • Payment processing needed
  • Premium content access
Technical Details

What does this mean?

Time to open your wallet! This code was reserved for when the web would have built-in payments. Still waiting on that future!

Technical Definition

Reserved for future use. Originally intended for digital payment systems, but not yet standardized.

RFC Says

"The 402 (Payment Required) status code is reserved for future use."

Plain English:

This code was reserved for digital payment systems but was never standardized. While some APIs use it for paywalls or subscription requirements, it has no official meaning in HTTP. There's no standard way to use it.

Common Misinterpretation

Some developers use 402 for payment/subscription walls, but this isn't standardized. Most APIs use 403 (Forbidden) with a custom error message explaining payment is required, or create custom 4xx codes. 402's future use case was never defined.

View RFC Documentation
Code Snippets

Ready-to-use code for returning this HTTP status in your application:

Node.js
// Express.js
app.get('/example', (req, res) => {
  res.status(402).json({
    error: 'Payment Required',
    message: 'Your error message here'
  });
});

// Native HTTP
const http = require('http');

http.createServer((req, res) => {
  res.writeHead(402, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({
    error: 'Payment Required',
    message: 'Your error message here'
  }));
}).listen(3000);

402 Payment Required FAQ

What causes a 402 Payment Required error?

Paywall or subscription required. Payment processing needed. Premium content access.

401 Unauthorized403 Forbidden

Popular Status Codes

  • 200 OK
  • 301 Moved Permanently
  • 302 Found
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable

Compare Codes

  • 401 vs 403
  • 301 vs 302
  • 404 vs 410
  • 500 vs 502
  • Compare any codes →

Categories

  • Informational
  • Success
  • Redirection
  • Client Error
  • Server Error
  • NGINX
  • Cloudflare
  • AWS ELB
  • Microsoft IIS

Tools

  • Cheat Sheet
  • Status Code Quiz
  • URL Checker
  • API Playground
  • Blog

© 2026 SiteError.com. All rights reserved.