HTTP 402 Payment Required vs 417 Expectation Failed
Both HTTP 402 (Payment Required) and 417 (Expectation Failed) 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, 417 means that the server cannot meet the requirements of the Expect header.
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 cannot meet the requirements of the Expect header.
When You See It
When the server doesn't support Expect: 100-continue.
How to Fix
Remove the Expect header from your request.
Key Differences
HTTP 402: Reserved for future use. Originally intended for digital payment systems, some APIs use it to indicate a billing or subscription issue.
HTTP 417: The server cannot meet the requirements of the Expect header.
You encounter 402 when on some APIs when a subscription has expired or payment is needed.
You encounter 417 when when the server doesn't support Expect: 100-continue.
When to Use Which
For 402 (Payment Required): Check your billing status, update payment method, or upgrade your subscription. For 417 (Expectation Failed): Remove the Expect header from your request.