Reference implementation of the Agentic Commerce Protocol (ACP) — the open standard co-developed by Stripe and OpenAI enabling AI agents to complete purchases on behalf of users.
Live demo: acp-merchant-demo.vercel.app/demo
- Full ACP Protocol — CreateCheckout, UpdateCheckout, CompleteCheckout endpoints per spec
- Real Stripe Integration — PaymentIntents created on every completed checkout
- Interactive Demo — Visual representation of Agent ↔ Merchant protocol flow
- Webhook Support — Handles
payment_intent.succeeded,payment_intent.payment_failed - Production Ready — Zod validation, error handling, structured logging
Checkout Flow — Real-time ACP protocol visualization with live API responses.
ACP represents a fundamental shift in e-commerce: instead of users navigating checkout pages, AI agents handle the entire purchase flow programmatically. This demo implements the merchant side of that protocol.
| What ACP Solves | How |
|---|---|
| N×M integration problem | Universal protocol — each agent/merchant implements once |
| Trust & payment security | SharedPaymentToken with scoped permissions |
| UI control | Agent renders UI, merchant controls pricing/fulfillment |
- Visit acp-merchant-demo.vercel.app/demo
- Click any product → Checkout card appears, JSON updates (real
POST /api/acp/checkout) - Change shipping → Totals recalculate (real
POST /api/acp/checkout/update) - Click "Pay" → Purchase completes (real
POST /api/acp/checkout/complete) - Expand "ACP REQUESTS" → View full request/response history
- Check Stripe Dashboard → PaymentIntent created
flowchart LR
subgraph Agent["AI Agent (ChatGPT/Claude)"]
UI["Chat Interface"]
end
subgraph Merchant["ACP Merchant Demo (This Project)"]
direction TB
API["API Routes<br/>/api/acp/*"]
CS["Checkout Service"]
PS["Payment Service"]
STORE["In-Memory Store"]
end
subgraph External["External Services"]
STRIPE["Stripe API"]
end
UI -->|"POST /checkout"| API
UI -->|"POST /checkout/update"| API
UI -->|"POST /checkout/complete"| API
API --> CS
CS --> STORE
CS --> PS
PS --> STRIPE
STRIPE -->|"PaymentIntent"| PS
PS -->|"Order confirmed"| API
API -->|"JSON response"| UI
Tech Stack:
- Next.js 14 (App Router, TypeScript)
- Stripe SDK
- Zod validation
- Tailwind CSS
- Vercel (deployment)
| Endpoint | Method | Description |
|---|---|---|
/api/acp/checkout |
POST | Create checkout session |
/api/acp/checkout/update |
POST | Update shipping, address, email |
/api/acp/checkout/complete |
POST | Complete with payment token |
/api/acp/webhooks |
POST | Handle Stripe webhook events |
/api/health |
GET | Health check with store stats |
/.well-known/acp.json |
GET | ACP discovery endpoint |
sequenceDiagram
participant User
participant Agent as AI Agent
participant Merchant as ACP Merchant
participant Stripe
User->>Agent: "Buy running shoes"
Agent->>Merchant: POST /checkout {items}
Merchant-->>Agent: {checkout_id, shipping_options, total}
Agent->>User: "Shipping: Standard or Express?"
User->>Agent: "Standard"
Agent->>Merchant: POST /checkout/update {shipping_option}
Merchant-->>Agent: {updated_total, ready_for_payment}
Agent->>User: "Total: $135.98. Confirm?"
User->>Agent: "Yes"
Agent->>Stripe: Request SharedPaymentToken
Stripe-->>Agent: {payment_token}
Agent->>Merchant: POST /checkout/complete {payment_token}
Merchant->>Stripe: Create PaymentIntent
Stripe-->>Merchant: {payment_intent_id}
Merchant-->>Agent: {order_id, status: completed}
Agent->>User: "Order confirmed! 🎉"
# Clone
git clone https://github.com/nickcarndt/acp-merchant-demo.git
cd acp-merchant-demo
# Install
npm install
# Configure
cp .env.example .env.local
# Edit .env.local with your Stripe keys
# Run
npm run devOpen http://localhost:3000/demo
| Variable | Description | Required |
|---|---|---|
STRIPE_SECRET_KEY |
Stripe API secret key (test mode) | Yes |
STRIPE_WEBHOOK_SECRET |
Webhook signing secret | For webhooks |
ACP_AUTH_TOKEN |
Bearer token for ACP endpoints | Yes |
NEXT_PUBLIC_ACP_AUTH_TOKEN |
Client-side auth token | For demo UI |
# Deploy
vercel
# Set environment variables in Vercel dashboard
# Redeploy
vercel --prodWebhook Setup:
- Stripe Dashboard → Developers → Webhooks
- Add endpoint:
https://your-app.vercel.app/api/acp/webhooks - Select events:
payment_intent.succeeded,payment_intent.payment_failed - Copy signing secret to Vercel env vars
# Smoke test (local)
./test-acp.sh
# Smoke test (production)
./test-acp-prod.sh| Project | Description |
|---|---|
| MCP Server | AI agent tools for Stripe/Shopify (agent side) |
| Chatbot with Memory | Full-stack AI chatbot with MCP integration |
Nicholas Arndt — GitHub · LinkedIn
MIT © 2025 Nicholas Arndt



