Look up an error code or exception here to find out what caused it and how to fix it. For symptoms without a code, see Troubleshooting.

Facilitator error codes

When ExactAvmFacilitatorScheme.verify() rejects a payment, it returns VerifyResponse(is_valid=False) with invalid_reason set to one of these strings; settle() returns them in error_reason. The constants are defined in x402_algorand.constants. The order in which checks run is on AVM exact scheme. Three constants are defined for compatibility but not returned by the facilitator: invalid_exact_avm_payload (ERR_INVALID_PAYLOAD), invalid_exact_avm_payload_transaction_decode_failed (ERR_TXN_DECODE_FAILED) and invalid_exact_avm_payload_transaction_type (ERR_INVALID_TXN_TYPE). A wrong transaction type is reported as invalid_exact_avm_payload_asset_id_mismatch.

ai-economy-sdk exceptions

Since 0.5.0, every exception ai-economy-sdk raises on purpose derives from AIEconomyError (in ai_economy_sdk.exceptions, also exported from ai_economy_sdk). Each class also derives from the type raised at the same place in 0.4.x, so existing handlers keep working.
Other responses from a gated server: Refusals, settlement failures, expired reservations and failed chain lookups are logged at WARNING to the ai_economy_sdk logger.

x402-algorand exceptions

Since 0.3.0, the exceptions x402-algorand raises derive from X402AlgorandError (in x402_algorand.errors, also exported from x402_algorand). Each also derives from the built-in type raised before 0.3.0. An invalid payment never raises: verify() and settle() return a response with one of the facilitator error codes above. The package logs to the x402_algorand logger.

x402 client errors (Python)

x402-avm-js errors

Since 0.4.0, every error extends X402AvmError and carries a stable code string; name is the class name. Errors raised by algod or by your signTxns callback propagate unchanged.