How universal-commerce-protocol/samples works
This repository contains three UCP merchant-server samples plus an A2A retail agent and chat client. The user journey is merchant discovery, shopping and checkout, payment, then order handling; the A2A variant adds conversational product selection and payment credentials. The graph preserves the documented Python and Node.js server capabilities and the agent’s shopping flow. Some subsystems are represented from README or index references rather than sampled implementation details, so uncertain internal wiring is omitted.
Main entry points: server.py FastAPI Service · checkout_service.py Checkout Lifecycle · index.ts Hono Service · App.tsx Chat Application
Components 34
A2A Retail Agent
- Shopping Agent
a2a/business_agent/src/business_agent/agent.py - Agent Runtime
a2a/business_agent/src/business_agent/agent_executor.py - Product Store
a2a/business_agent/src/business_agent/store.py - Product Types
a2a/business_agent/src/business_agent/models/product_types.py - Payment Processor
a2a/business_agent/src/business_agent/payment_processor.py - UCP Extension
a2a/business_agent/src/business_agent/a2a_extensions/ucp_extension.py
Python Merchant Server
- FastAPI Service
rest/python/server/server.py - Generated UCP Routes
rest/python/server/generated_routes/ucp_routes.py - Route Implementation
rest/python/server/routes/ucp_implementation.py - Discovery Route
rest/python/server/routes/discovery.py - MCP Route
rest/python/server/routes/mcp.py - Order Route
rest/python/server/routes/order.py - Checkout Lifecycle
rest/python/server/services/checkout_service.py - Cart Service
rest/python/server/services/cart_service.py - Fulfillment Options
rest/python/server/services/fulfillment_service.py - Commerce Database
rest/python/server/db.py - Commerce Models
rest/python/server/models.py - Request Signing
rest/python/server/ucp_signing.py - Webhook Signing
rest/python/server/webhook_signer.py - Happy-Path Client
rest/python/client/flower_shop/simple_happy_path_client.py
Node Merchant Server
- Hono Service
rest/nodejs/src/index.ts - Discovery API
rest/nodejs/src/api/discovery.ts - Checkout API
rest/nodejs/src/api/checkout.ts - Order API
rest/nodejs/src/api/order.ts - Simulation API
rest/nodejs/src/api/testing.ts - Commerce Database
rest/nodejs/src/data/db.ts - Transaction Store
rest/nodejs/src/data/transactions.ts
A2A Chat Client
- Chat Application
a2a/chat-client/App.tsx - Chat Input
a2a/chat-client/components/ChatInput.tsx - Message Renderer
a2a/chat-client/components/ChatMessage.tsx - Checkout UI
a2a/chat-client/components/Checkout.tsx - Payment Confirmation
a2a/chat-client/components/PaymentConfirmation.tsx
Other components
- Shopper
- Commerce Platform
Connections 33
- Shopper → Chat Application: uses
- Chat Application → Chat Input: renders
a2a/chat-client/App.tsx - Chat Application → Message Renderer: renders
a2a/chat-client/App.tsx - Chat Application → Shopping Agent: sends chat
a2a/chat-client/App.tsx - Chat Application → Message Renderer: renders checkout
a2a/chat-client/components/ChatMessage.tsx - Message Renderer → Checkout UI: renders
a2a/chat-client/components/ChatMessage.tsx - Message Renderer → Payment Confirmation: renders
a2a/chat-client/components/ChatMessage.tsx - Agent Runtime → Shopping Agent: runs
a2a/business_agent/src/business_agent/main.py - Shopping Agent → Product Store: queries
a2a/business_agent/src/business_agent/agent.py - Product Store → Product Types: uses types
a2a/business_agent/src/business_agent/store.py - Shopping Agent → Payment Processor: uses payments
a2a/business_agent/src/business_agent/agent.py - Commerce Platform → FastAPI Service: calls UCP
- FastAPI Service → Generated UCP Routes: includes routes
rest/python/server/server.py - FastAPI Service → Route Implementation: applies implementation
rest/python/server/server.py - FastAPI Service → Discovery Route: includes route
rest/python/server/server.py - FastAPI Service → MCP Route: includes route
rest/python/server/server.py - FastAPI Service → Order Route: includes route
rest/python/server/server.py - Route Implementation → Checkout Lifecycle: delegates checkout
rest/python/server/routes/ucp_implementation.py - Route Implementation → Cart Service: delegates cart
rest/python/server/routes/ucp_implementation.py - Checkout Lifecycle → Fulfillment Options: calculates options
rest/python/server/services/checkout_service.py - Checkout Lifecycle → Commerce Database: reads and writes
rest/python/server/services/checkout_service.py - Cart Service → Commerce Database: reads and writes
rest/python/server/services/cart_service.py - Checkout Lifecycle → Commerce Models: uses models
rest/python/server/services/checkout_service.py - Checkout Lifecycle → Webhook Signing: signs deliveries
rest/python/server/services/checkout_service.py - Webhook Signing → Request Signing: uses signing
rest/python/server/webhook_signer.py - Happy-Path Client → Commerce Platform: discovers and checks out
- Commerce Platform → Hono Service: calls UCP
- Hono Service → Discovery API: routes discovery
rest/nodejs/src/index.ts - Hono Service → Checkout API: routes checkout
rest/nodejs/src/index.ts - Hono Service → Order API: routes orders
rest/nodejs/src/index.ts - Hono Service → Simulation API: routes simulation
rest/nodejs/src/index.ts - Checkout API → Commerce Database: initializes storage
rest/nodejs/src/index.ts - Checkout API → Transaction Store: stores transactions
rest/nodejs/src/api/checkout.ts