DEV Community

Sreeharsha
Sreeharsha

Posted on

Agentic Commerce: Dive into ACP & UCP Protocols

TLDR

Agentic commerce enables AI agents to autonomously handle end-to-end shopping workflows—from discovery to checkout—through standardized protocols like ACP (OpenAI/Stripe) and UCP (Shopify/Google).

This article explores their architectures, a practical Shopify MCP implementation, engineering challenges, and future directions for developers building scalable agentic systems.

Intro

E-commerce revolutionized retail by digitizing physical stores into accessible, scalable online platforms, enabling globalized reach and streamlined checkout flows. Agentic commerce amplifies these capabilities exponentially, empowering AI agents to autonomize end-to-end purchases, negotiate dynamic discounts, provide proactive post-purchase support, and orchestrate complex workflows—all while maintaining merchants as the Merchant of Record (MoR).

This represents a paradigm shift from human-led browsing to AI-orchestrated commerce, powered by interoperable protocols and robust system design. For engineers, it demands new skills in protocol interoperability, stateful agent reasoning, and headless commerce integration.

Overview: Enabling Agentic Commerce

To operationalize agentic commerce, open-source protocols provide the foundational building blocks:

  1. ACP (Agentic Commerce Protocol) focuses on checkout and payment processing. It provides a REST-based Checkout API for cart management and a Delegate Payment API for secure payment tokenization through PSPs like Stripe. The minimal implementation surface enables rapid merchant adoption. OpenAI supports merchant integration via standardized product feed specs that expose inventory to ChatGPT.

  2. UCP (Universal Commerce Protocol) addresses the full commerce lifecycle including product discovery, identity linking, checkout, and order management. It defines participant roles, capability boundaries, and interaction patterns for complex commerce workflows. Shopify implements UCP through MCP servers for catalog and checkout, with ongoing development for post-purchase capabilities.

Both protocols support human-driven API workflows alongside agentic flows, ensuring backward compatibility while future-proofing for autonomous commerce.

Protocols and Standards

ACP

  • There are 4 parties involved in ACP:
    • Buyer: human who wants to purchase something.
    • Agent: AI platform that orchestrates checkout experience.
    • Seller: the merchant who sells products. Sellers implement the Checkout API and remain the merchant of record (MoR).
    • Payment Provider: handles payment tokenization and processing. Eg: stripe.

ACP Architecture

Core APIs:

  • Checkout API to enable AI agents to create, update, and complete checkout sessions on behalf of buyers. It is designed for ChatGPT-driven checkout processes.

  • Delegate Payment API to enable merchants to tokenize payment credentials with controlled usage constraints through an allowance framework.

UCP

  • There are 4 parties involved in UCP as well:

    • Platform/Agent: the buyer facing interface that represents a user. Eg: smart assistants, conversational surfaces, embedded e-commerce tools.
    • Business: the entity selling products, goods, services.
    • Credential Provider: the entity responsible for securely managing & sharing sensitive user profile data like email, addresses etc. Eg: google, entra ID.
    • Payment Provider: the entity responsible for processing payments on behalf of businesses. Eg: stripe, paypal, gpay.
  • UCP revolves around 3 fundamental constructs that define how the above 4 entities interact:

    • Capabilities:
      • Product Discovery: discovering products through user interfaces.
      • Cart: multi-item checkout, complex basket rules. Eg: BOGO, bundles
      • Identity Linking: obtain authorization to perform actions on behalf of a user.
      • Checkout: facilitating checkout sessions.
      • Order: view confirmed transactions, checkout records, delivery.
      • Other vertical capabilities: loyalty programs & member benefits.
    • Extensions: optional capabilities that augment existing ones. Eg: discount codes, gifts
    • Services: lower-level communication layers used to exchange data. Eg: REST, MCP A2A

UCP Architecture

Active development: Product discovery with semantic search, cart operations with inventory validation, vertical-specific extension framework. See roadmap.

Implementation

UI ACP Demo

Terminal ACP Chat

Technical Stack

Shopify's UCP-compliant MCP servers provide agentic commerce capabilities:

OpenAI's Responses API includes native MCP support with authentication, enabling straightforward integration.

Demo Implementation: Terminal-Based Agentic Workflow

Built a terminal interface demonstrating end-to-end agentic commerce:

  1. User query: "find wireless headphones under $200"
  2. Agent queries Catalog MCP, returns results
  3. User requests product details
  4. User expresses purchase intent
  5. Agent initiates checkout (merchant store or embedded interface)

Repository: Github - Agentic Commerce Terminal Chat

Engineering Requirements

  1. System Prompt Design: LLM persona must balance autonomous progress with user confirmation requirements. Prompt defines tool invocation logic, state management across turns, and checkout progression. Poor calibration results in either unauthorized purchases or stalled workflows.

  2. Incomplete Checkout Recovery: Implement explicit fallback paths for payment failures, invalid addresses, and inventory depletion. Silent failures or hallucinated completions break user trust.

  3. Product Identification from Context: Extract product IDs from conversational references ("the second one", "the Sony model"). Requires mapping natural language to catalog entries before cart operations.

  4. Authorization Flow: Identity linking must clearly communicate data access scope and maintain secure token management across conversation sessions.

Implementation Challenges

Context State Management: The primary engineering challenge is maintaining accurate product context across multi-turn conversations. LLMs without structured state tracking produce errors when users reference products ambiguously, modify quantities, or switch between categories.

Observed failure modes:

  • Agent adds wrong product to cart when user says "the second one" after viewing multiple result sets
  • Quantity mismatches when user revises order mid-conversation
  • Product ID loss during context window shifts in long sessions

Required state architecture:

- Active catalog context (current search results)
- User preference constraints (price limits, categories, attributes)
- Cart state (selected products, quantities, variants)
- Checkout session (shipping, payment, order status)
- Auth tokens and profile access scope
Enter fullscreen mode Exit fullscreen mode

Naive implementations relying solely on LLM conversation memory fail in production. Explicit state management with validation checkpoints is essential.

API State Synchronization: Race conditions occur when users modify intent faster than API calls complete. Example: user changes quantity while cart update is in-flight. Requires optimistic UI updates with conflict resolution or pessimistic locking with clear loading states.

Error Translation: Commerce APIs return technical errors (inventory insufficient, payment declined, address validation failed). Engineers must translate these into natural language that helps users resolve issues without exposing implementation details or confusing non-technical users. Simple string mapping is insufficient—contextual explanation improves recovery rates.

Conclusion

Agentic commerce protocols are open-source, implementation patterns are emerging, and the technical foundation is accessible. The architecture is still being defined through production deployments.

Top comments (0)