Errors /
"Invalid payment required header"
The client could not read the seller's quote.
| Reported by | the x402 client, before any payment is sent |
| Usually fixed by | the seller |
Cause
The PAYMENT-REQUIRED response header is not base64-encoded JSON in the x402 version 2 shape, so the client cannot tell what to pay.
Fix
- Seller: encode the quote as base64 of UTF-8 JSON. Paste the header into the header decoder to see what a client sees.
- Check that a proxy or CDN is not truncating or rewriting the header.
- The malformed scenario sends an unreadable header to test that your client fails cleanly.
Reproduce it
The Unreadable quote scenario on this site exercises this situation.
About this reference
Causes are taken from the source of @x402/core 2.31. Other facilitators and later versions may use the same code for slightly different checks. See all x402 errors.