A quick introduction to 5 AI payments & commerce protocols
To give AI agents the ability to make online purchases, five (competing) agentic commerce protocols have recently emerged. Your mission: master the protocols.
23 missions total
The three key players in ACP transactions
Authorizes payments, owns the customer relationship with the merchant
Facilitates discovery and checkout orchestration
Merchant of record, processes payments, fulfills orders
💡 Key architecture decision: The AI Agent never becomes the merchant of record. This preserves existing merchant-customer relationships and ensures chargebacks flow to the actual seller—not the AI platform.
A customer disputes a charge made through an AI agent. Under ACP's model, who handles the chargeback?
The payment primitive enabling secure agent-initiated transactions
Tokenization flow: PAN to SPT
💡 Why not just use existing tokens? SPTs are specifically designed for delegation. Unlike a standard PaymentMethod token, an SPT can be granted to a third party (the business) by the agent, with explicit usage constraints. The agent never accesses the underlying PAN.
How does an SPT differ from a standard Stripe PaymentMethod token in this architecture?
Programmable security boundaries built into every token
Example SPT response object:
{
"id": "spt_1RgaZcFPC5QUO6ZCDVZuVA8q",
"object": "shared_payment.granted_token",
"usage_limits": {
"currency": "usd",
"max_amount": 5099, // $50.99 in cents
"expires_at": 1751587220 // Unix timestamp
},
"deactivated_at": null
}
Hard cap on transaction value. Prevents overcharging.
Unix timestamp expiry. No stale authorizations.
Locked to specific currency.
Agent can deactivate token anytime via API.
SPTs pass fraud signals to issuer for better authorization rates.
Scope the SPT to a specific merchant. Only that seller can charge the token.
An SPT is issued with max_amount: 5099 and expires_at set to 24 hours from now. The merchant attempts to charge $75.00 fifteen minutes later. What happens?
Click each step to trace the request lifecycle
👆 Click each step to understand the data flow at each stage.
At which point in the ACP flow does the AI agent have visibility into the buyer's actual payment credentials?
You're the AI agent. Make the right architectural decisions.
Test your understanding of ACP architecture
You've mastered ACP fundamentals. Now let's explore Google's AP2 protocol—a different approach using cryptographic mandates.
AP2's staged authorization model
Sarah's signed request: "Buy running shoes, max $150." Delegates authority within constraints.
Sarah reviews and signs: "Nike Pegasus, $129, Foot Locker." Locks the specific purchase.
Signals to payment processor: "agent-initiated, user approved." Full context for the network.
💡 Each mandate is signed: Creates a cryptographic chain showing exactly where authorization existed.
Sarah's agent finds three shoe options from different merchants: Nike ($129), Adidas ($135) and Brooks ($145). The agent presents these to Sarah, and she selects the Nike shoes. What is Sarah signing when she approves this selection?
The cryptographic primitive that makes mandates tamper-proof
Each mandate is a VDC—a tamper-evident, cryptographically signed object:
{
"type": "CartMandate",
"items": [{
"name": "Nike Pegasus",
"price": 12900,
"merchant": "foot_locker_123"
}],
"user_signature": "eyJhbGciOiJS...",
"signed_at": 1751587220
}
💡 Tamper-evident: Signatures are bound to exact values. If anyone modifies "$129" to "$229", verification fails.
A merchant receives a Cart Mandate but modifies the quantity from 1 to 3 before processing. When the user disputes, what happens?
How the mandate chain handles autonomous agent actions
Agent finds options → User reviews and signs Cart Mandate → Purchase proceeds. The user explicitly approved the specific transaction.
Agent finds options within Intent Mandate constraints → Purchases autonomously. User accepted risk for actions within their stated constraints.
💡 The Intent Mandate bridges the gap: With autonomous agents, the Intent Mandate serves as authorization—"you may act on my behalf, within these bounds."
An agent autonomously books a $180 hotel when the Intent Mandate specified "under $200." The user disputes, claiming they didn't approve this specific hotel. What's the likely outcome?
You're the auditor. Examine the evidence and deliver your verdict.
A user claims they only approved $300 for a laptop purchase, but the merchant charged $500. Both parties are adamant. Your job: examine the cryptographic evidence.
"I only approved $300 for the laptop"
"User agreed to $500 including accessories"
{
"type": "IntentMandate",
"user_id": "user_8x7k2m",
"intent": "Purchase laptop",
"max_amount": 50000,
"currency": "usd",
"user_signature": "eyJhbGc...",
"signed_at": 1751587200
}
✓ Signature verified - max_amount: $500
🔎 Examine all evidence before delivering your verdict.
Understanding who does what in the AP2 ecosystem
The end user who initiates purchases through their AI agent and signs mandates to authorize transactions
Sells goods/services, receives mandates from agents, and submits payment requests to processors
Issues and manages Verifiable Digital Credentials (VDCs) that prove identity and authorization
Validates the mandate chain, processes payments, and maintains the cryptographic audit trail
💡 Separation of concerns: AP2 separates credential issuance from payment processing, allowing specialized providers for each function.
A shopper's AI agent presents a Cart Mandate to a merchant. Before processing, who validates that the mandate's VDC is authentic?
Test your understanding of AP2 architecture
You've mastered AP2's mandate chains. Now let's explore Visa's TAP—cryptographic signatures for trusted agent verification.
Understanding HTTP Message Signatures (RFC 9421)
Signs every HTTP request to prove identity
Contains public keys of all trusted agents
Verifies signature using Visa's public keys
💡 RFC 9421 in action: Every TAP request includes a cryptographic signature in the HTTP headers. The merchant or CDN verifies this signature against Visa's registry—only requests from registered agents pass through.
An agent sends a request to buy sneakers. The merchant receives it but the signature doesn't match any key in Visa's registry. What happens?
Agent Intent, Consumer Recognition, and Payment Information
"I'm a Visa-trusted agent here to purchase this specific product." Declares the agent's purpose for visiting this page.
Existing merchant tokens, device IDs, loyalty identifiers. Helps merchants recognize returning customers without exposing card numbers.
Hashed credentials, tokenized payment methods. Actual card numbers never touch the agent layer.
💡 Privacy by design: TAP sends hashed or tokenized identifiers—never raw card numbers or PII. The merchant knows "this is a returning customer" without knowing who specifically.
Sarah's agent visits a merchant she's shopped with before. Which TAP component helps the merchant recognize her without exposing her card number?
Payment Instructions API and Payment Signals API
Consumer sets rules: "Max $200, only electronics, only these merchants." These constraints are stored with Visa.
Agent finds a product and sends a purchase signal to Visa's Payment Signals API with the transaction details.
Visa checks against consumer's instructions. If compliant, payment token is unlocked. If not, transaction is blocked.
💡 Human-in-the-loop: Even with autonomous agents, the consumer's pre-set rules act as guardrails. The token only unlocks when the purchase matches the consumer's instructions.
An agent tries to buy a $300 item when the consumer set a $200 limit in their Payment Instructions. What happens?
You've mastered Visa's TAP. Now let's explore Mastercard's Agent Pay—Agentic Tokens and Know Your Agent verification.
Agent registration and verification before any transaction
Agent developer provides documentation about the agent's purpose, security practices, and intended use cases.
Review process checks agent's compliance, security standards, and business practices—similar to KYC for customers.
Approved agent receives cryptographic keys. Public key added to Mastercard's directory for verification.
💡 KYA = KYC for AI: Just as banks verify customers before opening accounts, Mastercard verifies agents before they can transact. This creates accountability and traceability.
A new AI shopping assistant wants to make purchases using Mastercard. What's the first step?
Dynamic, cryptographically secure payment credentials
Traditional vs Agentic Token flow
Token is bound to specific merchant, amount, and time window. Cannot be reused elsewhere.
Even if stolen, the token only works for its specific, pre-defined context.
Consumer or issuer can revoke the token at any time, immediately stopping all agent transactions.
💡 Defense in depth: Agentic Tokens replace card numbers so agents never see real credentials. Even if compromised, the token's constraints limit damage.
A hacker intercepts an Agentic Token during transmission. What can they do with it?
Biometric consent and the complete transaction lifecycle
"Buy these running shoes for $120" — User expresses what they want to purchase.
Mastercard Passkeys confirm identity via fingerprint or face ID. Creates verifiable credential.
Amount ($120), merchant (Foot Locker), product (Nike shoes) locked into verifiable credential.
Agent presents Agentic Token at checkout. Mastercard verifies token + intent match.
💡 Intent = Authorization: The biometrically-verified intent becomes the authorization. If actual purchase differs from captured intent, transaction is rejected.
An agent captured intent for "Nike shoes, $120, Foot Locker" but submits a transaction for "Nike shoes, $180, Foot Locker". What happens?
You've mastered Mastercard's Agent Pay. Final level: Google's UCP—a unified architecture for commerce interoperability.
UCP's TCP/IP-inspired design for commerce
Core primitives: checkout sessions, line items, totals, shipping. The foundation everything else builds on.
Major functions: Checkout, Orders, Catalog, Identity Linking. Modular features merchants can support.
Optional add-ons: Discounts, Loyalty, AP2 Mandates, Returns. Merchants choose what to implement.
Transport: REST APIs, MCP for LLMs, A2A for agent-to-agent. Multiple ways to access the same commerce logic.
💡 TCP/IP for commerce: Just as the internet has layers (physical, network, transport, application), UCP separates concerns so each layer can evolve independently.
A merchant wants to add loyalty point redemption to their checkout. Which UCP layer handles this?
Clear separation of responsibilities in UCP
Orchestrates the shopping journey. Calls UCP APIs, manages user interaction.
Merchant of Record. Holds liability, fulfills orders, handles disputes.
Manages tokens and secures PII. Issues payment credentials to agents.
Processes actual payments. Connects to card networks, handles settlement.
💡 Separation of concerns: Unlike traditional e-commerce where these roles blur together, UCP explicitly separates them so each party knows their responsibilities.
An AI agent completes a purchase but the item never arrives. Under UCP's role model, who is liable to the customer?
How agents find merchant capabilities via /.well-known/ucp
An agent visiting any UCP-enabled merchant fetches their profile:
{
"merchant": "example-store.com",
"ucp_version": "1.0",
"capabilities": [
"checkout",
"orders",
"identity_linking"
],
"extensions": [
"loyalty",
"discounts"
],
"payment_methods": [
"card",
"bank_transfer"
],
"services": {
"rest": "https://api.example-store.com/ucp",
"mcp": "mcp://example-store.com"
}
}
💡 Decentralized onboarding: No central registry needed. Any merchant can publish their UCP profile, and agents automatically discover what's supported. Like robots.txt but for commerce.
An agent wants to buy from a new merchant. How does it learn what payment methods and features are supported?
Four states guide every UCP transaction
👆 Click each state to understand when the checkout enters that state.
An agent adds items to cart but the merchant requires age verification before selling alcohol. Which state is the checkout in?
UCP's transport-agnostic design works with MCP, A2A, and AP2
For LLM tool calling. Agents invoke UCP as tools within their context window.
For multi-agent commerce. Shopping agent talks to merchant's fulfillment agent.
As an extension. UCP checkout can require signed AP2 mandates for payment authorization.
💡 One commerce protocol, many transports: UCP defines what happens (checkout, orders, payments). How it's delivered (REST, MCP, A2A) is separate. This means merchants implement once, support all agent types.
A merchant implements UCP with REST APIs. Later, an AI agent wants to use MCP instead. What does the merchant need to do?
You've completed the training
👾 I hope you liked it! Thanks for playing. -Joris