
agentic-commerce-protocol
Integrate the Agentic Commerce Protocol (ACP) for AI-driven commerce between buyers, agents, and businesses
- Installs
- 154
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/reason-machines/ai-agent-skills --skill agentic-commerce-protocol- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads agentic-commerce-protocol automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Agentic Commerce Protocol (ACP) Skill
Skill by ara.so — AI Agent Skills collection.
Overview
The Agentic Commerce Protocol (ACP) is an open standard for connecting buyers, their AI agents, and businesses to complete purchases seamlessly. Maintained by OpenAI and Stripe, ACP enables AI agents to initiate and complete commerce transactions on behalf of users.
Key Capabilities:
- AI agents can discover and purchase products/services
- Businesses expose checkout endpoints to AI agents
- Payment providers handle secure payment token exchange
- Support for carts, orders, fulfillment, and extensions
- Date-based versioning (
YYYY-MM-DDformat)
Current Version: 2026-04-17
Installation & Setup
For Merchants (Implementing Checkout Endpoints)
- Clone the specification repository:
git clone https://github.com/agentic-commerce-protocol/agentic-commerce-protocol.git
cd agentic-commerce-protocol
- Review the OpenAPI specification:
# Latest stable spec
cat spec/2026-04-17/openapi/openapi.agentic_checkout.yaml
- Install dependencies for your implementation:
Node.js/Express example:
npm init -y
npm install express body-parser express-validator
Python/Flask example:
pip install flask flask-cors jsonschema
For AI Agent Developers
Review the specification and integrate with a reference implementation:
Core Concepts
1. Agentic Checkout Flow
The basic checkout flow involves these endpoints:
POST /agentic-checkout/capabilities- Discover seller capabilitiesPOST /agentic-checkout/create-checkout- Initialize checkout sessionPOST /agentic-checkout/update-checkout- Update checkout detailsPOST /agentic-checkout/confirm-checkout- Finalize and confirm purchase
2. Payment Handlers
ACP supports multiple payment handler types:
- Delegate Payment Handler - Agent handles payment collection
- Seller-Backed Payment Handler - Seller collects payment directly
- Payment Link Handler - Redirect to payment page
Implementation Examples
Basic Express.js Seller Implementation
const express = require('express');
const bodyParser = require('body-parser');
const { v4: uuidv4 } = require('uuid');
const app = express();
app.use(bodyParser.json());
// In-memory store (use database in production)
const checkoutSessions = new Map();
// Capabilities endpoint
app.post('/agentic-checkout/capabilities', (req, res) => {
res.json({
version: '2026-04-17',
supported_features: [
'cart',
'orders',
'fulfillment',
'extensions'
],
payment_handlers: [
{
type: 'delegate_payment',
supported_methods: ['card', 'bank_transfer']
}
],
extensions: [
{
type: 'discount',
supported_discount_types: ['percentage', 'fixed_amount']
}
]
});
});
// Create checkout endpoint
app.post('/agentic-checkout/create-checkout', (req, res) => {
const { items, buyer_info, payment_handler } = req.body;
// Validate required fields
if (!items || !Array.isArray(items) || items.length === 0) {
return res.status(400).json({
error: {
type: 'invalid_request',
message: 'Items are required'
}
});
}
// Create session
const sessionId = uuidv4();
const session = {
id: sessionId,
status: 'open',
items: items.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity || 1,
unit_price: item.unit_price,
total: (item.quantity || 1) * item.unit_price
})),
buyer_info: buyer_info || {},
payment_handler,
created_at: new Date().toISOString()
};
// Calculate totals
session.subtotal = session.items.reduce((sum, item) => sum + item.total, 0);
session.total = session.subtotal;
checkoutSessions.set(sessionId, session);
res.json({
checkout_id: sessionId,
status: 'open',
items: session.items,
subtotal: session.subtotal,
total: session.total,
payment_handler: session.payment_handler
});
});
// Update checkout endpoint
app.post('/agentic-checkout/update-checkout', (req, res) => {
const { checkout_id, items, buyer_info, shipping_address } = req.body;
const session = checkoutSessions.get(checkout_id);
if (!session) {
return res.status(404).json({
error: {
type: 'checkout_not_found',
message: 'Checkout session not found'
}
});
}
if (session.status !== 'open') {
return res.status(400).json({
error: {
type: 'invalid_state',
message: 'Checkout is not in open state'
}
});
}
// Update session
if (items) {
session.items = items.map(item => ({
id: item.id,
name: item.name,
quantity: item.quantity || 1,
unit_price: item.unit_price,
total: (item.quantity || 1) * item.unit_price
}));
session.subtotal = session.items.reduce((sum, item) => sum + item.total, 0);
session.total = session.subtotal;
}
if (buyer_info) {
session.buyer_info = { ...session.buyer_info, ...buyer_info };
}
if (shipping_address) {
session.shipping_address = shipping_address;
}
res.json({
checkout_id: session.id,
status: session.status,
items: session.items,
subtotal: session.subtotal,
total: session.total
});
});
// Confirm checkout endpoint
app.post('/agentic-checkout/confirm-checkout', (req, res) => {
const { checkout_id, payment_token } = req.body;
const session = checkoutSessions.get(checkout_id);
if (!session) {
return res.status(404).json({
error: {
type: 'checkout_not_found',
message: 'Checkout session not found'
}
});
}
if (session.status !== 'open') {
return res.status(400).json({
error: {
type: 'invalid_state',
message: 'Checkout is not in open state'
}
});
}
// Process payment (integrate with payment processor)
// For demo purposes, we'll simulate success
session.status = 'completed';
session.payment_token = payment_token;
session.completed_at = new Date().toISOString();
const orderId = `ord_${uuidv4()}`;
session.order_id = orderId;
res.json({
checkout_id: session.id,
status: 'completed',
order_id: orderId,
confirmation: {
order_number: orderId,
total: session.total,
items: session.items
}
});
});
app.listen(3000, () => {
console.log('ACP server listening on port 3000');
});
Python/Flask Seller Implementation
from flask import Flask, request, jsonify
from flask_cors import CORS
import uuid
from datetime import datetime
app = Flask(__name__)
CORS(app)
# In-memory store
checkout_sessions = {}
@app.route('/agentic-checkout/capabilities', methods=['POST'])
def capabilities():
return jsonify({
'version': '2026-04-17',
'supported_features': [
'cart',
'orders',
'fulfillment'
],
'payment_handlers': [
{
'type': 'delegate_payment',
'supported_methods': ['card']
}
]
})
@app.route('/agentic-checkout/create-checkout', methods=['POST'])
def create_checkout():
data = request.json
items = data.get('items', [])
if not items:
return jsonify({
'error': {
'type': 'invalid_request',
'message': 'Items are required'
}
}), 400
session_id = str(uuid.uuid4())
# Process items
processed_items = []
subtotal = 0
for item in items:
quantity = item.get('quantity', 1)
unit_price = item.get('unit_price', 0)
total = quantity * unit_price
processed_items.append({
'id': item.get('id'),
'name': item.get('name'),
'quantity': quantity,
'unit_price': unit_price,
'total': total
})
subtotal += total
session = {
'id': session_id,
'status': 'open',
'items': processed_items,
'buyer_info': data.get('buyer_info', {}),
'payment_handler': data.get('payment_handler'),
'subtotal': subtotal,
'total': subtotal,
'created_at': datetime.utcnow().isoformat()
}
checkout_sessions[session_id] = session
return jsonify({
'checkout_id': session_id,
'status': 'open',
'items': processed_items,
'subtotal': subtotal,
'total': subtotal
})
@app.route('/agentic-checkout/confirm-checkout', methods=['POST'])
def confirm_checkout():
data = request.json
checkout_id = data.get('checkout_id')
payment_token = data.get('payment_token')
session = checkout_sessions.get(checkout_id)
if not session:
return jsonify({
'error': {
'type': 'checkout_not_found',
'message': 'Checkout session not found'
}
}), 404
if session['status'] != 'open':
return jsonify({
'error': {
'type': 'invalid_state',
'message': 'Checkout is not in open state'
}
}), 400
# Process payment
session['status'] = 'completed'
session['payment_token'] = payment_token
order_id = f"ord_{uuid.uuid4()}"
session['order_id'] = order_id
return jsonify({
'checkout_id': checkout_id,
'status': 'completed',
'order_id': order_id,
'confirmation': {
'order_number': order_id,
'total': session['total'],
'items': session['items']
}
})
if __name__ == '__main__':
app.run(port=3000, debug=True)
Capability Negotiation
// Client-side capability check
async function checkSellerCapabilities(sellerUrl) {
const response = await fetch(`${sellerUrl}/agentic-checkout/capabilities`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
});
const capabilities = await response.json();
// Check if seller supports required features
const requiredFeatures = ['cart', 'orders'];
const hasRequiredFeatures = requiredFeatures.every(feature =>
capabilities.supported_features?.includes(feature)
);
return {
compatible: hasRequiredFeatures,
capabilities
};
}
Extension Support (Discounts)
// Apply discount extension
app.post('/agentic-checkout/update-checkout', (req, res) => {
const { checkout_id, extensions } = req.body;
const session = checkoutSessions.get(checkout_id);
if (!session) {
return res.status(404).json({ error: 'Session not found' });
}
// Process discount extension
const discountExt = extensions?.find(ext => ext.type === 'discount');
if (discountExt) {
const { discount_type, value, code } = discountExt;
// Validate discount code
if (code === 'SAVE10') {
if (discount_type === 'percentage') {
session.discount = session.subtotal * (value / 100);
} else if (discount_type === 'fixed_amount') {
session.discount = value;
}
session.total = session.subtotal - session.discount;
}
}
res.json({
checkout_id: session.id,
subtotal: session.subtotal,
discount: session.discount || 0,
total: session.total
});
});
Order Management
// Get order status
app.post('/agentic-checkout/get-order', (req, res) => {
const { order_id } = req.body;
// Find session by order_id
const session = Array.from(checkoutSessions.values())
.find(s => s.order_id === order_id);
if (!session) {
return res.status(404).json({
error: {
type: 'order_not_found',
message: 'Order not found'
}
});
}
res.json({
order_id: session.order_id,
status: session.status,
created_at: session.created_at,
items: session.items,
total: session.total,
fulfillment: {
status: 'pending',
tracking_number: null
}
});
});
Configuration
Environment Variables
# Server configuration
PORT=3000
NODE_ENV=production
# Payment processor
PAYMENT_PROCESSOR_API_KEY=your_payment_api_key
PAYMENT_PROCESSOR_SECRET=your_payment_secret
# Security
WEBHOOK_SECRET=your_webhook_secret
ALLOWED_ORIGINS=https://agent1.example.com,https://agent2.example.com
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/acp_db
# ACP version
ACP_VERSION=2026-04-17
Configuration File Example
// config/acp.config.js
module.exports = {
version: process.env.ACP_VERSION || '2026-04-17',
features: {
cart: true,
orders: true,
fulfillment: true,
extensions: true,
authentication: false
},
paymentHandlers: [
{
type: 'delegate_payment',
methods: ['card', 'bank_transfer'],
processor: 'stripe'
}
],
extensions: [
{
type: 'discount',
supportedTypes: ['percentage', 'fixed_amount', 'code']
}
],
security: {
requireAuth: false,
allowedOrigins: process.env.ALLOWED_ORIGINS?.split(',') || [],
webhookSecret: process.env.WEBHOOK_SECRET
}
};
Common Patterns
1. Idempotent Request Handling
const processedRequests = new Map();
app.post('/agentic-checkout/confirm-checkout', (req, res) => {
const idempotencyKey = req.headers['idempotency-key'];
if (idempotencyKey && processedRequests.has(idempotencyKey)) {
// Return cached response
return res.json(processedRequests.get(idempotencyKey));
}
// Process request
const result = processCheckout(req.body);
if (idempotencyKey) {
processedRequests.set(idempotencyKey, result);
}
res.json(result);
});
2. Webhook Event Handling
app.post('/webhooks/acp', (req, res) => {
const signature = req.headers['x-acp-signature'];
// Verify signature
if (!verifyWebhookSignature(req.body, signature)) {
return res.status(401).json({ error: 'Invalid signature' });
}
const event = req.body;
switch (event.type) {
case 'checkout.completed':
handleCheckoutCompleted(event.data);
break;
case 'checkout.cancelled':
handleCheckoutCancelled(event.data);
break;
case 'order.fulfilled':
handleOrderFulfilled(event.data);
break;
}
res.json({ received: true });
});
3. Error Handling
// Standard error response format
function sendError(res, type, message, statusCode = 400) {
res.status(statusCode).json({
error: {
type,
message,
timestamp: new Date().toISOString()
}
});
}
// Usage
app.post('/agentic-checkout/create-checkout', (req, res) => {
try {
const { items } = req.body;
if (!items || items.length === 0) {
return sendError(res, 'invalid_request', 'Items are required');
}
// Process checkout...
} catch (error) {
console.error('Checkout error:', error);
sendError(res, 'internal_error', 'An error occurred', 500);
}
});
4. Cart Management
// Add item to cart
app.post('/agentic-checkout/add-to-cart', (req, res) => {
const { checkout_id, item } = req.body;
const session = checkoutSessions.get(checkout_id);
if (!session) {
return sendError(res, 'checkout_not_found', 'Session not found', 404);
}
// Add or update item
const existingIndex = session.items.findIndex(i => i.id === item.id);
if (existingIndex >= 0) {
session.items[existingIndex].quantity += item.quantity || 1;
} else {
session.items.push({
id: item.id,
name: item.name,
quantity: item.quantity || 1,
unit_price: item.unit_price,
total: (item.quantity || 1) * item.unit_price
});
}
// Recalculate totals
session.subtotal = session.items.reduce((sum, i) => sum + i.total, 0);
session.total = session.subtotal - (session.discount || 0);
res.json({
checkout_id: session.id,
items: session.items,
subtotal: session.subtotal,
total: session.total
});
});
Testing
Test Suite Example
const request = require('supertest');
const app = require('./server');
describe('ACP Checkout Flow', () => {
let checkoutId;
test('GET capabilities', async () => {
const res = await request(app)
.post('/agentic-checkout/capabilities')
.expect(200);
expect(res.body.version).toBe('2026-04-17');
expect(res.body.supported_features).toContain('cart');
});
test('POST create-checkout', async () => {
const res = await request(app)
.post('/agentic-checkout/create-checkout')
.send({
items: [
{
id: 'prod_123',
name: 'Test Product',
quantity: 2,
unit_price: 1000
}
],
payment_handler: {
type: 'delegate_payment'
}
})
.expect(200);
checkoutId = res.body.checkout_id;
expect(res.body.status).toBe('open');
expect(res.body.total).toBe(2000);
});
test('POST confirm-checkout', async () => {
const res = await request(app)
.post('/agentic-checkout/confirm-checkout')
.send({
checkout_id: checkoutId,
payment_token: 'tok_test_12345'
})
.expect(200);
expect(res.body.status).toBe('completed');
expect(res.body.order_id).toBeDefined();
});
});
Troubleshooting
Common Issues
1. Invalid version error
Error: Unsupported ACP version
Solution: Ensure your implementation supports the version specified in the request. Check spec/2026-04-17/ for the current stable version.
2. Payment handler mismatch
Error: Unsupported payment handler type
Solution: Verify the payment handler type in your capabilities response matches what the agent is requesting.
3. Checkout session not found
Error: checkout_not_found
Solution: Implement proper session storage (Redis, database) instead of in-memory maps for production. Sessions should persist across server restarts.
4. CORS errors
Access-Control-Allow-Origin header missing
Solution: Add CORS middleware with appropriate allowed origins:
const cors = require('cors');
app.use(cors({
origin: process.env.ALLOWED_ORIGINS.split(','),
credentials: true
}));
5. Idempotency issues
Duplicate checkout created
Solution: Implement idempotency key handling for all mutating operations.
Validation
Use the JSON schemas provided in the spec for validation:
const Ajv = require('ajv');
const ajv = new Ajv();
const checkoutSchema = require('./spec/2026-04-17/json-schema/checkout.schema.json');
const validate = ajv.compile(checkoutSchema);
app.post('/agentic-checkout/create-checkout', (req, res) => {
const valid = validate(req.body);
if (!valid) {
return res.status(400).json({
error: {
type: 'validation_error',
message: validate.errors
}
});
}
// Process request...
});
Additional Resources
- Official Documentation: https://agenticcommerce.dev
- OpenAPI Spec:
spec/2026-04-17/openapi/openapi.agentic_checkout.yaml - Examples:
examples/2026-04-17/ - Governance:
docs/governance.md - Contributing:
CONTRIBUTING.md
FAQ
What does the agentic-commerce-protocol skill do?
Integrate the Agentic Commerce Protocol (ACP) for AI-driven commerce between buyers, agents, and businesses
How do I install agentic-commerce-protocol?
Run npx skills add https://github.com/reason-machines/ai-agent-skills --skill agentic-commerce-protocol in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/agentic-commerce-protocol/ (personal) or .claude/skills/agentic-commerce-protocol/ (project).
Which AI agents can use agentic-commerce-protocol?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is agentic-commerce-protocol safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains agentic-commerce-protocol?
It is published by reason-machines in reason-machines/ai-agent-skills. It has 154 recorded installs.
More from reason-machines/ai-agent-skills
agency-agents-zh-skill
reason-machines/ai-agent-skills
Open the skill to read its SKILL.md instructions.
agent-reach-internet-access
reason-machines/ai-agent-skills
Open the skill to read its SKILL.md instructions.
agent-sprite-forge-2d-game-assets
reason-machines/ai-agent-skills
Open the skill to read its SKILL.md instructions.
agentmemory-persistent-memory
reason-machines/ai-agent-skills
Add persistent memory to AI coding agents using agentmemory - remembers context, preferences, and decisions across sessions
awesome-agent-skills
reason-machines/ai-agent-skills
Open the skill to read its SKILL.md instructions.
oh-my-openagent-orchestration
reason-machines/ai-agent-skills
Open the skill to read its SKILL.md instructions.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available