Storefront API
Storefront API
Public, read-only store data and server price quotes, for building a store's front end anywhere.
The Storefront API gives you a store's public catalogue — products, search, filters, collections, pages, reviews, offers and delivery prices — and prices a cart exactly as an order would. Use it to build a headless website, a mobile app, a product feed, or interactive sections inside the store's own pages.
It is a different API from the Ordexs API (api.ordexs.com/v1):
| Storefront API | Ordexs API | |
|---|---|---|
| Reads | What the store's pages already show anyone | Orders, customers, stock, money |
| Writes | Nothing (a price quote stores nothing) | Orders, products, shipments… |
| Credential | A public Storefront API token | A secret API key |
| Where it can run | Browsers, mobile apps, servers | Servers only |
The full contract is published as an OpenAPI 3.1 file.
Two addresses, one API
| Address | Token | For |
|---|---|---|
https://api.ordexs.com/storefront/v1/<store>/… | Required | Your website, app or server |
https://<store>.myordexs.com/api/storefront/v1/… | Not needed | The store's own pages and scripts (also on the store's custom domain) |
<store> is the store's handle — the first part of its address https://<store>.myordexs.com. Both addresses answer with the same data.
Get a token
The store creates tokens in the dashboard under Settings → Developers → Storefront API → New token. A token looks like ordx_sf_ followed by 32 letters and digits.
A token is a public identifier, not a secret. It reads only what anyone can already see on the store, so it is safe in browser JavaScript and in a mobile app. It lets the store see who is calling, limit them, and cut them off by revoking it.
Each token says which websites may use it from a browser:
- Listed websites — only pages on those origins (for example
https://shop.example.com) can call with it from a browser. Leave the list empty to use the token only from servers and mobile apps. - Any website — any page can use it.
Calls from a server or an app send no Origin header and are not affected by the list.
Send the token
Send it in the X-Ordexs-Storefront-Token header:
curl https://api.ordexs.com/storefront/v1/atelier-nour/products?limit=2 \
-H "X-Ordexs-Storefront-Token: ordx_sf_…"const res = await fetch('https://api.ordexs.com/storefront/v1/atelier-nour/products?limit=2', {
headers: { 'X-Ordexs-Storefront-Token': 'ordx_sf_…' },
})
const { data } = await res.json()A token in the query string (?access_token=…) is refused: addresses end up in logs and in other websites' Referer headers. The header also makes the browser ask first (a CORS preflight), which is what lets the website list work.
Money, ids and lists
- Money is always
{ "amount": "4500.00", "currency": "DZD" }: a decimal string with the currency's own decimals (/store→currency.decimals). Never do arithmetic on floats; the price quote does the maths for you. - Ids are plain UUIDs. Wherever you send an id, the Ordexs API's public form of the same row is accepted too (
prod_…,var_…,ofr_…), so you never have to convert between the two APIs. - Lists are
{ "object": "list", "data": [...], "has_more": true, "next_cursor": "…" }. Passnext_cursorback ascursorfor the next page. - Paths in answers (
/products/linen-dress) are relative to the store's address.
Caching and limits
Every GET is cached at the edge and refreshed within about 20 seconds of the merchant changing something (two minutes at most). You can cache answers on your side too; nothing in them is personal.
| Limit | Value |
|---|---|
| Reads per visitor IP | 180 per minute |
| Price quotes per visitor IP | 60 per minute |
| Requests per token | 3,000 per minute |
| Uncached requests per store (all tokens together) | 600 per minute |
| Page size | 100 products, 50 reviews |
Identical requests are served from the cache and don't count towards the store's uncached limit, so a busy website isn't throttled by repeat views. When you hit a limit you get 429 with a Retry-After header.
Errors
Errors look like the Ordexs API's: a stable code and a plain-English message. On api.ordexs.com they also carry a request_id (and a request-id header) to quote to support.
{ "error": { "code": "origin_not_allowed", "message": "This token may not be used from https://other.example. Add that website to the token under Settings → Developers → Storefront API, or call from your server.", "request_id": "req_…" } }| Code | HTTP | Meaning |
|---|---|---|
authentication_required | 401 | No token in the header. |
invalid_token | 401 | Not a token, or no such token. |
token_revoked | 401 | The store revoked this token. |
token_in_query | 400 | The token was sent in the address; send it in the header. |
wrong_store | 403 | The token belongs to another store. The message names it. |
origin_not_allowed | 403 | This website isn't on the token's list. |
store_suspended | 403 | The store is suspended. |
not_found | 404 | No such product, collection, page, policy or endpoint. |
invalid_request | 400 | A parameter or body is not valid; the message says which. |
invalid_sort | 400 | sort=relevance without q, or sort=collection without collection. |
variant_unknown, insufficient_stock, region_unknown, delivery_unavailable, store_closed | 422 | A price quote can't be made as asked; the message says why. Stock errors never reveal a number. |
rate_limited | 429 | Slow down; see Retry-After. |
Next
- Reference — every endpoint, with examples.
- Build a headless store — a complete front end on the Storefront API.
- Live data in an AI store —
window.Ordexs.storefrontinside the store's own pages.
