Open Commerce Standard

Universal Commerce Protocol

Production-ready Rust server implementing the Universal Commerce Protocol for modern e-commerce checkout flows with agent-native communication.

REST + gRPC + MCP + A2A in a single, cryptographically-secured handler.

<100ms
Response Time
2026-01
Protocol Version
7+
Capabilities
4
Languages
Protocol Overview

What is Universal Commerce Protocol?

UCP is an open standard for e-commerce checkout that enables seamless communication between AI agents, platforms, and merchants. It provides a unified interface for creating, managing, and completing purchases with cryptographic security and multi-protocol support.

Complete checkout lifecycle with session management
JWS (JSON Web Signature) cryptographic message signing
Multi-protocol: REST, gRPC, MCP (AI agents), A2A
Embedded iCommerce backend with real inventory & tax
OAuth 2.0 identity linking for repeat customers
Webhook notifications for order events

Checkout State Machine

incomplete
Session created, data being collected
requires_escalation
Human intervention needed
ready_for_complete
All data valid, ready to finalize
complete_in_progress
Payment processing
completed
Order created successfully
canceled
Session canceled
Multi-Protocol

Four Protocols, One Handler

Connect via REST, gRPC, MCP for AI agents, or A2A for agent-to-agent communication

REST + JSON

Standard HTTP/HTTPS with JSON payloads and JWS signature verification

JWS detached signaturesIdempotency supportRequest-Id tracking
Extensions

UCP Capabilities

Modular extensions for checkout, orders, fulfillment, discounts, and more

Checkout Session

dev.ucp.shopping.checkout

Create, update, and complete checkout sessions with full lifecycle management

Create SessionGet SessionUpdate SessionCompleteCancel
REST API

API Endpoints

Complete REST API for checkout lifecycle management with JWS signatures and idempotency support.

POST/api/checkout-sessions
GET/api/checkout-sessions/:id
PUT/api/checkout-sessions/:id
POST/api/checkout-sessions/:id/complete
POST/api/checkout-sessions/:id/cancel
GET/api/orders/:id
POST/tokenize
GET/.well-known/ucp
Create Checkout Session
// Create a checkout session via UCP
const response = await fetch(
  'https://ucp.stateset.io/api/checkout-sessions',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'UCP-Agent': 'profile="https://myapp.com/profile"',
      'Request-Id': crypto.randomUUID(),
      'Request-Signature': '<jws-detached-signature>'
    },
    body: JSON.stringify({
      line_items: [
        { item: { id: 'item_123' }, quantity: 2 }
      ],
      currency: 'USD',
      buyer: {
        email: 'buyer@example.com',
        first_name: 'John',
        last_name: 'Doe'
      },
      payment: {
        selected_instrument_id: 'pi_demo',
        instruments: [{
          id: 'pi_demo',
          type: 'card'
        }]
      },
      fulfillment: {
        methods: [{
          type: 'shipping',
          destinations: [{
            id: 'dest_1',
            street_address: '123 Main St',
            city: 'San Francisco',
            state: 'CA',
            postal_code: '94102'
          }],
          selected_destination_id: 'dest_1'
        }]
      },
      discounts: {
        codes: ['SAVE10']
      }
    })
  }
);

const checkout = await response.json();
// { id: "chk_xxx", status: "ready_for_complete", ... }

Discovery Endpoint

GET /.well-known/ucp

Advertises protocol version, supported capabilities, payment handlers, signing keys (JWK format), and service endpoints.

Protocol version & capabilities
Payment handler specifications
Public signing keys (JWK)
REST, gRPC, MCP, A2A endpoints

Cryptographic Security

JWS + ECDSA

All requests and responses are signed with JWS (JSON Web Signature) using ES256/ES384 ECDSA cryptography for tamper-proof communication.

JWS detached signatures on all requests
ES256/ES384 ECDSA cryptography
RFC 8941 Structured Field Values
Idempotency key deduplication
Commerce Backend

Embedded iCommerce Engine

Full commerce backend with real inventory, dynamic pricing, tax calculation, and promotions

SQLite Persistence

Durable checkout and order storage at ./commerce.db

Real Inventory

Stock reservation and fulfillment tracking

Dynamic Promotions

Percentage off, fixed amount, BOGO, tiered discounts

Multi-Jurisdiction Tax

Address-based tax calculation with dynamic rates

Language Bindings

Native bindings for multiple programming languages

🟢

Node.js

@stateset/ucp-handler-nodeN-API
🐍

Python

stateset-ucpPyO3
🔵

Go

github.com/stateset/ucp-goCGO
💎

Ruby

stateset-ucprb-sys

Use Cases

Standardized commerce for AI agents, platforms, and merchants

Agent-Driven Ecommerce

AI agents execute purchases via MCP/A2A protocols with full checkout lifecycle

Multi-Platform Commerce

Unified checkout experience across multiple sales channels and marketplaces

Secure Payments

JWS-signed transactions with complete audit trail for compliance

Identity-Linked Payments

OAuth identity binding for seamless repeat customer experiences

Real-Time Fulfillment

Dynamic shipping options with carrier integration and inventory awareness

Promotion Engine

Complex business rules for discounts, incentives, and loyalty programs

Ready to Implement UCP?

Deploy the Universal Commerce Protocol for agent-native checkout flows