AP2 Mock Checkout for Openclaw

A mock agent-to-agent checkout simulator that enables AI coding agents to test buying and settlement workflows using mcporter and mock MCP servers.

xielianghai
v1.0.1
Jun 3, 2026
0
570
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ap2-checkout

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ap2-checkout using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is AP2 Mock Checkout?

The AP2 Mock Checkout skill is designed to facilitate local, simulated agent-to-agent (A2A) transaction flows. It provides developers with a robust environment to prototype, test, and debug e-commerce scenarios where AI agents act as buyers and merchants. Integrated seamlessly within the ecosystem of Openclaw Skills, this tool acts as a mock backend to simulate high-presence (HP) and hot-not-present (HNP) purchase flows without executing actual financial transactions.

By leveraging this skill, developers can safely evaluate complex buyer-merchant behaviors, payment rail switching (such as transitioning from traditional cards to mock crypto via x402), and crucial multi-agent security mechanisms like the Trusted Surface user approval step. This ensures that agent-driven transactions remain deterministic, secure, and fully verified before production deployment.

AP2 Mock Checkout Use Cases

  • Testing autonomous agent-to-agent e-commerce workflows locally without risking real money or hitting live payment APIs.
  • Simulating price monitoring and delayed buying triggers (Hot-and-Not-Present flow) based on simulated market drops.
  • Evaluating user confirmation steps and Trusted Surface interfaces for AI-driven financial approvals.
  • Benchmarking payment rail switching scenarios, such as migrating a transaction context from simulated credit cards to x402 crypto assets.
  • Debugging complex model responses when interacting with structured multi-agent checkout protocols.

How AP2 Mock Checkout Works

  1. Initialization: The developer starts the local mock backend servers, establishing mock services for the buyer, merchant, credentials provider, and payment processor.
  2. Session Configuration: The agent establishes a stable session identity and selects the interaction mode (presence mode: hp for immediate purchase, or hnp for price monitoring) and preferred payment method (card or x402).
  3. Product Evaluation: The agent queries the mock merchant's product catalog (e.g., retrieving details for SuperShoe inventory) and applies target constraints.
  4. Trusted Surface Approval: Before finalizing any purchase mandate, the agent generates a payment summary and awaits explicit user approval via the Trusted Surface registration tool.
  5. Mandate Signing and Execution: Once approved, the agent signs the transaction mandates, requests mock credentials, executes checkout, and retrieves a mock purchase receipt for verification.

AP2 Mock Checkout Setup

Installation and Orchestration

To configure the AP2 Mock Checkout skill, follow these steps:

# Step 1: Export repository home
export AP2_HOME="/path/to/AP2"

# Step 2: Install via the recommended automated command
cd "$AP2_HOME"
npx -y file:code/samples/python/scenarios/a2a/unified/clawhub/npm/ap2-agent-checkout install

Local Backend Configuration

# Step 3: Start the local mock backend servers
cd "$AP2_HOME/code/samples/python/scenarios/a2a/unified"
chmod +x openclaw/start_ap2_backend.sh openclaw/stop_ap2_backend.sh
./openclaw/start_ap2_backend.sh

# Step 4: Set the mcporter configuration directory
export MCPORTER_CONFIG="$HOME/.openclaw/workspace/skills/ap2-checkout/mcporter.json"

Gateway Activation

To complete activation, enable mcporter and ap2-checkout under the enabled block in your ~/.openclaw/openclaw.json config file and restart the OpenClaw gateway.

AP2 Mock Checkout Data Schema & Taxonomy

Parameter / Resource Type / Port Description
AP2_HOME Environment Variable Absolute path pointing to the AP2 repository root.
MCPORTER_CONFIG Environment Variable Path pointing to the mcporter.json file for configuring the skill.
Mock Backend Ports Network Range Ports 8091 to 8094 run the simulated merchant, buyer, identity, and payment servers.
MCP HTTP Ports Network Range Ports 8100 to 8103 serve the Model Context Protocol endpoints.
session_id String A unique session tracking ID (e.g., channel or user thread ID) persistent across calls.
presence_mode String (hp / hnp) Operating mode: High Presence (immediate) or Hot-and-Not-Present (price tracking).
payment_method String (card / x402) Selected payment rail: mock credit card or mock crypto.

AP2 Mock Checkout Advanced Features

  • Simulated Price Drop Triggers: Developers can run manual cURL commands to mock external price changes, testing the agent's ability to trigger HNP checkout actions dynamically.
  • Strict Trusted Surface Enforcement: Mandatory registration steps ensure agents cannot complete purchases without explicit, structured verification, preventing unauthorized spend loops.
  • Dynamic Payment Rail Switching: Seamlessly change transaction structures mid-session between traditional and crypto schemes by clearing and re-signing active session mandates.
  • Local Multi-Agent Orchestration: Out-of-the-box local orchestration enables realistic testing of multi-model pipelines with zero reliance on external APIs, making it a critical asset among high-fidelity Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins mcportercurluvpython3
Github Stars: 0
forks: 0

Featured*