HTTP 304 Not Modified vs 402 Payment Required
HTTP 304 (Not Modified) is a 3xx Redirection response, while 402 (Payment Required) is a 4xx Client Error response. 304 indicates that the resource has not been modified since the last request. The client can use its cached copy. In contrast, 402 means that reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue.
Description
The resource has not been modified since the last request. The client can use its cached copy.
When You See It
When the browser cache is still valid (If-None-Match / If-Modified-Since headers match).
How to Fix
No fix needed. This saves bandwidth by confirming the cached version is still current.
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.
Key Differences
304 is a 3xx Redirection response, while 402 is a 4xx Client Error response.
HTTP 304: The resource has not been modified since the last request. The client can use its cached copy.
HTTP 402: Reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue.
You encounter 304 when when the browser cache is still valid (If-None-Match / If-Modified-Since headers match).
You encounter 402 when on some APIs when a subscription has expired or payment is needed.
When to Use Which
For 304 (Not Modified): No fix needed. This saves bandwidth by confirming the cached version is still current. For 402 (Payment Required): Check your billing status, update payment method, or upgrade your subscription.