Developer docs / Integrations
Store APIs
Read and change a store from your own software: the owner API, the dash API and their reference.
The APIs
| API | For | Where |
|---|---|---|
| Store owner API | Products, variants, stock, orders, customers, content and settings of one store | https://<store>/api/owner/... |
| Dash API | Stores, domains, upgrades, and the store owner API relayed for a signed-in owner or a store agent | https://dash.commernauts.com/api/v1/... |
| Content API | A store's published content as data, for apps and other sites; public, no sign-in | https://<store>/api/content/... |
The API reference lists every route with its permission, body and answers. It is generated from the code, so it is always current.
Signing in
- Store owners sign in through Commernauts and get a bearer token for their stores.
- Store agents are API keys for software acting on a store. Each has the permissions the owner grants, such as orders.read or products.write, and no more.
- Every owner API route names the permission it needs.
The content API
Published pages, product copy and entries as JSON: typed fields and sections, with references and shared sections resolved, never HTML. Reads are public and allow any origin. ?locale= (a language the store offers) and ?variant= work as on the storefront.
| Route | Answers |
|---|---|
| GET /api/content/page?path=/about | The page at a path (home: path=/) |
| GET /api/content/collection/:slug | A collection page, and the collection page template's sections around it |
| GET /api/content/product/:slug | A product's published copy, and the product page template's sections |
| GET /api/content/entry/:id | Any published entry, such as a shared section or a button style |
| GET /api/content/chrome | Header links, logo and footer |
| GET /api/content/entries | Published entries as plain data, queried (below) |
| GET /api/content/types | The content model: every type with its fields |
| GET /api/content/locales | The default language and every one the store offers |
In the dashboard, an entry's API tab shows its address and the answer.
Querying entries
Why: a headless site lists and finds content (a blog, the newest five news items, every post by one author) without knowing ids, and draws it itself. How: GET /api/content/entries answers published entries as plain data, never drawn: field values as stored, references as entry ids, sections as nested data. Answers carry an ETag; send it back in If-None-Match and an unchanged answer is a 304 with no body.
| Parameter | What it does |
|---|---|
| content_type=post,news | Only these content types (keys, up to 50) |
| fields.<key>=value | Field equals the value; for a list field (tags, multiple references), contains it |
| fields.<key>[op]=value | op is ne, in, nin (comma lists), exists (true or false), lt, lte, gt, gte (numbers or text), match (every word appears in the value) |
| sys.id, path, title, tags, terms | Filter like fields, e.g. tags[in]=guide,news or sys.id[in]=a,b |
| query=cold brew | Every word appears in the title, path or any field |
| order=-fields.rating,title | Up to 3 keys: sys.created_at, sys.updated_at, sys.published_at, path, title, fields.<key>; - sorts descending. Default -sys.updated_at |
| select=title,fields.headline | Only these keys besides sys (path, title, tags, terms, fields, fields.<key>) |
| include=2 | Levels of referenced entries to add under includes.entries, 0 to 10 (default 1) |
| locale=de | A language the store offers, with its fallback chain; locale=* answers every language side by side |
| limit=100&skip=200 | A page: limit 1 to 1000 (default 100); the answer says total |
| links_to_entry=<id> | Only entries that reference this entry (a reference field or a shared section) |
An unknown parameter answers 400, so a typo never looks like an empty result.
GET https://<store>/api/content/entries?content_type=post&order=-sys.published_at&limit=5
{
"items": [{
"sys": { "id": "ce_...", "type": "post", "created_at": 1763400000, "updated_at": 1763450000, "published_at": 1763450000, "locale": "en" },
"path": "/journal/cold-brew",
"title": "Cold brew",
"tags": ["guide"],
"terms": [],
"fields": {
"headline": "Cold brew",
"author": "ce_ada...",
"cover": { "src": "https://<store>/images/brew.jpg", "alt": "A glass" },
"sections": [{ "sys": { "id": "cb_...", "type": "rich_text" }, "fields": { "body": "..." } }]
}
}],
"includes": { "entries": [{ "sys": { "id": "ce_ada...", "type": "author" }, "title": "Ada", "fields": { "name": "Ada" } }] },
"total": 12, "skip": 0, "limit": 5
}Media src paths are absolute on the store's address. A shared section names its entry in sys.ref; its content comes with include.
The preview API
Why: a site's preview mode shows drafts and saved changes before they go live, and drafts must stay private. How: /api/preview/content/entries, /types and /locales answer the same queries over the saved working copies, drafts included and archived entries left out, and only with a preview key.
- Owners make and revoke keys in the CMS under API, Preview keys (or POST and DELETE /api/owner/content/preview-keys). The key is shown once; the store keeps only its hash.
- Send it as Authorization: Bearer <key>. Browsers on other sites may call it (CORS allows any origin; the preflight allows Authorization).
- Answers are Cache-Control: private, no-store, so no shared cache keeps a draft.
- A revoked key answers 401 at once.
Bulk import and export
Products can be imported and exported in bulk: large jobs run in the background and are read back from the bulk jobs routes. The dashboard's Import uses the same API.
Importing content
Why: moving a site in, copying content between apps or keeping pages in step with files took one call per entry, and the site was rebuilt after each one. How: POST /api/owner/content/import takes a whole bundle of content types and entries, checks all of it, writes it in a few database batches and rebuilds the site once. GET /api/owner/content/export?format=bundle gives the same shape, so an export imports back as it is.
POST https://<store>/api/owner/content/import
{
"mode": "upsert",
"publish": true,
"types": [{ "key": "faq", "label": "FAQ", "fields": [{ "key": "question", "label": "Question", "type": "short-text", "required": true }] }],
"entries": [
{ "key": "section:help", "type": "doc_section", "title": "Help", "values": { "name": "Help" } },
{ "key": "/help/returns", "type": "doc_page", "path": "/help/returns", "title": "Returns",
"values": { "headline": "Returns", "body": { "paragraphs": ["30 days."] } },
"refs": { "section": "section:help" } }
]
}| Rule | What happens |
|---|---|
| Checked first | Every type, field, value, section, path and reference is checked before anything is written. A bundle with problems answers 400 bad_import with every problem in error.fields, and nothing is written. |
| Keys | Each entry has your key. Later imports find the entry by it; a new key matches an entry named by id, an entry whose id is the key, or the entry at the same path, else a new entry is made. |
| References | refs names entries by key, so entries in one bundle can point at each other. A key may also be the id of an entry already in the app. |
| Edits win | An entry edited in the CMS after the import that wrote it is skipped and reported, never overwritten. Edited means its content is no longer what the import left: a save the system makes (a publish, a translation) does not count. For a key the app has no record of, since (epoch seconds) skips an entry saved after it. An entry whose content did not change is not written again. |
| mode | upsert (default) creates and updates; create-missing only creates and keeps every existing entry. |
| publish | true publishes every entry that does not say publish: false itself. Publishing a page for staff only, or an entry whose type needs review, is a problem the check reports; import those with publish: false. |
| dry_run=1 | Checks the bundle and answers what each entry would do, writing nothing. |
| Limit | Value |
|---|---|
| Bundle size | 8 MiB |
| Entries per bundle | 5000 |
| Types per bundle | 500 |
| Answered in the request | Up to 100 entries (200, with the report) |
| Larger bundles | 202 with the import's id; it runs in the background, 50 entries a step. Follow GET /api/owner/content/import/:id until status is done or failed. |
Permissions: cms.entries.write; a bundle with types also needs cms.types.write, and one that publishes needs cms.publish. In the CMS, Entries has Import: choose a bundle file, see what each entry would do, import it and follow its progress; Export all content downloads the bundle.