Skip to main content

Type

Field highlights

  • scheme: always "exact"
  • network: kebab-case network name (e.g., bsc, base-sepolia)
  • maxAmountRequired: maximum amount to pay (wei)
  • payTo: merchant address (EIP-7702)
  • asset: token contract address
  • maxTimeoutSeconds: signature validity window (anti-replay)

Example

Zod schema

Supported networks

Validation highlights

  • scheme must be "exact"
  • network must match client/chain config
  • BigInt(payment.value) <= BigInt(maxAmountRequired)
  • resource is a valid URL and matches the protected resource
  • payTo equals the merchant recipient address (EIP-7702 recommended)
  • Timeout: deadline/validBefore <= now + maxTimeoutSeconds
  • If paymentType is specified, the client must use that type

Common scenarios

  • Fixed-price API: create and cache requirements at startup, reuse to reduce overhead
  • Dynamic pricing: compute maxAmountRequired/description from request context
  • Multiple token options: return multiple accepts for client selection (see 402)

Combined with 402