# InvalidPaymentRequiredError

> The PAYMENT-REQUIRED header or object is malformed, or a requirement in it is not a valid exact-AVM offer.

```ts
import { InvalidPaymentRequiredError } from 'x402-avm-js';
```

```ts
export class InvalidPaymentRequiredError extends X402AvmError {
  constructor(message: string, options?: { cause?: unknown }) {
    super(message, 'invalid_payment_required', options);
  }
}
```

The PAYMENT-REQUIRED header or object is malformed, or a requirement in it is not a valid exact-AVM offer.

Source: [src/errors.ts](https://github.com/x402-avm/x402-avm-js/blob/main/src/errors.ts#L18)

Source: https://x402-avm.github.io/reference/js/invalid-payment-required-error
