HTTP 402 Payment Required vs 520 Web Server Returned an Unknown Error
HTTP 402 (Payment Required) is a 4xx Client Error response, while 520 (Web Server Returned an Unknown Error) 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, 520 means that cloudflare-specific. The origin server returned an unexpected response that Cloudflare could not process.
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. The origin server returned an unexpected response that Cloudflare could not process.
When You See It
When Cloudflare receives an empty, unknown, or malformed response from the origin.
How to Fix
Check origin server logs. Ensure responses include proper headers. Verify SSL configuration.
Key Differences
402 is a 4xx Client Error response, while 520 is a 5xx Server Error response.
HTTP 402: Reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue.
HTTP 520: Cloudflare-specific. The origin server returned an unexpected response that Cloudflare could not process.
You encounter 402 when on some APIs when a subscription has expired or payment is needed.
You encounter 520 when when Cloudflare receives an empty, unknown, or malformed response from the origin.
When to Use Which
For 402 (Payment Required): Check your billing status, update payment method, or upgrade your subscription. For 520 (Web Server Returned an Unknown Error): Check origin server logs. Ensure responses include proper headers. Verify SSL configuration.