Everything your AI agent needs to introduce itself, understand your boundaries, and start working together.
Authorization: Bearer clr_live_a1b2c3d4...POST /api/v1/agent/connect
{
"agentName": "Shopping Assistant",
"agentType": "shopping",
"platform": "claude",
"capabilities": ["shopping", "payment"]
}POST /api/v1/agent/check
{
"action": "purchase",
"transaction": {
"amount": 49.99,
"currency": "USD",
"merchantName": "Amazon",
"merchantDomain": "amazon.com",
"category": "electronics"
}
}/api/v1/agent/connect/api/v1/agent/check/api/v1/agent/rules/api/v1/agent/soul/api/v1/agent/stores| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Agent created (pending confirmation) |
| 400 | Validation error |
| 401 | Invalid or missing API key |
| 403 | Agent suspended, pending, or kill switch active |
| 404 | Agent not found |
| 429 | Rate limit exceeded |
{
"result": "allow" | "deny" | "escalate",
"ruleId": "SF-001",
"ruleName": "Per-Transaction Spending Cap",
"reason": "Transaction amount $49.99 is within limit of $500",
"approvalRequired": {
"tier": 1,
"method": "notification",
"timeout": 300
},
"evaluatedRules": 42,
"timestamp": "2026-02-20T12:00:00.000Z"
}Governance-mode checkout endpoints for agent-driven purchase flows. ClawdRules evaluates rules, approves or denies transactions, and the agent handles payment externally. After paying, the agent reports a receipt back to complete the checkout. All amounts are in the smallest currency unit (cents for USD).
/api/v1/agent/checkout/api/v1/agent/checkout/api/v1/agent/checkout/update/api/v1/agent/checkout/complete/api/v1/agent/approval/{approvalId}/api/v1/agent/checkout/receipt/api/v1/agent/checkout/cancel/api/v1/agent/kill-switchClawdRules is governance-only: it evaluates rules and approves/denies transactions, but does not process payments. The agent pays externally (e.g., via Stripe, a browser, or another payment provider) and then reports a receipt back to ClawdRules to complete the checkout.
allow, deny, or escalatecomplete to move to approvednot_ready_for_payment ──(update items)──> ready_for_payment
│ │
│ (complete)
│ │
│ ▼
│ approved
│ │
│ (receipt)
│ │
└─────────(cancel)──────> canceled ▼
completednot_ready_for_payment — Initial state after creation. Items present but checkout not yet validated.
ready_for_payment — Items validated, rules passed. Ready for approval.
approved — Governance approved. Agent should now pay externally and report a receipt.
completed — Receipt received. Order finalized.
canceled — Checkout was canceled by agent, denied by rules, or expired.
/api/v1/agent/checkoutCreate a new checkout session. Runs governance rules on the cart items. Returns status not_ready_for_payment or ready_for_payment.
// Request body
{
"items": [
{
"name": "Wireless Headphones", // required, max 200 chars
"unit_amount": 4999, // required, cents (positive int, max 99999999)
"quantity": 1, // required, positive int, max 10000
"sku": "WH-100", // optional, max 100 chars
"category": "electronics" // optional, max 100 chars
}
],
"currency": "USD", // optional, default "USD", ISO 4217
"merchant_name": "TechShop", // optional, max 200 chars
"merchant_domain": "techshop.com", // optional, max 200 chars
"category": "electronics", // optional, max 100 chars
"metadata": { "ref": "order-123" } // optional, under 10KB JSON
}/api/v1/agent/checkoutRead the current checkout status. Pass checkout_id as a query parameter.
GET /api/v1/agent/checkout?checkout_id=chk_abc123 // Returns full CheckoutResponse (same shape as all checkout endpoints)
/api/v1/agent/checkout/updateUpdate items, merchant, or metadata on an existing checkout. Only valid when status is not_ready_for_payment or ready_for_payment.
// Request body
{
"checkout_id": "chk_abc123", // required
"items": [ // optional — replaces all items
{
"name": "Wireless Headphones",
"unit_amount": 3999,
"quantity": 2,
"sku": "WH-100",
"category": "electronics"
}
],
"merchant_name": "TechShop", // optional
"merchant_domain": "techshop.com", // optional
"category": "electronics", // optional
"metadata": { "ref": "updated-456" } // optional
}/api/v1/agent/checkout/completeRequest approval to proceed with the purchase. Only valid when status is ready_for_payment. If rules allow it, transitions to approved. If escalated, the agent must poll the approval endpoint until resolved. No payment tokens are needed — the agent pays externally after approval.
// Request body
{
"checkout_id": "chk_abc123" // required
}
// Response on approval:
{
"id": "chk_abc123",
"status": "approved",
"approval_required": null,
...
}
// Response when escalated (requires human approval):
{
"id": "chk_abc123",
"status": "ready_for_payment",
"approval_required": {
"approval_id": "apr_xyz",
"tier": 2,
"method": "notification",
"timeout": 300,
"status": "pending"
},
...
}/api/v1/agent/checkout/cancelCancel an active checkout. Valid from any status except completed. Transitions to canceled.
// Request body
{
"checkout_id": "chk_abc123", // required
"reason": "User changed mind" // optional, max 500 chars
}/api/v1/agent/approval/{approvalId}Poll the status of a pending approval. Use this when the complete endpoint returns an escalated response with an approval_id. Poll until status is no longer pending.
GET /api/v1/agent/approval/apr_xyz
// Response:
{
"approval_id": "apr_xyz",
"status": "pending" | "approved" | "denied" | "expired",
"checkout_id": "chk_abc123",
"tier": 2,
"method": "notification",
"reason": null, // populated on deny
"decided_at": null, // populated when resolved
"expires_at": "2026-02-22T12:05:00.000Z"
}/api/v1/agent/checkout/receiptFINAL STEPReport a payment receipt after the agent has paid externally. This is the final step in the checkout flow. Only valid when status is approved. Transitions to completed.
// Request body
{
"checkout_id": "chk_abc123", // required
"receipt": {
"external_id": "pi_xxxxxxxx", // required — payment provider's transaction ID
"provider": "stripe", // required — payment provider name
"amount_charged": 4999, // required — actual amount charged in cents
"currency": "USD", // optional, default matches checkout currency
"paid_at": "2026-02-22T12:02:00Z", // optional, defaults to now
"metadata": { // optional
"card_last4": "4242",
"confirmation_url": "https://..."
}
}
}
// Response:
{
"id": "chk_abc123",
"status": "completed",
"order": {
"id": "ord_abc123",
"checkout_session_id": "chk_abc123",
"external_payment_id": "pi_xxxxxxxx",
"provider": "stripe",
"amount_charged": 4999,
"completed_at": "2026-02-22T12:02:00.000Z"
},
...
}/api/v1/agent/kill-switchEmergency kill switch. Immediately suspends the agent and cancels all active checkouts. Requires explicit confirmation. This action is irreversible — the agent must be manually re-enabled from the dashboard.
// Request body
{
"confirm": true, // required — must be true
"reason": "Suspicious activity" // required — why the kill switch was triggered
}
// Response:
{
"success": true,
"agent_status": "suspended",
"active_checkouts_canceled": 3,
"timestamp": "2026-02-22T12:00:00.000Z"
}All checkout endpoints return the full CheckoutResponse object. This is the canonical shape:
{
"id": "chk_abc123",
"status": "approved", // see status machine above
"currency": "usd",
"line_items": [
{
"id": "li_item1",
"item": { "name": "Wireless Headphones", "quantity": 1, "sku": "WH-100" },
"base_amount": 4999,
"subtotal": 4999,
"tax": 0,
"total": 4999
}
],
"merchant_name": "TechShop",
"merchant_domain": "techshop.com",
"category": "electronics",
"totals": [
{ "type": "subtotal", "display_text": "Subtotal", "amount": 4999 },
{ "type": "tax", "display_text": "Tax", "amount": 0 },
{ "type": "total", "display_text": "Total", "amount": 4999 }
],
"messages": [],
"rule_result": "allow",
"rule_name": "Per-Transaction Spending Cap",
"reason": "Transaction amount $49.99 is within limit of $500",
"approval_required": null, // null when approved, object when escalated
"order": null, // populated after receipt is reported
"expires_at": "2026-02-22T13:00:00.000Z",
"created_at": "2026-02-22T12:00:00.000Z"
}Errors follow the format: { type, code, message, param? }
| Code | Type | Meaning |
|---|---|---|
| checkout_not_found | invalid_request | No checkout with that ID exists |
| checkout_expired | invalid_request | Checkout session has expired |
| checkout_not_ready | invalid_request | Checkout is not in the correct state for this operation |
| checkout_completed | invalid_request | Cannot modify a completed checkout |
| rules_denied | invalid_request | Transaction denied by governance rules |
| approval_pending | invalid_request | Approval is still pending — poll the approval endpoint |
| approval_denied | invalid_request | Human reviewer denied the transaction |
| approval_expired | invalid_request | Approval request timed out |
| approval_not_found | invalid_request | No approval with that ID exists |
| receipt_mismatch | invalid_request | Receipt amount does not match approved checkout total |
| kill_switch_active | forbidden | Agent is suspended — kill switch was triggered |
| validation_error | invalid_request | Request body validation failed |
| malformed_json | invalid_request | Request body is not valid JSON |