API Documentation

E-commerce REST API

Nine endpoints, one isolated sandbox. Product prices use integer cents. Cart items do not reserve stock; checkout checks stock again and reduces only your sandbox inventory.

Open PlaygroundOpenAPI 3.0 JSON
No account, payment or personal details are needed. State expires after one hour of inactivity. Reset removes your cart and demo orders and restores your stock.

Try a real request

These read-only examples use your current sandbox and show the actual HTTP response.

The JSON response will appear here.

Session and mutation requests

Keep the ecommerce_demo HttpOnly cookie. Read X-CSRF-Token from GET /cart and send it as a header for POST, PATCH and DELETE. Write requests require the same origin. JSON bodies are limited to 8 KB and must use Content-Type: application/json.

POST /orders also needs Idempotency-Key. Repeating the same key and payload returns the original order without reducing stock again. Reusing the key with a different payload returns 409. A reset clears these keys with your orders.

GET /api/demo/v1/products

List, filter and sort products.

pagePositive page number (1–100).
per_pageItems per page (1–12, default 6).
qSearch name and description, up to 80 characters.
categoryaccessories, electronics or workspace.
in_stocktrue or false.
sortname_asc, price_asc or price_desc.

GET /api/demo/v1/products/{id}

Get a product and its offers.

GET /api/demo/v1/cart

Get your current cart and CSRF header.

POST /api/demo/v1/cart/items

Add an offer or merge its quantity.

{
  "product_id": 1,
  "variant_id": 11,
  "quantity": 1
}

PATCH /api/demo/v1/cart/items/{id}

Set an existing cart item’s quantity.

{
  "quantity": 2
}

DELETE /api/demo/v1/cart/items/{id}

Remove an existing cart item.

POST /api/demo/v1/orders

Create an isolated demo order.

{
  "delivery_method": "demo_pickup",
  "demo_acknowledged": true
}

GET /api/demo/v1/orders/{id}

Get an order from your sandbox.

POST /api/demo/v1/reset

Restore your stock, cart and orders.

{}

Errors and limits

400: malformed JSON · 403: CSRF/origin · 404: missing resource · 405: wrong method · 409: stock/cart/idempotency conflict · 413: payload size · 415: content type · 422: validation · 429: rate limit · 503: temporary storage error.

Quantities are integers from 1 to 20. A sandbox holds at most 20 orders. There are at most 1,000 active sandboxes. Limits are 120 requests per minute per sandbox and 300 per server-observed IP. Rate-limited responses include Retry-After: 60.

{
  "error": {
    "code": "insufficient_stock",
    "message": "Not enough stock for this variant.",
    "details": { "available_stock": 0, "cart_quantity": 0 }
  }
}

No arbitrary SQL, file uploads, customer credentials or external business-system connections are accepted.