Skip to main content

Client examples

Workflow

  1. Call the protected resource → receive 402
  2. Parse accepts → choose one requirements
  3. Generate payment signature (Permit/EIP-3009/Permit2)
  4. Set X-Payment and retry request → receive 200

Best practices

  • Always set maxValue to prevent overpayment
  • For resources with multiple options, pass a selector to prioritize a token
  • Print the payload and 402 body on failures for troubleshooting

FAQs

  • Insufficient balance/expired/nonce error → re-sign as instructed
  • Failures after network switch → ensure network matches the requirements

Client SDK

API and examples

Payment Payload

Payload spec

Payment Types

Authorization options compared

Supported

Query support capabilities