Skip to main content
The Custom Integration path gives you full control over the payment UX. You build the wallet connect flow, construct and sign the EIP-3009 typed data, then call Ababil’s /pay endpoint to settle. Ababil handles signature verification and the on-chain relay only. You write: Frontend wallet connect, chain switching, EIP-3009 signing logic, and one settlement call. Ababil handles: Signature verification, USDC balance check, on-chain transferWithAuthorization, and intent status update.
This path is required for AI agents paying programmatically. For browser-based human buyers, the Hosted Gateway is simpler to implement.

Flow


Step 1 — Create Intent

Request Body

Response 201

Key fields:

Step 2a — Sign EIP-3009 (EVM: Base, Ethereum, Arc)

Build and sign a TransferWithAuthorization EIP-712 typed data message with the buyer’s wallet.

Typed Data Structure

Signing Rules

usdcDomainName — always use the value from payment_requirements[n].usdcDomainName. All testnet chains return "USDC". Never hardcode "USD Coin" — it will produce an invalid signature.
nonce — must be a random bytes32 value, not a counter. The USDC contract records used nonces permanently; reusing any nonce will always fail with INVALID_SIGNATURE.

Code Examples


Step 2b — Sign Solana SPL Transfer

Solana uses a two-step process: first fetch an unsigned transaction from Ababil (which requires the buyer’s public key), then sign it with the buyer’s Solana wallet.

2b.1 — Build the Unsigned Transaction

Response 200:

2b.2 — Sign with Phantom (browser)


Step 3 — Settle Payment

Submit the signed authorization to Ababil for on-chain settlement.

Response 200

What Ababil Does Server-Side

  1. Validates the EIP-3009 signature (viem verifyTypedData) or Solana transaction signatures.
  2. Checks the buyer’s USDC balance is sufficient.
  3. Confirms the intent is still pending and not expired.
  4. Calls usdc.transferWithAuthorization(from, to, value, validAfter, validBefore, nonce, v, r, s) via relay EOA.
  5. USDC moves directly buyer → merchant. Ababil never holds funds.
  6. Marks the intent paid in the database with tx_hash, buyer_address, and paid_at.