agentic-commerce
agentic-commerce skill for OpenClaw agents
Installation
npx clawhub@latest install agentic-commerceView the full skill documentation and source below.
Documentation
Purch Public API
Base URL:
## Rate Limits
60 requests/minute per IP. Headers in every response:
- X-RateLimit-Limit: Max requests per window
- X-RateLimit-Remaining: Requests left
- X-RateLimit-Reset: Seconds until reset
## Endpoints
### GET /search - Structured Product Search
Query products with filters.
__CODE_BLOCK_0__
**Parameters:**
| Param | Type | Required | Description |
|-------|------|----------|-------------|
| q | string | Yes | Search query |
| priceMin | number | No | Minimum price |
| priceMax | number | No | Maximum price |
| brand | string | No | Filter by brand |
| page | number | No | Page number (default: 1) |
**Response:**
__CODE_BLOCK_1__
### POST /shop - AI Shopping Assistant
Natural language product search. Returns 20+ products from both Amazon and Shopify.
__CODE_BLOCK_2__
**Request Body:**
__CODE_BLOCK_3__
**Response:**
__CODE_BLOCK_4__
### POST /buy - Create Purchase Order
Create an order and get a transaction to sign. **Chain is auto-detected from wallet format:**
- Solana wallet (base58): 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
- Base/EVM wallet (0x): 0x1234567890abcdef1234567890abcdef12345678
**Amazon Products (Solana)**:
__CODE_BLOCK_5__
**Amazon Products (Base)**:
__CODE_BLOCK_6__
**Shopify Products** - Use productUrl AND variantId:
__CODE_BLOCK_7__
**Response:**
__CODE_BLOCK_8__
## CLI Scripts
This skill includes ready-to-use CLI scripts for all endpoints. Available in Python and TypeScript/Bun.
**Dependencies (Solana):**
__CODE_BLOCK_9__
**Dependencies (Base/EVM):**
__CODE_BLOCK_10__
### Search Products
__CODE_BLOCK_11__
### AI Shopping Assistant
__CODE_BLOCK_12__
### Create Order (without signing)
__CODE_BLOCK_13__
Address format: Name,Line1,City,State,PostalCode,Country[,Line2][,Phone]
### Create Order AND Sign Transaction (Solana)
End-to-end purchase flow - creates order and signs/submits the Solana transaction:
__CODE_BLOCK_14__
### Create Order AND Sign Transaction (Base)
End-to-end purchase flow using Base/EVM wallet:
__CODE_BLOCK_15__
### Sign Transaction Only (Solana)
If you already have a serializedTransaction from the /buy endpoint:
__CODE_BLOCK_16__
### Sign Transaction Only (Base)
__CODE_BLOCK_17__
**Output (Solana):**
__CODE_BLOCK_18__
**Output (Base):**
__CODE_BLOCK_19__
## Signing Transactions Programmatically
For custom integrations without using the bundled scripts:
### JavaScript/TypeScript
__CODE_BLOCK_20__
### React with Wallet Adapter
__CODE_BLOCK_21__
### Python (with solana-py)
__CODE_BLOCK_22__
## Signing Base/EVM Transactions
For Base chain orders, the serializedTransaction is an EVM transaction that needs to be signed with an EVM wallet.
### TypeScript with viem
__CODE_BLOCK_23__
### React with wagmi
__CODE_BLOCK_24__
## Complete Checkout Flow (Solana)
__CODE_BLOCK_25__
## Complete Checkout Flow (Base)
__CODE_BLOCK_26__
## Fallback: Browser Checkout
If wallet signing fails or isn't available, redirect to checkoutUrl for browser-based payment:
__CODE_BLOCK_27__
## Error Handling
All endpoints return errors as:
__CODE_BLOCK_28__
Common error codes:
- VALIDATION_ERROR (400) - Invalid request parameters
- NOT_FOUND (404) - Product not found
- RATE_LIMITED (429) - Too many requests
- INTERNAL_ERROR` (500) - Server error