createCheckout()
The SDK's front door. Resolves a sparse merchant config into a fully-defaulted checkout handle whose methods map 1:1 to the wire endpoints and MCP tools.
createCheckout(config) is the one call a merchant makes. It resolves a sparse
CheckoutConfig into a fully-defaulted handle — minting a receipt-signing key if you
didn't supply one, wiring the default in-memory store, and defaulting the rails to
[x402, mock].
import { createCheckout, BALANCED } from '@veto-protocol/checkout';
const checkout = createCheckout({
merchant: { id: 'acme', name: 'Acme Corp', domain: 'shop.acme.example' },
catalog: [
{ sku: 'widget', name: 'Blue Widget', price: { amount: '12.50', currency: 'USD' }, available: true },
],
receiving: { x402: { chain: 'base', address: '0xYourAddress', asset: 'USDC' } },
policy: BALANCED(),
});The handle
Every method maps 1:1 to a wire endpoint (and to an MCP tool):
| Method | Endpoint |
|---|---|
manifest() | GET /.well-known/agentic-checkout.json |
catalog() | GET /agent/catalog |
createSession(body) | POST /agent/checkout |
settle(id, body) | POST /agent/checkout/{id}/settle |
getSession(id) | GET /agent/checkout/{id} |
verifyReceipt(jws) | offline receipt verification |
receiptPublicJwk() / receiptJwks() | the published verifying key |
CheckoutConfig
| Field | Notes |
|---|---|
merchant | { id, name, domain }. |
catalog | A CatalogItem[] or a (possibly async) function for dynamic inventory. |
receiving | Non-custodial per-rail destinations — your address. |
policy | A MerchantPolicy (start from a preset). |
rails | Defaults to [x402, mock] when omitted. |
store | A SessionStore; defaults to in-memory MemoryStore. |
trustedIssuers | { veto: { jwksUrl?, jwks? } } for mandate verification. |
receiptSigningKeySeedB64 | base64 32-byte Ed25519 seed; autogenerated if absent. |
sessionTtlSeconds | Default 900. |
taxRate | Default 0. |
intentMatcher | Optional (intent, cart) => 0..1 score for intent policy. |
onEvent | Optional fire-and-forget terminal telemetry hook. |
Hosted and self-hosted merchants run the identical SDK — only the store differs. Use
loadCheckoutConfig() to compile persisted rows into the exact CheckoutConfig the handle
consumes.
SDK · CLI · MCP
The three surfaces of Veto Checkout — the @veto-protocol/checkout SDK, the veto CLI, and the MCP server that lets an agent buy from any protocol-speaking merchant.
HTTP adapters
Mount a checkout handle on node:http, Express, Hono, or Next.js — one line each — or call the handle directly with no HTTP at all.