Agentic Payments Protocol Demo - Interactive comparison of ACP, AP2, x402, and MCP payment protocols for AI agents
agentic-payments-demo is an early-stage JavaScript project in the AI payments / x402 ecosystem, focused on agentic-payments, ai-agents, demo, mcp. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like inflow-cli, mcp-pay, x402-sdk, routeweiler-python-sdk, tdm-integration-kit, TDM-Agent-Integration-Kit.
An interactive demonstration of four leading agentic payment protocols that enable AI agents to conduct commerce autonomously or with user authorization.
cd agentic-payments-demo
npm install
npm start
Then open http://localhost:3000 in your browser.
This demo illustrates the fundamental problem of agentic payments: How can AI agents make purchases on behalf of users securely, transparently, and at scale?
Each protocol takes a radically different approach to solving this problem:
| Protocol | Core Philosophy |
|---|---|
| ACP | "Keep humans in the loop with seamless UX" |
| AP2 | "Trust through cryptographic proof" |
| x402 | "Make payments as simple as HTTP requests" |
| MCP | "Standardize tools so any AI can pay" |
What it demonstrates: The ACP demo shows how a user can complete a purchase without ever leaving their chat interface. When you click "Create Checkout Session," you're simulating what happens when a user says "Buy me a wireless mouse" to ChatGPT.
What to observe:
presentationData field - this is structured data the AI uses to display the checkout to usersagentContext tells the AI what actions are allowedReal-world example:
User: "Order me the cheapest AirPods from Amazon" ChatGPT: Shows inline checkout card with price, image, delivery estimate User: Clicks "Confirm" button in chat Payment processed via Stripe without leaving the conversation
What it demonstrates: The AP2 demo shows how a user can give an AI agent permission to spend money autonomously within defined constraints. This is the most sophisticated protocol for truly autonomous agents.
What to observe:
auditTrail in payment responses provides full accountabilityThe key insight: AP2 solves the "who authorized this?" problem. If an AI agent buys something wrong, the audit trail proves:
Real-world example:
User: "You can spend up to $50/day on office supplies without asking me" [Agent creates Intent Mandate with constraints] Later, agent notices printer ink is low, finds ink for $35 Agent purchases autonomously using the mandate User receives notification with full audit trail
What it demonstrates: The x402 demo shows a fundamentally different model: machine-to-machine payments without any prior relationship. No API keys, no subscriptions, no accounts—just pay and access.
What to observe:
402 Payment Required with payment detailspaymentRequirements array lists accepted payment methods (USDC on Base network)The key insight: x402 enables a new economic model where:
Real-world example:
AI Agent needs premium weather data for user's travel planning Agent has a USDC wallet with $10 balance Agent requests weather API → gets 402 Agent signs 0.001 USDC payment → gets weather data No API key needed, no rate limits, just pay-per-use
What it demonstrates: The MCP demo shows how payments can be exposed as standardized tools that any AI can discover and use. This is the most "AI-native" approach—payments become just another tool in the AI's toolkit.
What to observe:
listTools() returns a schema-defined list of payment capabilitiesinputSchema describing required parameterscontext with next suggested actionsThe key insight: MCP treats payments like any other AI capability. Just as an AI can use a "search the web" tool or "read a file" tool, it can use "create_payment_intent" or "refund_payment" tools. This standardization means:
Real-world example:
User: "Refund the customer's order from yesterday" AI calls
get_payment_statusto find the payment AI callsrefund_paymentwith the payment ID AI reports: "Refund of $49.99 processed, confirmation #RF123"
┌─────────────────────────────────────────────────────────────────────────┐
│ AGENTIC PAYMENTS SPECTRUM │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ Human-in-Loop ◄─────────────────────────────────────────► Autonomous │
│ │
│ ACP MCP AP2 x402 │
│ │ │ │ │ │
│ User confirms User may or User sets No user │
│ every purchase may not be constraints, involved │
│ involved agent acts │
│ │
└─────────────────────────────────────────────────────────────────────────┘
┌────────────────┬────────────────┬────────────────┬────────────────┐
│ ACP │ AP2 │ x402 │ MCP │
├────────────────┼────────────────┼────────────────┼────────────────┤
│ │ │ │ │
│ ┌───────┐ │ ┌───────┐ │ ┌───────┐ │ ┌───────┐ │
│ │Stripe │ │ │ Any │ │ │Crypto │ │ │Adyen/ │ │
│ │ API │ │ │Network│ │ │Wallet │ │ │Worldpay │
│ └───┬───┘ │ └───┬───┘ │ └───┬───┘ │ └───┬───┘ │
│ │ │ │ │ │ │ │ │
│ Traditional │ Agnostic │ Blockchain │ Traditional │
│ Card Rails │ (card/crypto)│ (USDC) │ Card Rails │
│ │ │ │ │
└────────────────┴────────────────┴────────────────┴────────────────┘
| Aspect | ACP | AP2 | x402 | MCP |
|---|---|---|---|---|
| Who authorizes? | User (per-transaction) | User (via mandates) | Agent wallet holder | Depends on implementation |
| Proof of authorization | Session confirmation | Cryptographic VDC signature | Blockchain transaction | Application logs |
| Dispute resolution | Stripe/card network | Audit trail + VDCs | On-chain history | Provider-specific |
| Fraud liability | Merchant/Stripe | Defined by mandate | Wallet holder | Provider-specific |
| Aspect | ACP | AP2 | x402 | MCP |
|---|---|---|---|---|
| Integration effort | Low (Stripe SDK) | Medium (VDC handling) | Low (HTTP headers) | Medium (MCP server) |
| Prerequisites | Stripe account | VDC infrastructure | Crypto wallet | MCP-compatible AI |
| Latency | ~2-3 seconds | ~1-2 seconds | ~400ms (Solana) | ~2-3 seconds |
| Transaction cost | 2.9% + $0.30 | Network fees | ~$0.0003 (Base) | Provider fees |
| Minimum practical amount | ~$1 | ~$1 | $0.0001 | ~$1 |
ACP's philosophy is that checkout should feel native to wherever the user is. Instead of redirecting users to a checkout page, ACP brings the checkout into the chat.
Key design decisions:
presentationData provides structured display info so any AI can render checkout consistentlyagentContext tells the AI what UX patterns are allowed// ACP returns data optimized for AI presentation
{
presentationData: {
title: "Purchase from Demo Store",
summary: "1 item(s) • USD 29.99",
callToAction: "Confirm Purchase"
}
}
AP2's philosophy is that autonomous agents need cryptographic accountability. The protocol answers three critical questions:
Key design decisions:
// AP2 creates cryptographic proof chain
{
credentials: {
userMandate: "vdc:abc123...", // User's authorization
paymentMandate: "vdc:def456...", // AI involvement disclosure
signatures: ["sig_...", "sig_..."] // Cryptographic proof
}
}
x402's philosophy is that payments should be as simple as HTTP. The 402 status code has existed since HTTP/1.0 but was never standardized. x402 finally defines how it should work.
Key design decisions:
// x402 is just HTTP with payment headers
// Request without payment:
GET /api/premium/weather → 402 Payment Required
// Request with payment:
GET /api/premium/weather
Header: PAYMENT-SIGNATURE: <base64_signed_payment>
→ 200 OK + data
MCP's philosophy is that AI capabilities should be discoverable and standardized. Payments become tools that any AI can find, understand, and use through a common interface.
Key design decisions:
// MCP tools are self-describing
{
name: "create_payment_intent",
description: "Create a new payment intent",
inputSchema: {
type: "object",
properties: {
amount: { type: "number" },
currency: { type: "string" }
},
required: ["amount", "currency"]
}
}
These protocols are not mutually exclusive. We're already seeing convergence:
The likely future is a layered stack:
┌────────────────────────────────────────┐
│ Application Layer (Chat UX, etc.) │ ← ACP-style presentation
├────────────────────────────────────────┤
│ Authorization Layer (Mandates) │ ← AP2-style credentials
├────────────────────────────────────────┤
│ Tool Layer (Standardized APIs) │ ← MCP-style tools
├────────────────────────────────────────┤
│ Settlement Layer (Payment Rails) │ ← x402/traditional
└────────────────────────────────────────┘
What it is: A protocol enabling seamless checkout within AI chat interfaces like ChatGPT.
Key Features:
Flow:
User → "Buy me a wireless mouse"
↓
AI Agent → Creates ACP checkout session
↓
Chat UI → Shows inline checkout with item details
↓
User → Confirms purchase in chat
↓
Stripe → Processes payment
↓
AI Agent → Returns confirmation + receipt
API Endpoints:
POST /api/acp/checkout - Create checkout sessionPOST /api/acp/confirm/:sessionId - Confirm paymentWhat it is: An open protocol using Verifiable Digital Credentials (VDCs) to establish trust in AI agent transactions. Released under Apache 2.0 with 60+ industry partners.
Key Concepts:
| Mandate Type | Use Case | User Presence |
|---|---|---|
| Intent Mandate | Pre-authorized autonomous purchases | Human NOT present |
| Cart Mandate | Explicit approval for specific cart | Human present |
| Payment Mandate | Signals AI involvement to networks | Sent to payment network |
Flow (Autonomous with Intent Mandate):
User → Creates Intent Mandate
"Allow agent to spend up to $50 on electronics"
↓
AI Agent → Finds headphones for $35
↓
AI Agent → Validates against mandate constraints
↓
AP2 → Creates Payment Mandate (for audit trail)
↓
Payment Network → Processes with AI disclosure
↓
Full audit trail with cryptographic signatures
API Endpoints:
POST /api/ap2/mandate/intent - Create autonomous spending mandatePOST /api/ap2/mandate/cart - Create explicit cart authorizationPOST /api/ap2/pay - Initiate payment with mandateWhat it is: A protocol leveraging the HTTP 402 "Payment Required" status code for machine-to-machine payments. No API keys or subscriptions needed—just pay per request.
Key Features:
Flow:
AI Agent → GET /api/premium/weather
↓
Server → 402 Payment Required
{
"amount": 0.001,
"asset": "USDC",
"network": "base",
"recipient": "0x..."
}
↓
Agent Wallet → Signs USDC payment
↓
AI Agent → GET /api/premium/weather
Header: PAYMENT-SIGNATURE: <signed_payment>
↓
Server → Verifies payment on-chain
↓
Server → 200 OK + Weather Data
API Endpoints:
GET /api/x402/resources - List paid resourcesGET /api/x402/resource/* - Access resource (returns 402 if unpaid)POST /api/x402/create-payment - Create payment signaturePOST /api/x402/access - Access with paymentWhat it is: Payment integrations built on Anthropic's Model Context Protocol, with implementations from Adyen, Worldpay, J.P. Morgan, and others.
Key Features:
Available Tools:
| Tool | Description |
|---|---|
create_payment_intent |
Create a new payment intent |
confirm_payment |
Confirm and process payment |
get_payment_status |
Check payment status |
list_payment_methods |
List customer's saved methods |
create_checkout_session |
Create hosted checkout |
refund_payment |
Process refund |
Flow:
AI Agent → execute("create_payment_intent", {
amount: 49.99,
currency: "USD"
})
↓
MCP Server → Returns paymentIntentId + context
↓
AI Agent → execute("list_payment_methods", {
customerId: "cust_123"
})
↓
AI Agent → execute("confirm_payment", {
paymentIntentId: "pi_...",
paymentMethodId: "pm_visa_4242"
})
↓
MCP Server → Returns receipt + next actions
API Endpoints:
GET /api/mcp/tools - List available toolsPOST /api/mcp/execute - Execute a toolPOST /api/mcp/process-payment - High-level payment flow| Feature | ACP | AP2 | x402 | MCP |
|---|---|---|---|---|
| Developer | Stripe/OpenAI | Coinbase | Anthropic + Partners | |
| Primary Use | In-chat checkout | Autonomous agents | Pay-per-API | Tool-based payments |
| Payment Type | Traditional cards | Any (agnostic) | Stablecoins (USDC) | Traditional cards |
| User Presence | Required | Optional | Not required | Flexible |
| Audit Trail | Standard | Cryptographic VDCs | Blockchain | Logging |
| Micropayments | No | Limited | Yes ($0.0001+) | No |
| Autonomy Level | Low | High | Highest | Medium |
| Integration Complexity | Low | Medium-High | Low | Medium |
| License | Proprietary | Apache 2.0 | Open standard | Open protocol |
agentic-payments-demo/
├── src/
│ ├── server.js # Express server with all endpoints
│ └── protocols/
│ ├── acp.js # Agentic Commerce Protocol
│ ├── ap2.js # Agent Payment Protocol
│ ├── x402.js # HTTP 402 Protocol
│ └── mcp-payments.js # MCP Payments
├── public/
│ └── index.html # Interactive demo UI
├── package.json
└── README.md
A wallet for your agents to onboard and pay. Agentic MPP / x402 payments from your machine - CLI + MCP server.
Payment awareness layer for MCP (Model Context Protocol)
x402 SDK for AI agent payments - Base & Solana USDC micropayments
The financial operating system for AI agents. A single HTTP client that intercepts '402 Payment Required', routes across x402, L402, and MPP, persists credentials as recoverable assets, enforces per-envelope budgets, and emits a structured trace.
Developer integration tools for adding TDM payments to AI agents, apps, and workflows. CLI, MCP server, and copy-paste examples
Developer integration tools for adding TDM payments to AI agents, apps, and workflows. CLI, MCP server, and copy-paste examples
The self-improving LLM router that optimize your agentic workflows with every runs, works with any harnesses, any models, any loops.
A curated list of awesome agentic commerce resources — protocols, MCP servers, tools, apps, APIs and services for AI agents that shop, sell and transact. For store owners, developers, agencies and marketers.
Agentic commerce is the shift from people clicking buy buttons to AI agents acting, deciding, negotiating, and transacting on behalf of users. This repository documents that shift.
Skills & plugins for agentic commerce : UCP, ACP, AP2, A2A, WebMCP, Magento 2, BigCommerce, WooCommerce
The open-source toolkit for building AI commerce agents using UCP and ACP protocols
A neutral landscape analysis of AI agent payment protocols (x402, MPP, L402, Google AP2, Visa TAP + ICC, Mastercard Agent Pay, Amex ACE, Google/Shopify UCP, OpenAI ACP, and others). Maintained by Genesis Software Group, Copenhagen. Updated April 2026. CC BY 4.0.