The x402 Payment Protocol
How HTTP 402 Payment Required became a real payment rail: the request/quote/sign/settle handshake, the EIP-3009 stablecoin authorization underneath it, the facilitator model, and what it means for payment engineers coming from card rails.
The agentic commerce protocol stack
x402 is one layer of a stack that formed rapidly through 2025–2026. The layers are complementary, not competing: a full agent-initiated purchase can use a discovery protocol to find the merchant, ACP to run the checkout, AP2 to prove the human authorised it, and a payment rail — cards or x402 — to move the money.
| Layer | Protocol | Steward | What it standardises |
|---|---|---|---|
| Tool access | MCP | Anthropic (open) | How an AI model connects to external tools and APIs — the plumbing an agent uses to reach a merchant endpoint at all. |
| Agent↔agent | A2A | Google → Linux Foundation | Task exchange between independent agents (shopping agent ↔ merchant agent). AP2 is defined as an extension of A2A/MCP. |
| Checkout | ACP | OpenAI + Stripe | The commerce handshake: product feed, cart, and a delegated payment token from buyer's agent to merchant. First deployed as ChatGPT Instant Checkout. |
| Trust & authorization | AP2 | Google + 60 partners → FIDO Alliance (Apr 2026) | Cryptographically signed mandates — verifiable credentials proving what the human authorised: IntentMandate (human-not-present scope), CartMandate (exact approved cart), PaymentMandate (agent-presence signals for the network/issuer). |
| Settlement rail | x402 · cards | Coinbase/Cloudflare · schemes | Moving the money. AP2's crypto extension uses x402 (this guide); its card path rides normal network authorization with the PaymentMandate attached. |
AP2 in one paragraph
AP2 answers the question the card networks care about most: what proof exists that the human wanted this purchase? The user signs a mandate with a hardware-backed device key — either a CartMandate (the exact items and total, merchant-countersigned, human present) or an IntentMandate (a natural-language scope with budget, merchant list, and TTL for purchases in their absence). At authorization time a PaymentMandate travels to the network/issuer carrying two always-shared signals: that an AI agent was involved, and whether the human was present. In a dispute, the signed mandates are the evidence. Inspect all three formats in the AP2 Mandate Decoder.
How a purchase composes the layers
- User delegates a task; the shopping agent signs an IntentMandate (AP2).
- The agent discovers the merchant endpoint (MCP tool call or A2A) and negotiates a cart — via ACP where the merchant supports it.
- Human-present: the user approves the exact cart → CartMandate. Human-not-present: the merchant fulfils against the IntentMandate or forces the user back into session.
- Payment executes on the chosen rail: a card authorization carrying the PaymentMandate, or an x402/EIP-3009 transfer for the crypto path (step through it).
Interactive: AP2 purchase, step by step
Step through both AP2 modalities. Human Present shows the CartMandate path — merchant signs the exact cart, user counter-signs on a trusted surface. Human Not Present shows the IntentMandate path — signed scope, TTL, and the merchant's right to force the user back into session. Click any step for the detail.
A user delegates shopping to an AI agent but approves the final cart themselves. The merchant signs the exact cart (CartMandate), the user counter-signs it on a trusted surface, and a PaymentMandate carries agent-presence signals to the network/issuer alongside normal authorization.
Shopping Prompt
User delegates the task to the agent in natural language.
"Buy me white running shoes, size 10, under $150." The agent may confirm its understanding back to the user — this playback becomes part of the auditable trail.
Where the incumbents stand
Visa and Mastercard both back AP2 and have their own agentic programmes (Visa Intelligent Commerce, Mastercard Agent Pay) built on tokenised, agent-specific credentials. EMVCo has stood up a Digital Identity and Payments Task Force to work agentic payments into the EMV specifications. The connective tissue across all of it is verifiable credentials — the same machinery behind the EUDI wallet, which is why AP2 landing at the FIDO Alliance matters: agent authorization and human authentication are converging on one credential model.
Related: AP2 Mandate Decoder · x402 Header Decoder · x402 Flow Simulator · EUDI Wallet & Payments · 3-D Secure Guide