menu_bookDeveloper Docs

API Reference

Everything you need to integrate CheckoutNow into your AI agent, storefront, or custom application.

Base URLhttps://api.checkoutnow.com
key

Authentication

All requests require a Bearer token in the Authorization header.

Authorization: Bearer cn_live_your_api_key_here

Generate API keys from your dashboard. Keep your secret key safe — never expose it in client-side code.

Endpoints

POST/v1/checkout/intent

Create a new checkout intent for an AI agent to complete a purchase.

Request Body

{
  "agent_id": "claude-3-opus",
  "product_sku": "CK-9921",
  "context": {
    "intent": "purchase_gift",
    "delivery": "express"
  }
}

Response

{
  "status": "ready",
  "checkout_url": "https://pay.checkoutnow.com/...",
  "expires_at": "2024-12-01T12:00:00Z"
}
GET/v1/products/search

Semantic product search optimized for AI agent queries.

Request

// Query parameters
?q=minimalist+wooden+desk+organizer
&limit=5
&in_stock=true

Response

{
  "results": [
    {
      "sku": "CK-9921",
      "name": "Artisan Walnut Dock",
      "price": 129.00,
      "currency": "USD",
      "in_stock": true
    }
  ],
  "total": 1
}
GET/v1/orders/{order_id}

Retrieve order status and details for agent-initiated purchases.

Request

// Path parameter
/v1/orders/ord_a1b2c3d4

Response

{
  "id": "ord_a1b2c3d4",
  "status": "confirmed",
  "total": 129.00,
  "items": [
    { "sku": "CK-9921", "qty": 1 }
  ],
  "tracking_url": "https://..."
}
POST/v1/catalog/sync

Trigger a manual catalog sync from your connected store.

Request Body

{
  "source": "shopify",
  "full_sync": false
}

Response

{
  "sync_id": "sync_x9y8z7",
  "status": "in_progress",
  "products_queued": 342
}

Quick Start

Get up and running in your language of choice.

javascriptJavaScript
import { CheckoutNow } from '@checkoutnow/sdk';

const cn = new CheckoutNow({
  apiKey: process.env.CN_API_KEY
});

const intent = await cn.checkout.create({
  agentId: 'claude-3-opus',
  productSku: 'CK-9921',
  context: { intent: 'purchase_gift' }
});

console.log(intent.checkoutUrl);
codePython
from checkoutnow import CheckoutNow

cn = CheckoutNow(api_key=os.environ["CN_API_KEY"])

intent = cn.checkout.create(
    agent_id="claude-3-opus",
    product_sku="CK-9921",
    context={"intent": "purchase_gift"}
)

print(intent.checkout_url)
terminalcURL
curl -X POST https://api.checkoutnow.com/v1/checkout/intent \
  -H "Authorization: Bearer $CN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "claude-3-opus",
    "product_sku": "CK-9921",
    "context": { "intent": "purchase_gift" }
  }'

Ready to integrate?

Create your free account and get an API key in under a minute.