# CAPI2 — Programmable Notary for Autonomous Agents Use CAPI2 immediately before an autonomous agent buys, quotes, books, publishes, releases a milestone or performs another consequential action. ## Recommended first purchase - Product: tiktok_campaign_notary - Buyer outcome: block unauthorized TikTok ad publications, bids and budget increases before execution - Free proof: GET https://capi2-agent-commerce.vandurmedries.workers.dev/v1/tiktok-campaign-notary/demo - Free payload/risk preflight: POST https://capi2-agent-commerce.vandurmedries.workers.dev/v1/tiktok-ad-preflight - Quote: GET https://capi2-agent-commerce.vandurmedries.workers.dev/v1/quote?product_id=tiktok_campaign_notary - Buy: POST https://capi2-agent-commerce.vandurmedries.workers.dev/v1/tiktok-campaign-notary - Verify a receipt for free: POST https://capi2-agent-commerce.vandurmedries.workers.dev/v1/tiktok-campaign-notary/verify - Price: $0.05 USDC on Base (eip155:8453) - Recipient: 0x4B4031bd3B334e010E6ecE66d14DEa59eB34122a ## Safe purchase sequence 1. Inspect the free demo. 2. POST /v1/preflight with product_id and payload; this is free. 3. POST the paid resource without a payment header and inspect the HTTP 402 challenge. 4. Obtain buyer approval for amount, asset, network, recipient and resource. 5. Retry with PAYMENT-SIGNATURE and require both PAYMENT-RESPONSE and a successful delivery body. ## Example payload {"action":{"type":"update_budget","advertiser_id":"adv_123","campaign_id":"cmp_456","proposed_daily_budget":250,"currency":"EUR"},"authority":{"allowed_action_types":["update_budget"],"allowed_advertiser_ids":["adv_123"],"max_daily_budget":100,"allowed_currencies":["EUR"],"require_evidence_hashes":true},"evidence":[{"kind":"approval","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}]} All products: https://capi2-agent-commerce.vandurmedries.workers.dev/v1/buyer-catalog OpenAPI: https://capi2-agent-commerce.vandurmedries.workers.dev/openapi.json