Start free

Help center / Developers and AI agents

REST API

Read collections, pages, customers and orders, and push entries and orders into a site over HTTPS.

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

RequestScopePurpose
GET /api/ext/collectionscollections:readCollections and their fields
GET /api/ext/entities?collection=IDentities:readEntries; limit (up to 200) and offset
POST /api/ext/entitiesentities:writeCreate an entry
GET /api/ext/ordersorders:readOrders; limit up to 200
POST /api/ext/ordersorders:writeCreate a draft order
PUT /api/ext/ordersorders:writeSet status: paid, cancelled or refunded
GET /api/ext/pagespages:readPages
GET /api/ext/customerscustomers:readCustomers; limit up to 500
POST /api/ext/customerscustomers:writeImport customers from CSV
GET /api/ext/webhook-eventswebhooks:readEvent 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}]}'
Important
Changing an order's status through the API should not be used as a refund: it does not return money. Make refunds in the Studio from the order itself.

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.

Related articles

Still need help?
Open a support ticket or write to hello@xigzag.com.