Skip to main content
Usage-based upto payments move USDC through the Permit2 contract, so the buyer’s USDC allowance for Permit2 must cover each payment. There are two ways to grant the allowance:
  • Onchain approval: one approve transaction grants Permit2 spending power indefinitely. Best when the buyer transacts repeatedly and can hold the gas asset.
  • Gasless permit: the buyer signs an EIP-2612 permit for each payment, which you, as the seller, attach to the Facilitator Service call. Best when the buyer can’t hold the gas asset or integrates purely offchain, since Circle pays settlement gas when the permit is applied.

Prerequisites

Before you begin, ensure that you’ve:

Grant the allowance onchain

Send one approve from the buyer, with Permit2 as the spender. The example targets Arc testnet.
approve-permit2.ts
This example approves maxUint256, which lets Permit2 move any amount of the buyer’s USDC indefinitely. For production, consider approving only what each payment needs and refreshing allowances periodically.
If a permit is present but invalid, Facilitator Service returns one of the permit reasons on /verify or /settle.