Need help? Join the x402 Discord for support from the community.
Common Errors
Unable to estimate gas
This is a client-side EVM error, not an x402 error. It occurs when your wallet or provider can’t simulate the transaction.
Common causes
Common causes
- Insufficient token balance: Your wallet doesn’t have enough USDC to cover the payment amount.
- Invalid recipient address: The
payToaddress in payment requirements is invalid or a contract that can’t receive tokens. - Network RPC issues: The RPC endpoint is unavailable or rate-limited.
- Wrong network: Your wallet is connected to a different network than specified in the payment requirements.
How to fix
How to fix
Verify your wallet has sufficient balance and is connected to the correct network:
invalid_request: doesn't match schema (oneOf)
This error means the payload structure doesn’t match the x402Version you’ve set.
Common causes
Common causes
- Version mismatch: The payload structure doesn’t match the
x402Versionfield. v1 and v2 have different payload schemas. - Mixed v1/v2 imports: Your code mixes imports from v1 and v2 packages, causing inconsistent payload formats.
- Wrong header names: v1 uses
X-PAYMENT, v2 usesPAYMENT-SIGNATURE.
How to fix
How to fix
The facilitator supports both v1 and v2 protocols. Ensure your payload structure matches the version you’re using:
- If using v1: Set
x402Version: 1and use v1 payload structure - If using v2: Set
x402Version: 2and use v2 payload structure
402 Payment Required (after attaching payment header)
The server is still returning 402 even though you included the PAYMENT-SIGNATURE header.
Common causes
Common causes
- Wrong header name: Using legacy
X-PAYMENTinstead ofPAYMENT-SIGNATURE. - Invalid signature: Wrong chain ID or payload fields.
- Insufficient amount: Payment amount is less than required.
- KYT flagged: Payer address was flagged by Know Your Transaction checks.
How to fix
How to fix
Check the
error field in the server’s JSON response for details. Common fixes:- Use
PAYMENT-SIGNATUREheader (notX-PAYMENT) - Verify your USDC balance meets the required amount
- Check that your network ID matches (e.g.,
eip155:8453for Base mainnet)
Works on testnet, fails on mainnet
Your integration works on Base Sepolia but fails on Base mainnet.Common causes
Common causes
- Wrong network ID: Using testnet ID (
eip155:84532) instead of mainnet (eip155:8453). - Wrong facilitator: The x402.org testnet facilitator does NOT support mainnet.
- No mainnet USDC: Your wallet has testnet USDC but not mainnet USDC.
- Insufficient gas: Mainnet requires real ETH for gas fees.
How to fix
How to fix
- Update network to
eip155:8453(Base mainnet) - Use CDP facilitator for mainnet:
https://api.cdp.coinbase.com/platform/v2/x402 - Fund your wallet with mainnet USDC and ETH
- See Network Support for facilitator details
No scheme registered
The x402 client or server doesn’t have a payment scheme registered for the requested network.
Common causes
Common causes
- Missing scheme registration: You didn’t call
.register()for the network. - Wrong network ID format: Using legacy format (
base-sepolia) instead of CAIP-2 (eip155:84532).
How to fix
How to fix
Facilitator API Error Codes
When the facilitator returns an error, check theinvalidReason (for verify) or errorReason (for settle) field.
Verification errors (invalidReason)
Verification errors (invalidReason)
| Error Code | Meaning |
|---|---|
insufficient_funds | Payer doesn’t have enough tokens |
invalid_scheme | Unsupported payment scheme |
invalid_network | Unsupported network |
invalid_x402_version | Wrong protocol version (v1 vs v2 mismatch) |
invalid_payload | Malformed payment payload |
invalid_exact_evm_payload_signature | EVM signature verification failed |
invalid_exact_evm_payload_authorization_value_too_low | Payment amount less than required |
invalid_exact_evm_payload_authorization_valid_before | Payment authorization expired |
invalid_exact_evm_payload_authorization_from_address_kyt | Payer address flagged by KYT |
invalid_exact_svm_payload_transaction_simulation_failed | Solana transaction simulation failed |
Settlement errors (errorReason)
Settlement errors (errorReason)
| Error Code | Meaning |
|---|---|
settle_exact_failed_onchain | Transaction failed onchain |
settle_exact_node_failure | Blockchain node connection failed |
settle_exact_evm_transaction_confirmation_timed_out | EVM transaction confirmation timed out |
settle_exact_svm_transaction_confirmation_timed_out | Solana transaction confirmation timed out |
Still Need Help?
- x402 Discord - Community support
- GitHub Issues - Bug reports and feature requests