Leanpub Header

Skip to main content

Universal Commerce Protocol: A Technical Reference

Design, Implementation and Production Deployment of the Protocol for Agentic Commerce

Universal Commerce Protocol: A Technical Reference
This book is 100% completeLast updated on 2026-11-22

Something is learning to shop. Not a person tapping a screen, an AI agent that reads intent, compares offerings across thousands of merchants and completes a purchase in seconds, with no browser and no forms. What it needs is a common language and that language is the Universal Commerce Protocol. In this book, you'll go inside UCP from first principles to production: how agents discover merchants at a well-known endpoint, how capabilities are negotiated in milliseconds, how money moves through cryptographic tokens without anyone touching a card number and how a working merchant server and buyer agent actually talk to each other, request by signed request. The protocol is real. The implementations are real. The question, answered in these pages, is whether commerce's next infrastructure layer will be open. For engineers, the answer starts here.

Minimum price

$25.00

$35.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
214
Pages
About

About

About the Book

Universal Commerce Protocol: A Technical Reference is a comprehensive engineering guide to UCP, an open and versioned protocol that enables autonomous AI agents to discover merchants, negotiate capabilities and complete transactions without requiring custom integrations. Organized into four parts, the book explores the evolution of machine commerce, from Electronic Data Interchange (EDI) and the REST API era to the emerging age of agent-driven transactions. It then provides an in-depth examination of the UCP specification, covering merchant discovery through /.well-known/ucp, server-selected capability negotiation, the JSON Schema 2020-12 data model, catalog and checkout operations, explicit state machines, order lifecycles, webhooks and a comprehensive security architecture based on RFC 9421 message signatures, OAuth 2.0 and payment tokenization. Moving from theory to practice, Part III presents a complete, runnable reference implementation featuring a Python/FastAPI merchant server and a signed-request buyer agent that demonstrates the entire process, from initial discovery to successful order completion. It also addresses essential production engineering practices, including observability, resilience, caching and deployment. The final part positions UCP within the broader technology landscape by examining its relationship with complementary standards such as MCP, A2A, AP2, GS1 and FAPI, while identifying common implementation challenges and exploring the protocol's future development. Based on the specification release dated August 25, 2026 and informed by the founding coalition of Google, Shopify, Stripe and major retailers, this reference is designed for software engineers and technical professionals building the next generation of agent-mediated commerce. Assuming a working knowledge of HTTP, JSON and basic cryptography, the book provides the technical foundation needed to understand, implement and deploy UCP, whether building AI platforms, merchant systems or the payment infrastructure that connects them.

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience spanning software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. His work focuses on understanding complex systems, uncovering security weaknesses and developing practical solutions that make technology more secure, reliable and effective.

Through Steve Publications, he collaborates with experienced researchers, engineers and industry experts to create practical, technically rigorous books on various topics not limited to self-improvement, software development, cybersecurity, cloud computing, DevOps, artificial intelligence and enterprise technologies. His mission is to make complex technical subjects accessible through clear explanations, real-world examples and hands-on exercises that help IT professionals, students and technology enthusiasts build valuable, practical skills.

Steve Publications embraces AI as a supporting tool for translation, proofreading and editorial refinement, not as a substitute for original research, technical expertise, or hands-on experience. Some contributors choose to publish under pseudonyms to protect their privacy or maintain professional boundaries.

Behind every book is a commitment to technical accuracy, practical relevance and continuous improvement. Our publications are written, reviewed and maintained by experienced professionals, with support from a private community of more than 420 engineers and researchers. Rather than prioritizing volume or mass-produced AI-generated content, we focus on delivering reliable, useful resources that readers can apply in real-world environments.

We also welcome experienced professionals who want to share their knowledge by writing or reviewing books, particularly in specialized and emerging technology fields. If you have expertise to contribute, we invite you to get in touch and explore opportunities to collaborate.

Our commitment is simple: To deliver books that respect our readers' time, support their professional growth and provide lasting practical value. If a book does not meet your expectations, Leanpub offers a 60-day money-back guarantee.

Contents

Table of Contents

Design, Implementation and Production Deployment of the Protocol for Agentic Commerce

Part I - Foundations

Chapter 1: Why Agentic Commerce Needs a Protocol

  1. The Rise of AI-Driven Buying
  2. The Fragmentation Problem
  3. What a Commerce Protocol Must Do
  4. Scope and Organization

Chapter 2: From EDI to Agents - The Historical Arc of Machine Commerce

  1. EDI: The First Machine Commerce Protocol
  2. XML, SOAP and the REST API Era
  3. Buy Buttons, One-Click and Platform APIs
  4. The Agent Moment

Chapter 3: Design Goals, Principles and Specification Shape

  1. Stated Design Goals
  2. Guiding Architectural Principles
  3. Specification Document Structure
  4. Versioning Model
  5. Terminology

Chapter 4: The UCP Ecosystem and Governance

  1. Origins and Founding Participants
  2. Governance Model
  3. SDKs, Reference Implementations and Tooling
  4. Adoption Status (as of 2026-11-21)
  5. Release History
  6. Relationship to Related Projects

Part II - Protocol Deep Dive

Chapter 5: Architecture Overview

  1. Actors and Roles
  2. Trust Boundaries
  3. High-Level Interaction Model
  4. Deployment Topologies
  5. Integration Patterns

Chapter 6: Discovery, Registration and Capability Negotiation

  1. The Discovery Document
  2. Platform Profiles
  3. The UCP-Agent Header
  4. Capability Negotiation Algorithm
  5. Negotiation Example
  6. Negotiation Errors
  7. Discovery Errors and Edge Cases

Chapter 7: The Data Model

  1. Schema Design Approach
  2. Namespace and Authority Binding
  3. Core Shared Types
  4. Entity and Resource Taxonomy
  5. Extensibility Mechanisms
  6. Conformance and Validation

