DEV Community

Peter
Peter

Posted on

UCP vs ACP: The Battle of AI Commerce Protocols and How to Build for Both

The AI commerce agent landscape exploded in early 2026 when both Google's Universal Commerce Protocol (UCP) and OpenAI's Agentic Commerce Protocol (ACP) launched within weeks of each other. If you're building an AI shopping agent, you now face a critical choice: which protocol should you implement? Or should you support both?

In this deep-dive, we'll compare UCP and ACP from an implementer's perspective, examine their architectural trade-offs, and show you how to get started with Agorio - the only open-source SDK that implements both with automatic detection.

The Rise of Agentic Commerce

AI agents that can shop on your behalf are no longer science fiction. With 4.8M Shopify merchants discoverable via UCP and 1.5M Stripe merchants ready for ACP, the infrastructure for autonomous commerce is already in place. Visa and Mastercard are enabling all US cardholders for agent transactions by holiday 2026.

But to tap into this ecosystem, your agent needs to speak the right protocol. Let's look at the two contenders.

UCP: Google & Shopify's Decentralized Approach

The Universal Commerce Protocol is an open standard co-developed by Google, Shopify, Etsy, Wayfair, Target, Walmart and endorsed by Stripe, PayPal, Visa, Mastercard.

Key Architecture

  • Discovery: Merchants publish a JSON manifest at /.well-known/ucp that tells agents what they support - capabilities, endpoints, payment handlers.
  • Capabilities: Modular capabilities like dev.ucp.shopping.checkout (cart, tax, session handling), dev.ucp.shopping.order (post-purchase), and extensions for fulfillment, discounts, buyer consent.
  • Payment Architecture: The "trust triangle" separates business, payment credential provider, and platform. Multiple handler types: Google Pay, Shop Pay, Direct Tokenization, AP2 (autonomous agent mandates).
  • Transport Bindings: REST (OpenAPI), MCP (OpenRPC for LLM tools), and Agent Card (A2A).
