Checkout

Merchant checkout sessions. Customer pays USDC/USDT/ETH/SOL/BTC; you receive stablecoin (default) or auto-converted fiat.

POST /api/v1/checkout/sessions

Bearer apk_ · write:checkout · Idempotent

{
"amountUsdCents": 2500,
"description": "Pro plan · 1 seat",
"merchantReference": "order-1234",
"successUrl": "https://yoursite.com/thanks",
"cancelUrl": "https://yoursite.com/cart",
"acceptedAssets": ["USDC", "USDT"],
"acceptedChains": ["ethereum", "polygon", "arbitrum", "base", "solana"],
"expiresInSeconds": 1800,
"settlementOption": "hold_stablecoin"   // or "convert_to_fiat"
}

Returns { session: { id, hostedUrl, receivingAddresses[], expiresAt } }. Redirect to hostedUrl.

GET /api/v1/checkout/sessions

Bearer apk_ · read:checkout

Last 50 sessions.

GET /api/v1/checkout/sessions/[id]

Bearer apk_

Full row, merchant-side.

GET /api/v1/checkout/sessions/[id]/status

Public

Customer-safe status poll — used by the hosted page. Auto-expires past TTL.

POST /api/v1/checkout/sessions/[id]/select

Public

Customer picks (asset, chain). Pins the receiving address and enqueues the on-chain confirmation watcher.

{
"asset": "USDC",
"chain": "polygon"
}

POST /api/v1/checkout/sessions/[id]/simulate

Public · sandbox-only

Drives the FSM to completed without a real chain. Useful for E2E testing.

State machine

pending → awaiting_payment → confirming (n/3) → completed | underpaid | failed
                                              ↘
                                                expired (TTL)

Outbound webhook

checkout.session.completed fires to every active workspace endpoint subscribed to that event (or *). Carries { id, amountUsdCents, txHash, payerAddress }.