The REST API lives under /api/ext. Interactive reference documentation is at /docs/api, and a machine-readable OpenAPI description is at /api/openapi.json. Every request needs a key and is limited to that key's site.
Endpoints
| Request | Scope | Purpose |
|---|---|---|
GET /api/ext/collections | collections:read | Collections and their fields |
GET /api/ext/entities?collection=ID | entities:read | Entries; limit (up to 200) and offset |
POST /api/ext/entities | entities:write | Create an entry |
GET /api/ext/orders | orders:read | Orders; limit up to 200 |
POST /api/ext/orders | orders:write | Create a draft order |
PUT /api/ext/orders | orders:write | Set status: paid, cancelled or refunded |
GET /api/ext/pages | pages:read | Pages |
GET /api/ext/customers | customers:read | Customers; limit up to 500 |
POST /api/ext/customers | customers:write | Import customers from CSV |
GET /api/ext/webhook-events | webhooks:read | Event catalogue |
Create an entry
Send the collection id as collection (the older col still works, here and in the query string). Only fields the collection defines are kept, and its title field is required. An entry is published unless you send "status": "draft". A published entry must pass the collection's field rules.
curl -sS -X POST https://xigzag.com/api/ext/entities \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"collection":"products","status":"draft","data":{"name":"Sample product","price":24}}'The collection and field names above are examples. Read /api/ext/collections first to learn your own.
Create an order
Amounts are in the currency's smallest unit (cents for dollars). At least one line with a label is required. Send the buyer as customer (top-level name and email still work).
curl -sS -X POST https://xigzag.com/api/ext/orders \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"customer":{"name":"Ana Example","email":"ana@example.com"},"lines":[{"label":"Gift box","amount":2500,"qty":1}]}'Errors and limits
401: the key is missing or invalid.403: the key lacks the required scope.404: unknown collection, order or endpoint.422: a published entry broke a field rule; the response lists each field.429: more than 120 requests in a minute for one key. Wait and retry.
A read-only GraphQL endpoint is also available at /api/graphql. It uses the same keys and needs collections:read. A GET returns the schema; to query, POST a JSON body with a query field.
