HTTP

HTTP 402 Payment Required vs 524 A Timeout Occurred

HTTP 402 (Payment Required) is a 4xx Client Error response, while 524 (A Timeout Occurred) is a 5xx Server Error response. 402 indicates that reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue. In contrast, 524 means that cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.

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

Cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.

When You See It

When a request to the origin takes longer than Cloudflare's 100-second timeout.

How to Fix

Optimize slow endpoints. Move long-running tasks to background jobs.

Key Differences

1.

402 is a 4xx Client Error response, while 524 is a 5xx Server Error response.

2.

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

3.

HTTP 524: Cloudflare-specific. A TCP connection was established but the origin didn't respond with an HTTP response in time.

4.

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

5.

You encounter 524 when when a request to the origin takes longer than Cloudflare's 100-second timeout.

When to Use Which

For 402 (Payment Required): Check your billing status, update payment method, or upgrade your subscription. For 524 (A Timeout Occurred): Optimize slow endpoints. Move long-running tasks to background jobs.

Learn More