← 返回 Skills 市场
ichiorca

Ucp Checkout Rest

作者 Rohit Bajaj · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
80
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ucp-checkout-rest
功能描述
Implement UCP Checkout over the REST binding — create, get, update, complete, and cancel checkout sessions with proper headers, idempotency, status transitio...
使用说明 (SKILL.md)

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+ hours
  • Request-Id: UUID for distributed tracing
  • Request-Signature: Cryptographic signature for request integrity verification
  • Content-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 / info
  • code: Machine-readable error code
  • content: Human-readable description
  • severity: recoverable / requires_buyer_input / requires_buyer_review (these are the 3 formal enum values; note: escalation appears 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 user
  • requires_buyer_review → Show totals/terms for human confirmation
  • escalation → Redirect to continue_url

Implementation Checklist

Business (merchant server):

  1. Parse UCP-Agent header and fetch platform profile for negotiation
  2. Validate Idempotency-Key — return cached response if duplicate
  3. Create checkout session with line items, compute totals
  4. Return negotiated ucp object + full session state + messages
  5. Handle Update by recalculating totals, re-validating, updating messages
  6. Handle Complete by processing payment credential, creating order
  7. Handle Cancel by cleaning up session
  8. Return proper HTTP status codes (201 Created, 200 OK, 400/409/429, etc.)

Platform (agent client):

  1. Discover Business profile at /.well-known/ucp
  2. Send UCP-Agent header with own profile URI
  3. Create checkout, inspect status and messages
  4. Loop: resolve messages → update checkout → re-check status
  5. When ready_for_complete: acquire payment credential, call complete
  6. Handle requires_escalation by surfacing continue_url to 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.

安全使用建议
Before using this skill to build a real checkout client or server, make sure final purchase completion requires explicit buyer confirmation, credentials are tokenized and never logged, and the live UCP specification is fetched only from official HTTPS sources.
功能分析
Type: OpenClaw Skill Name: ucp-checkout-rest Version: 1.0.0 The skill bundle provides legitimate architectural guidance and implementation instructions for the Universal Checkout Protocol (UCP) REST binding. It outlines standard API operations, header requirements (including cryptographic signatures), and error handling logic. The instructions to fetch live specifications from ucp.dev are consistent with the stated purpose, and there are no signs of malicious code, data exfiltration, or harmful prompt injection.
能力标签
cryptocan-make-purchases
能力评估
Purpose & Capability
The skill's purpose is clearly to implement UCP Checkout REST operations, including checkout completion and cancellation; those actions are high-impact but disclosed and central to the stated purpose.
Instruction Scope
The instructions describe automatically resolving recoverable checkout messages and calling complete when ready; this is purpose-aligned, but generated clients should require clear buyer confirmation before final purchase completion.
Install Mechanism
No install spec, binaries, environment variables, or code files are present; this is an instruction-only skill.
Credentials
The skill asks the agent to fetch the live UCP specification from the web, which is reasonable for protocol implementation but should be limited to official HTTPS sources.
Persistence & Privilege
No persistence is requested, but the protocol references payment credentials and request signatures, so any implementation must protect those materials and avoid logging them.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ucp-checkout-rest
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ucp-checkout-rest 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of ucp-checkout-rest skill. - Implements UCP Checkout session lifecycle over REST: create, get, update, complete, and cancel. - Enforces required headers (UCP-Agent, Idempotency-Key, Request-Id, Request-Signature, Content-Type) for every request. - Follows UCP session state machine and status transitions. - Handles capability negotiation via the `ucp` object in each response. - Standardizes error handling and message severities for client and business logic. - Specifies proper use of integer monetary values and minimum TLS 1.3 for all endpoints.
元数据
Slug ucp-checkout-rest
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论