HTTP

HTTP 402 Payment Required vs 415 Unsupported Media Type

Both HTTP 402 (Payment Required) and 415 (Unsupported Media Type) belong to the 4xx Client Error category. 402 indicates that reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue. Meanwhile, 415 means that the server refuses to accept the request because the Content-Type is not supported.

Description

Reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue.

When You See It

On some APIs when a subscription has expired or payment is needed.

How to Fix

Check your billing status, update payment method, or upgrade your subscription.

Description

The server refuses to accept the request because the Content-Type is not supported.

When You See It

When sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.

How to Fix

Set the correct Content-Type header matching the data format you're sending.

Key Differences

1.

HTTP 402: Reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue.

2.

HTTP 415: The server refuses to accept the request because the Content-Type is not supported.

3.

You encounter 402 when on some APIs when a subscription has expired or payment is needed.

4.

You encounter 415 when when sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.

When to Use Which

For 402 (Payment Required): Check your billing status, update payment method, or upgrade your subscription. For 415 (Unsupported Media Type): Set the correct Content-Type header matching the data format you're sending.

Learn More