Chapter 8: Catalog and Product Discovery Operations

  1. Catalog Capabilities
  2. Product Search Operation
  3. Product Lookup Operation
  4. Filtering and Faceting
  5. Pagination
  6. Pricing and Availability
  7. Media
  8. Error Handling
  9. Caching Considerations

Chapter 9: Cart and Checkout Operations

  1. Cart Capability
  2. Checkout Capability
  3. Address Handling
  4. Shipping and Fulfillment
  5. Tax Handling
  6. Payment Integration
  7. Idempotency
  8. Error Handling

Chapter 10: Orders, Fulfillment and the Post-Purchase Lifecycle

  1. Order Capability
  2. Order State Machine
  3. Fulfillment Events
  4. Returns and Refunds
  5. Webhook Notifications
  6. Order Permalinks

Chapter 11: Messaging, Transport and Asynchronous Patterns

  1. Transport Bindings
  2. HTTP Conventions
  3. Headers
  4. Request/Response Structure
  5. Asynchronous Patterns
  6. Concurrency and Race Conditions
  7. Error Model

Chapter 12: State, Consistency, Idempotency and Failure Handling

  1. State Management
  2. Consistency Model
  3. Idempotency
  4. Failure Handling
  5. Recovery

Chapter 13: Security Architecture

  1. Security Principles
  2. Transport Security
  3. HTTP Message Signatures
  4. Authentication
  5. Authorization
  6. Payment Security
  7. Identity Linking
  8. Privacy and Data Minimization
  9. Threat Model
  10. Key Management
  11. Security Best Practices

Part III - Building with UCP

Chapter 14: The Developer Toolkit

  1. Official SDKs
  2. The ucp-schema Tool
  3. Local Development Environment
  4. Validation and Contract Testing
  5. Debugging and Developer Experience

Chapter 15: Reference Implementation I - The Merchant Server

  1. Project Layout
  2. Dependency Manifest
  3. Environment Configuration
  4. Database Setup
  5. Pydantic Models
  6. Key Management
  7. Discovery Profile Endpoint
  8. Catalog Operations
  9. Checkout Operations
  10. Order Operations
  11. Request Signature Verification
  12. Application Wiring
  13. Data Import Script
  14. Sample Product Data
  15. Starting the Server
  16. Verifying the Server

Chapter 16: Reference Implementation II - The Buyer Agent and End-to-End Flow

  1. Agent Project Layout
  2. Agent Dependencies
  3. UCP Client Wrapper
  4. End-to-End Happy Path Client
  5. Running the End-to-End Flow
  6. Verification Steps
  7. Extending the Reference Implementation

Chapter 17: Production Engineering

  1. Observability
  2. Resilience
  3. Caching and Scaling
  4. Deployment Models
  5. CI/CD and Backward Compatibility
  6. Operational Processes

Part IV - Context and Future

Chapter 18: UCP in the Broader Protocol Landscape

  1. UCP vs. Model Context Protocol (MCP)
  2. UCP vs. A2A (Agent-to-Agent Protocol)
  3. UCP vs. AP2 (Agent Payments Protocol)
  4. UCP vs. Platform-Native Commerce APIs
  5. UCP vs. Legacy EDI/xAPI
  6. UCP vs. Payment Processor APIs
  7. UCP vs. OpenAPI/GraphQL
  8. GS1 and Product Identification
  9. FAPI and Financial Security
  10. Adoption Scenarios

Chapter 19: Patterns, Pitfalls and Evolution

  1. Architectural Patterns
  2. Common Implementation Pitfalls
  3. Unresolved Challenges
  4. Specification Evolution
  5. Future Directions

Conclusion: The Protocol That Bought It

Bibliography

Primary Sources (Specification & Official Documentation)

  1. [S1] UCP Specification Overview
  2. [S2] UCP Core Concepts
  3. [S3] UCP GitHub Repository
  4. [S4] Google Developer Blog: “Under the Hood: Universal Commerce Protocol (UCP)”
  5. [S5] UCP Checkout Specification (REST Binding)
  6. [S6] UCP Checkout Capability Overview
  7. [S7] UCP Checkout MCP Binding
  8. [S8] UCP Order Specification
  9. [S9] UCP Order REST Binding
  10. [S10] UCP Message Signatures Specification
  11. [S11] UCP Payment Tokenization Guide
  12. [S12] UCP Python SDK
  13. [S13] UCP JavaScript SDK
  14. [S14] UCP Samples Repository
  15. [S15] Flower Shop Client (Reference Implementation)
  16. [S16] Shopify News: “The agentic commerce platform”
  17. [S17] Shopify: Agents Documentation
  18. [S18] Google Merchant Center: UCP Guide
  19. [S19] Google Shopping
  20. [S20] Stripe: Agentic Commerce Documentation
  21. [S21] AP2 Protocol
  22. [S22] UCP Documentation Root
  23. [S23] UCP Identity Linking Specification
  24. [S24] UCP Payment Handler Guide

Reference Sources (Related Standards & Protocols)

  1. [R1] RFC 9421: HTTP Message Signatures
  2. [R2] RFC 7517: JSON Web Key (JWK)
  3. [R3] RFC 3339: Date and Time on the Internet
  4. [R4] JSON Schema 2020-12
  5. [R5] OpenAPI Specification 3.1.0
  6. [R6] OpenRPC Specification
  7. [R7] OAuth 2.0: The OAuth 2.0 Authorization Framework
  8. [R8] PCI DSS: Payment Card Industry Data Security Standard
  9. [R9] GS1 Standards
  10. [R10] UN/CEFACT Rec 20 - Common Codes for Units of Measure

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub