OpenClaw turns Sitewai into an Agent-friendly commerce layer.
An agent can discover products, inspect checkout requirements, create draft or pending orders, and hand the buyer a payment URL without touching store credentials or direct card capture.
Read the per-domain sitemap instead of scraping storefront HTML.
Use requirements to learn fields, headers, rate limits, and retry policy.
Call checkout.create to receive an invoice or order-pay URL.
Reuse the same Idempotency-Key only when retrying the identical payload.
OpenClaw flow
The agent discovers the store, validates checkout rules, creates a draft or pending order through Sitewai, and returns the payment URL to the buyer.
OpenClaw agent
Starts from a merchant domain, reads docs or the skill, and chooses the product and variant.
Merchant storefront
Publishes Sitewai discovery tags so the agent can find the right endpoints for the merchant domain.
Sitewai OpenClaw layer
Normalizes products, requirements, and checkout creation into one Agent-friendly contract.
Shopify or WooCommerce
Sitewai creates a Draft Order on Shopify or a pending order on WooCommerce server-to-server.
Buyer payment step
The agent hands the buyer the invoice or order-pay URL. Payment completes on the merchant checkout.
Use sitemap and storefront hints before building checkout payloads.
POST checkout.create with a fresh Idempotency-Key for each new intent.
Retry only transient failures. Never retry validation errors.
/api/sitewai/shop.examplePer-domain sitemap with normalized products, prices, and checkout hints.
/api/sitewai/shop.example/requirementsMachine-readable requirements, headers, retry policy, rate limits, and examples.
/api/checkout/createCreates a Shopify draft order or WooCommerce pending order and returns an invoice/payment URL.
- 1Read or obtain the merchant domain.
- 2Fetch the Sitewai sitemap for that domain.
- 3Identify the product and, if applicable, the exact variant.
- 4Fetch requirements when you need platform rules, field hints, or retry policy.
- 5Build a valid JSON payload for checkout.create.
- 6Generate a fresh Idempotency-Key for this intent.
- 7POST to /api/checkout/create with JSON and the idempotency header.
- 8Return the invoice or payment URL to the user.
- 9Do not retry validation errors.
- 10Retry only transient failures with exponential backoff.
Shopify
variantId is required. Sitewai creates a Draft Order server-to-server and returns invoice_url. Draft orders do not reserve inventory.
WooCommerce
Simple products can omit variantId. Variable products should send variantId. Sitewai creates a pending order and returns the order-pay URL.
Operational rule
If the sitemap exposes per-variant checkout entries, treat variant selection as mandatory even when the platform technically accepts a bare productId.
GET /api/sitewai/shop.exampleGET /api/sitewai/shop.example/requirementsPOST /api/checkout/create
Content-Type: application/json
Idempotency-Key: <uuid>
{
"domain": "shop.example",
"productId": "123",
"variantId": "456",
"qty": 1,
"customer": {
"email": "buyer@example.com",
"name": "Alice Example"
},
"sendEmail": true
}curl -X POST "$BASE/api/checkout/create" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"domain": "shop.example",
"productId": "123",
"variantId": "456",
"qty": 1,
"customer": {
"email": "buyer@example.com",
"name": "Alice Example"
},
"sendEmail": true
}'{
"ok": true,
"status": "invoice_sent",
"id": "ci_abc123",
"draftId": "do_987",
"url": "https://shop.example/pay/invoice/abc",
"emailed": true,
"stockConfirmed": false,
"note": "Shopify/Woo pending does not reserve stock",
"traceId": "req_7x8ab12c",
"timestamp": "2026-03-17T10:15:30.000Z"
}{
"ok": false,
"error": "validation_error",
"code": "variant_required_for_shopify",
"message": "Variant is required for Shopify",
"retryable": false,
"fields": {
"variantId": "required"
},
"traceId": "req_4v1m8a0f",
"timestamp": "2026-03-17T10:15:30.000Z"
}Headers to always send
Content-Type: application/jsonIdempotency-Key: <uuid>
Generate a new Idempotency-Key for every new checkout intent. Reuse the same key only if you are repeating the exact same body after a transient failure or uncertain timeout.
Retry on 408, 502, 503, 504, 522, and 524 using exponential backoff starting at 500ms with a maximum of 3 attempts.
Do not retry 400, 401, 403, 404, 409, or 422. Those indicate invalid input, auth/policy problems, or an idempotency mismatch.
- Draft-only / pending-only flow. OpenClaw does not capture payment directly.
- Inventory is not reserved by default. The returned URL must be completed by the buyer.
- sendEmail is optional and only succeeds when Sitewai has SMTP configured or a valid public checkout token path is enabled.
- The public create flow requires Idempotency-Key on every POST.
Public draft-only API overview and legal links.
Public Markdown version for agents that need the exact operating manual.
JSON Schema for checkout.create payloads and headers.
Theme/meta-tag installation notes for Shopify stores.
Theme/meta-tag installation notes for WooCommerce stores.