Ucp Checkout Rest
/install ucp-checkout-rest
UCP Checkout — REST Binding
Before writing code
Fetch live spec: Web-search site:ucp.dev specification checkout-rest and fetch the page for the exact current endpoint shapes, required headers, request/response schemas, and status codes.
Also fetch https://ucp.dev/specification/reference/ for all data type definitions (Buyer, LineItem, Total, Message, etc.).
Conceptual Architecture
Five REST Operations
| Operation | HTTP | Path | Idempotent? |
|---|---|---|---|
| Create Checkout | POST | /checkout-sessions |
Yes (via Idempotency-Key) |
| Get Checkout | GET | /checkout-sessions/{id} |
Naturally |
| Update Checkout | PUT | /checkout-sessions/{id} |
Yes (full replace) |
| Complete Checkout | POST | /checkout-sessions/{id}/complete |
Yes (via Idempotency-Key) |
| Cancel Checkout | POST | /checkout-sessions/{id}/cancel |
Yes (via Idempotency-Key) |
Required Headers (every request)
UCP-Agent: Platform's profile URI in RFC 8941 structured field format —profile="https://..."Idempotency-Key: UUID for mutating operations; Business caches 24+ hoursRequest-Id: UUID for distributed tracingRequest-Signature: Cryptographic signature for request integrity verificationContent-Type:application/json
Status State Machine
incomplete → requires_escalation → ready_for_complete → complete_in_progress → completed
| | | |
+---------------+--------------------+----------------------+--------→ canceled
The canceled state is reachable from any non-terminal state (incomplete, requires_escalation, ready_for_complete, complete_in_progress).
The agent's job is to drive the session from incomplete to ready_for_complete by resolving messages, then call complete.
Negotiation in Every Response
Every response includes a ucp object with the negotiated version and capabilities. The Business computes the intersection of its own capabilities with the Platform's profile, prunes orphaned extensions, and returns only what both sides support.
Error Handling Pattern
Responses include a messages array. Each message has:
type: error / warning / infocode: Machine-readable error codecontent: Human-readable descriptionseverity: recoverable / requires_buyer_input / requires_buyer_review (these are the 3 formal enum values; note:escalationappears in some spec sections but is NOT part of the formal severity enum — this is a spec inconsistency)path: JSONPath pointing to the problematic field
Agent behavior by severity:
recoverable→ Agent fixes automatically (e.g., update with missing address)requires_buyer_input→ Ask the human userrequires_buyer_review→ Show totals/terms for human confirmationescalation→ Redirect tocontinue_url
Implementation Checklist
Business (merchant server):
- Parse
UCP-Agentheader and fetch platform profile for negotiation - Validate
Idempotency-Key— return cached response if duplicate - Create checkout session with line items, compute totals
- Return negotiated
ucpobject + full session state + messages - Handle Update by recalculating totals, re-validating, updating messages
- Handle Complete by processing payment credential, creating order
- Handle Cancel by cleaning up session
- Return proper HTTP status codes (201 Created, 200 OK, 400/409/429, etc.)
Platform (agent client):
- Discover Business profile at
/.well-known/ucp - Send
UCP-Agentheader with own profile URI - Create checkout, inspect
statusandmessages - Loop: resolve messages → update checkout → re-check status
- When
ready_for_complete: acquire payment credential, call complete - Handle
requires_escalationby surfacingcontinue_urlto user
Monetary Values
All amounts are integers in minor currency units (e.g., $29.99 = 2999). Never use floating point.
TLS Requirement
All UCP REST endpoints MUST be served over HTTPS with minimum TLS 1.3.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ucp-checkout-rest - 安装完成后,直接呼叫该 Skill 的名称或使用
/ucp-checkout-rest触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Ucp Checkout Rest 是什么?
Implement UCP Checkout over the REST binding — create, get, update, complete, and cancel checkout sessions with proper headers, idempotency, status transitio... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 80 次。
如何安装 Ucp Checkout Rest?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ucp-checkout-rest」即可一键安装,无需额外配置。
Ucp Checkout Rest 是免费的吗?
是的,Ucp Checkout Rest 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Ucp Checkout Rest 支持哪些平台?
Ucp Checkout Rest 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Ucp Checkout Rest?
由 Rohit Bajaj(@ichiorca)开发并维护,当前版本 v1.0.0。