Expand description
Machine-readable error codes used in x402 verify/settle responses.
Aligned with the x402 v2 specification §9 “Error Handling” and the
cross-SDK conventions established by the Go and TypeScript reference
implementations. When the wire emits an unknown code it round-trips
losslessly via ErrorReason::Custom.
§Categories
- Spec §9 standard codes: 15 canonical reasons every facilitator MUST
recognise (
insufficient_funds,invalid_payload, …). - Cross-chain reserved codes: pragmatic codes used across SDKs but
not enumerated in §9 (
duplicate_settlement,nonce_already_used,permit2_allowance_required). - Upto scheme codes: reserved by
schemes/upto/scheme_upto_evm.md. - SVM-prefixed codes: chain-specific diagnostics emitted by the Solana facilitator.
Custom(CompactString): catch-all preserving any unknown code as received on the wire so clients never lose information.
Structs§
- Payment
Problem - A structured payment-problem record returned through wire boundaries.
Enums§
- Error
Reason - Canonical error code returned on the wire when a payment fails.
Traits§
- AsPayment
Problem - Trait for converting errors into
PaymentProblems.