04 / payments

Pay at the door.

Some doors charge admission. whatcanido ships two rails out of the box: x402 for cents-per-call agent traffic, Stripe Connect for booking-grade flows. Both run before the action does, so the door never opens for free.

01two rails, one slot
rail · x402

x402

  • HTTP 402 challenge with USDC amount
  • EIP-3009 transferWithAuthorization
  • verify on Base, optionally settle via relayer
  • cents-to-dollars, no accounts, instant
Read the spec
rail · stripe connect

Stripe Connect

  • site is a Connect destination, whatcanido is platform
  • PaymentIntent inline in the AAM challenge
  • SCA-compliant, refundable, statement-friendly
  • right rail for $10–$1,000+ booking flows
Wire it in Studio
02the 402 dance

Five HTTP turns to open the door.

  1. 01
    Agent calls a paid action without payment.
    Door is locked. No X-Payment header.
    POST
  2. 02
    Site responds 402 with the challenge.
    Amount, recipient, network, USDC contract, nonce.
    402
  3. 03
    Agent signs EIP-3009 transferWithAuthorization.
    Off-chain typed-data signature over USDC.
    viem
  4. 04
    Agent retries with X-Payment header.
    Carries the signed payload, base64.
    POST
  5. 05
    Site verifies, settles if needed, runs the action.
    Door opens. Audit row stamped with payer + tx hash.
    200
402 challenge body402
HTTP/1.1 402 Payment Required
Content-Type: application/json
X-Payment-Required: x402

{
  "x402_version": "0.1",
  "challenges": [{
    "scheme":   "exact",
    "network":  "base",
    "asset":    "0x833589fCD6e...02913",
    "max_amount_required": "5000",
    "pay_to":   "0xMerchant...",
    "resource": "/api/b/tadeas-reads/premium_search"
  }]
}
03why x402 fits agents

Agents do not have OAuth-grade trust with payment providers. They cannot tap an Apple Pay sheet. What they can do is sign structured permits. EIP-3009 is the EVM standard for that — a permit-style off-chain signature the merchant submits.

x402 wraps it in a clean HTTP protocol: agent gets a challenge, signs, retries. No accounts, no callback URLs, no payment pages. The user can supervise (“you are about to spend $0.10, ok?”) or the agent can pay autonomously up to a budget.

04when to use stripe instead

x402 shines for actions priced cents-to-a-few-dollars: per-search fees, API gates, premium reads. Above ~$5 the on-chain UX gets thinner — users want refunds, disputes, statements. Stripe Connectis whatcanido's rail for that:

  • Site is a Connect Express account; whatcanido is the platform.
  • Booking actions present a payment_intent inline in the AAM challenge with client_secret.
  • Agent (or its user via paste-back) confirms the intent. Money goes to the site; whatcanido takes a configurable platform fee.
ship a paid action

Add a paid door.

Tell Studio in chat: “make search_recipes paid at $0.05”. We wire the 402, stamp the wallet on the action, and you are collecting at the slot.

Open Studio