# "Invalid payment required header"

> The client could not read the seller's quote. What causes this x402 error and how to fix it.

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](https://x402testendpoint.com/tools/decode) to see what a client sees.
- Check that a proxy or CDN is not truncating or rewriting the header.
- The [malformed scenario](https://x402testendpoint.com/scenarios/malformed) sends an unreadable header to test that your client fails cleanly.

## Reproduce it

The [Unreadable quote scenario](https://x402testendpoint.com/scenarios/malformed) 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](https://x402testendpoint.com/errors).

Source: https://x402testendpoint.com/errors/invalid-payment-required-header
