{
    "name": "Claude CMS agent payments",
    "version": "1.0",
    "description": "Create a hosted Stripe payment page for any store built on Claude CMS, on behalf of a human buyer. Money goes straight to the merchant's own Stripe account; no card details pass through this API.",
    "docs": "https://claudecms.com/agents",
    "llms_txt": "https://claudecms.com/llms.txt",
    "openapi": "https://claudecms.com/api/agent/openapi.json",
    "endpoints": {
        "create": {
            "method": "POST",
            "url": "https://claudecms.com/api/agent/checkout",
            "body": {
                "store": "merchant domain or Claude CMS store handle (required)",
                "items": "[{sku|handle|variant_id, quantity, variant?}] to buy products",
                "amount_pence": "or a plain amount in the store currency's minor unit, with description",
                "description": "what the payment is for (required for a plain amount)",
                "buyer_email": "optional, prefilled on the payment page",
                "reference": "optional; repeat it to get the same open link back",
                "shipping_country": "optional ISO-2, for items",
                "success_url": "optional https",
                "cancel_url": "optional https",
                "preview": "true = validate and quote only, nothing is created"
            }
        },
        "status": {
            "method": "GET",
            "url": "https://claudecms.com/api/agent/checkout?id={id}&t={token}",
            "returns": "status open | paid | expired | cancelled | failed, amount, merchant, order_number once paid"
        }
    },
    "auth": "none for agents (rate-limited per address, store and buyer); the merchant must have switched agent payments on for their store",
    "limits": {
        "per_link": "up to the store's own maximum (default 500.00 in its currency)",
        "per_address": "20 links per hour",
        "per_store": "60 links per hour"
    },
    "flow": [
        "1. POST with preview:true to check the store is ready and see the quote.",
        "2. POST again without preview to get checkout_url (single use, expires in 24 hours).",
        "3. Give checkout_url to the human; they pay on Stripe's hosted page.",
        "4. GET status_url until status is paid; the merchant then has a normal order."
    ],
    "errors": [
        "store_not_found",
        "agent_payments_off",
        "stripe_not_ready",
        "stripe_not_connected",
        "item_not_found",
        "variant_required",
        "product_unavailable",
        "out_of_stock",
        "no_shipping_rates",
        "amount_too_small",
        "amount_too_large",
        "rate_limited",
        "store_busy"
    ]
}