Version v1
API reference
All endpoints are read-only, return JSON, and live under /api/public/v1.
Authentication
Send your key in the x-api-key header on every request. A Bearer authorization header works too.
curl -H "x-api-key: ce_live_..." \ "https://pineapple-inventory.changeenginepreviewer.com/api/public/v1/orders"
Missing key → 401. Revoked key or a key without access to that dataset → 403.
Access & rate limits
Every key is issued with an explicit access list — orders, inventory, or both. Calling an endpoint outside that list returns 403 insufficient_scope.
Keys also carry a per-minute request allowance (60/min by default). Once exceeded, requests return 429 rate_limit_exceeded with retry-after, x-ratelimit-limit and x-ratelimit-remaining headers. The window resets at the top of each minute.
GET /orders
Returns orders newest first. All filters are optional and combine with AND.
| Parameter | Description |
|---|---|
| employee_email | Exact employee email (case-insensitive) |
| sku | Only orders containing this item SKU |
| status | placed · confirmed · shipped · delivered |
| start_date | ISO date — orders placed on or after |
| end_date | ISO date — orders placed on or before |
| limit / offset | Page size (max 500, default 100) and offset |
{
"data": [
{
"order_id": "ord_10241",
"order_number": "SO-10241",
"employee_name": "Dana Whitfield",
"employee_email": "dana@acme.com",
"order_date": "2026-07-14T15:22:00.000Z",
"mailing_address": "812 Rowan St, Austin, TX 78702",
"status": "shipped",
"tracking_number": "1Z999AA10123456784",
"items": [
{ "sku": "TS-BLK", "item_name": "Black Tee", "quantity": 2, "size": "L" }
]
}
],
"meta": { "count": 1, "total": 12, "limit": 100, "offset": 0 }
}GET /orders/{order_id}
Returns a single order in the same shape, or a 404 error object.
curl -H "x-api-key: ce_live_..." "https://pineapple-inventory.changeenginepreviewer.com/api/public/v1/orders/ord_10241"
GET /inventory
Returns every SKU with per-size availability. Add ?format=flat for one row per SKU+size instead of the nested shape.
{
"data": [
{
"sku": "TS-BLK",
"item_name": "Black Tee",
"total_quantity_available": 42,
"total_quantity_used": 18,
"sizes": [
{ "size": "S", "quantity_available": 10, "quantity_used": 4 },
{ "size": "M", "quantity_available": 14, "quantity_used": 7 }
]
}
],
"meta": { "count": 1 }
}GET /health
Unauthenticated. Reports service status and the last successful data sync.
Errors
{ "error": { "code": "invalid_api_key", "message": "The provided API key is not recognised." } }Codes: missing_api_key (401), invalid_api_key (401), revoked_api_key (403), insufficient_scope (403), rate_limit_exceeded (429), not_found (404), server_error (500).