// Example .well-known/ucp manifest
{
  "ucpVersion": "2026-01-11",
  "capabilities": [
    {
      "name": "dev.ucp.shopping.checkout",
      "version": "2026-01-11",
      "restEndpoint": "https://api.example.com/ucp/checkout",
      "paymentHandlers": ["google_pay"]
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

When to Choose UCP

  • You need decentralized discovery (any merchant can self-host)
  • Your agents need rich shopping workflows (cart, catalog, order tracking)
  • You're building for Google's AI Mode or Gemini
  • You need multiple payment handler types

ACP: OpenAI & Stripe's Delegated Payment Model

The Agentic Commerce Protocol is an open standard (Apache 2.0) by OpenAI and Stripe, primarily powering ChatGPT Instant Checkout.

Key Architecture

  • Discovery: Centralized - merchants apply at chatgpt.com/merchants and provide product feeds
  • Payment Model: Delegated payment - any PSP can implement the spec (Stripe first, PayPal second)
  • Endpoints: 5 REST endpoints for the full checkout lifecycle: create, get, update, complete, cancel
  • States: not_ready_for_paymentready_for_paymentcompleted (with optional authentication steps)
// Example ACP checkout session flow
POST /checkout_sessions
{
  "line_items": [
    {
      "product_id": "prod_123",
      "amount": 2999, // $29.99 in cents
      "quantity": 1
    }
  ],
  "return_url": "https://example.com/return",
  "success_url": "https://example.com/success"
}
Enter fullscreen mode Exit fullscreen mode

When to Choose ACP

  • You're building for ChatGPT or other OpenAI-agent ecosystems
  • You prefer a centralized, vetted merchant pool
  • Your transactions are single-item purchases (current limitation)
  • You want delegated payment through any PSP

Head-to-Head Comparison

Feature UCP ACP
Developers Google, Shopify, 25+ partners OpenAI, Stripe
Discovery Decentralized (/.well-known/ucp) Centralized (merchant application)
Payment Multiple handlers (Google Pay, Shop Pay, etc.) Delegated via any PSP
Extensibility Namespace-based extensions RFC-based extensions
Transport REST, MCP, A2A REST only
Merchant Footprint 4.8M Shopify merchants + any self-hosted 1.5M Stripe merchants + 35M PayPal (coming)
License Open spec Apache 2.0
Current Limitations Complex capability negotiation US-only, single-item only

Why Choose? Build Both with Agorio

The reality is that most serious commerce agents will need to support both protocols to reach the maximum number of merchants. That's where Agorio comes in.

Agorio is an open-source TypeScript SDK that implements both UCP and ACP with automatic protocol detection. Here's how you can use it:

Example: UCP Client

import { UcpClient } from '@agorio/sdk';

// Discover merchant capabilities
const ucp = new UcpClient('https://api.example.com');
const profile = await ucp.discover();

// Check if they support checkout
if (profile.supportsCheckout()) {
  const session = await ucp.createCheckoutSession({
    cartId: 'cart_123',
    paymentHandler: 'google_pay'
  });
}
Enter fullscreen mode Exit fullscreen mode

Example: ACP Client

import { AcpClient } from '@agorio/sdk';

const acp = new AcpClient({
  apiKey: 'your_stripe_key',
  merchantId: 'merch_123'
});

const session = await acp.createCheckoutSession({
  lineItems: [{ productId: 'prod_123', amount: 2999, quantity: 1 }]
});
Enter fullscreen mode Exit fullscreen mode

The ShoppingAgent: Auto-Detection Magic

Agorio's ShoppingAgent automatically detects which protocol a merchant supports and uses the appropriate client:

import { ShoppingAgent, GeminiAdapter } from '@agorio/sdk';

const agent = new ShoppingAgent({
  llm: new GeminiAdapter({ apiKey: process.env.GEMINI_API_KEY }),
  verbose: true,
});

// Agent automatically handles protocol detection
const result = await agent.run(
  'Go to store.example.com and buy me wireless headphones'
);

// Works with both UCP and ACP merchants
console.log(`Order placed: ${result.checkout?.orderId}`);
Enter fullscreen mode Exit fullscreen mode

Implementation Complexity Analysis

Implementing UCP from scratch requires:

  • JSON-LD manifest parsing
  • Capability intersection algorithm
  • Payment handler abstraction
  • Multiple transport bindings

Implementing ACP from scratch requires:

  • Bearer auth with API versioning
  • Payment token delegation
  • Product feed management
  • Strict state machine adherence

Agorio handles all of this for you, providing:

  • UcpClient with discovery + REST/MCP auto-transport
  • AcpClient with full session lifecycle management
  • ShoppingAgent with 12 built-in tools for commerce workflows
  • MockMerchant for testing (UCP, ACP, and MCP variants)
  • LLM adapters for Gemini, Claude, OpenAI, Ollama

Practical Recommendations

  1. Start with ACP if you're building for ChatGPT or want the simplest integration with Stripe/PayPal.
  2. Start with UCP if you need decentralized discovery, multi-item carts, or Google AI Mode integration.
  3. Use Agorio if you want to support both protocols from day one (recommended).

Remember: merchants should support both protocols for maximum AI agent coverage, and so should your agent.

Try It Yourself

The fastest way to experiment is Agorio's interactive playground:

Agorio Playground

Or install the SDK:

npm install @agorio/sdk
Enter fullscreen mode Exit fullscreen mode

Check out the GitHub repository (MIT licensed) and star it if you find it useful.

The Future of Agentic Commerce

Both UCP and ACP are evolving rapidly. UCP's AP2 mandates will enable cryptographic payment authorization for autonomous agents, while ACP is expanding to multi-item purchases and international markets.

The key takeaway: protocol literacy is your moat. Understanding these standards will make you a more effective agent builder, whether you're working on a personal shopping assistant or an enterprise procurement agent.

Have you started building with UCP or ACP? Share your experiences in the comments below!

Top comments (0)