Ordexs API v1 Get an API key

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 APIOrdexs API
ReadsWhat the store's pages already show anyoneOrders, customers, stock, money
WritesNothing (a price quote stores nothing)Orders, products, shipments…
CredentialA public Storefront API tokenA secret API key
Where it can runBrowsers, mobile apps, serversServers only

The full contract is published as an OpenAPI 3.1 file.

Two addresses, one API

AddressTokenFor
https://api.ordexs.com/storefront/v1/<store>/…RequiredYour website, app or server
https://<store>.myordexs.com/api/storefront/v1/…Not neededThe 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": "…" }. Pass next_cursor back as cursor for 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.

LimitValue
Reads per visitor IP180 per minute
Price quotes per visitor IP60 per minute
Requests per token3,000 per minute
Uncached requests per store (all tokens together)600 per minute
Page size100 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_…" } }
CodeHTTPMeaning
authentication_required401No token in the header.
invalid_token401Not a token, or no such token.
token_revoked401The store revoked this token.
token_in_query400The token was sent in the address; send it in the header.
wrong_store403The token belongs to another store. The message names it.
origin_not_allowed403This website isn't on the token's list.
store_suspended403The store is suspended.
not_found404No such product, collection, page, policy or endpoint.
invalid_request400A parameter or body is not valid; the message says which.
invalid_sort400sort=relevance without q, or sort=collection without collection.
variant_unknown, insufficient_stock, region_unknown, delivery_unavailable, store_closed422A price quote can't be made as asked; the message says why. Stock errors never reveal a number.
rate_limited429Slow down; see Retry-After.

Next