ShopAll · Developers
ShopAll API
Read a store's products, orders and customers, create orders from other channels and move them through their statuses. Get told the moment something happens with signed webhooks.
Getting started
- The store owner opens the API keys screen in ShopAll (type “API keys” in the search) and creates a key with only the scopes you need. Two-step login must be on.
- The key (
sk_…) is shown once. Keep it on your server; never put it in a website or app. - Call the API over HTTPS with the key in the
Authorizationheader.
curl https://shopallapp.com/api/v2/open/products?limit=50 \
-H "Authorization: Bearer sk_live_..."
Authentication, scopes and limits
Every request needs Authorization: Bearer sk_…. Cookies and sessions are never used by this API. A key belongs to one store and can only see that store.
Scopes (a key gets exactly the ones ticked when it was made; a write scope does not include the read scope of the same area). Every endpoint checks its scope on every call and answers 403 insufficient_scope without it:
read_products: read products, their options and stockwrite_products: change product details and prices (not stock, not cost)read_orders: read orderswrite_orders: create orders and move them through their statusesread_customers: read customerswrite_fulfillment:
Managing keys
- The full key is shown once, when it is created or rotated. ShopAll keeps only a hash; the key screen shows the first characters, the scopes, the number of calls and when it was last used.
- Rotate gives the key a new secret with the same name and scopes. The old secret stops working immediately, so install the new one first where you can, or rotate during a quiet moment.
- Edit changes the key's name or scopes; the change applies to the next call. Revoke stops the key for good.
- Creating, rotating, editing and revoking keys need the store owner with two-step login on. Changes made with a key appear in the store's activity log under the key's name.
Rate limit: 120 requests per minute per key. Over the limit you get 429 with Retry-After. Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (unix time a slot frees up).
Lists return {"data": [...], "next": <id or null>}. Pass ?cursor=<next>&limit=50 (up to 100) for the next page; ?after= still works. Cursors are stable: new rows never shift a page. Money is in minor units (piasters, cents) as integers.
Endpoints
| Method | Path | Scope | What it does |
|---|---|---|---|
GET | /api/v2/open/store | any | The store this key belongs to: id, name, address slug, city, currency and the key's scopes. |
GET | /api/v2/open/app | any | |
POST | /api/v2/open/app/usage | any | |
POST | /api/v2/open/app/usage/{id}/reverse | any | |
GET | /api/v2/open/products | read_products | Products, oldest first. Filters: status (active, draft, archived), q (name contains), sku. Paginated. |
GET | /api/v2/open/products/{id} | read_products | One product with its options (variants), prices in minor units and stock. |
PATCH | /api/v2/open/products/{id} | write_products | Change a product's name, description, sku, status (active, archived), price_minor or sale_price_minor (null removes the sale). Stock and cost are not changed through the API. Any other field is refused with 422. |
GET | /api/v2/open/orders | read_orders | Orders, oldest first. Filters: status, since (YYYY-MM-DD). Paginated. |
GET | /api/v2/open/orders/{number} | read_orders | One order by its number, with items, totals, delivery and status. |
POST | /api/v2/open/orders | write_orders | Create an order (for example from another sales channel). Stock is taken exactly like a website order. |
POST | /api/v2/open/orders/{number}/status | write_orders | Move an order to a new status (confirmed, preparing, shipped, delivered, cancelled). |
GET | /api/v2/open/customers | read_customers | Customers with their order count and total spent. Paginated. |
GET | /api/v2/open/customers/{id} | read_customers | One customer. |
POST | /api/v2/open/orders/{number}/fulfillment | write_fulfillment |
Webhooks
The store owner adds your HTTPS address on the Webhooks screen and chooses events:
order.createdorder.paidorder.statusorder.refundproduct.updatedstock.loworder.fulfilledmoney_approval.requestedmoney_approval.decidedteam.task.assignedteam.access_changed
Each delivery is a POST with a JSON body (id, event, created_at, store_id, data) and these headers:
X-ShopAll-Event: the event name (pingfor a test event)X-ShopAll-Delivery: the delivery id. A redelivery gets a new delivery id but the same bodyid: use the bodyidto ignore duplicates.X-ShopAll-Timestamp: unix time of this attemptX-ShopAll-Signature: t=<unix time>,v1=<hex>, where v1 is HMAC-SHA256 of"<t>." + raw bodywith the webhook's signing secret.
Checking the signature
Compute the HMAC over the raw request body (before any JSON parsing), compare in constant time, and reject a t more than 5 minutes away from your clock: that is the replay window. Accept the delivery if any v1 matches.
Python
import hmac, hashlib, time
TOLERANCE = 300 # seconds; reject older (replayed) deliveries
def verify(secret: str, header: str, raw_body: bytes) -> bool:
pairs = [p.split("=", 1) for p in header.split(",") if "=" in p] # "t=1730800000,v1=ab12...[,v1=cd34...]"
t = next((v for k, v in pairs if k == "t"), "")
if not t.isdigit() or abs(time.time() - int(t)) > TOLERANCE:
return False
want = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(want, v) for k, v in pairs if k == "v1")Node.js
const crypto = require("crypto");
const TOLERANCE = 300; // seconds
function verify(secret, header, rawBody) {
const pairs = header.split(",").map(x => [x.slice(0, x.indexOf("=")), x.slice(x.indexOf("=") + 1)]);
const t = (pairs.find(([k]) => k === "t") || [])[1] || "";
if (!/^\d+$/.test(t) || Math.abs(Date.now() / 1000 - Number(t)) > TOLERANCE) return false;
const want = Buffer.from(crypto.createHmac("sha256", secret).update(t + ".").update(rawBody).digest("hex"));
return pairs.some(([k, v]) => k === "v1" && v.length === want.length && crypto.timingSafeEqual(want, Buffer.from(v)));
}
Rotating the secret
The owner can rotate the signing secret at any time. For the overlap they choose (default 24 hours, up to 72), every delivery carries two v1 values: one signed with the new secret and one with the old. Install the new secret on your server during that window; after it, only the new secret signs.
Retries, dead letters and switching off
Answer with any 2xx within 8 seconds; redirects are not followed. A failed attempt is retried 5 more times after 1 min, 5 min, 30 min, 2 h, 6 h. After the last attempt the delivery becomes a dead letter: it stays in the owner's delivery log (event, HTTP status, time taken, attempt, next retry) and can be redelivered one by one or all at once.
If 5 deliveries in a row end as dead letters, ShopAll switches the endpoint off and tells the owner (in their ShopAll inbox, and by email when email is set up). Nothing is sent to it until the owner turns it back on.
Allowed addresses
Only https:// addresses on ports 80 or 443, without a user name or password in the address, that resolve to public internet addresses. Private, loopback, link-local and internal names are refused when the webhook is saved and checked again at every delivery; ShopAll connects to the address it checked.
Testing
The Send test event button on the Webhooks screen sends a signed ping once (test events are never retried) and shows the HTTP status and time taken.
Errors
Errors are JSON: {"error": {"code": "…", "message": "…"}}.
401 unauthorized: missing, wrong or revoked key403 insufficient_scope: the key lacks the scope;403 store_inactive: the store is paused404 not_found422 validation_error: a field is wrong (the message says which)429 rate_limited(seeRetry-After)5xx: retry later with backoff
Versions
This is version 2 (/api/v2/open/…). Fields may be added at any time; nothing is removed or renamed within v2. A breaking change would come as /api/v3, announced at least 6 months ahead on this page.
Building an app for many stores?
Use OAuth for apps: each store owner approves your app once on a ShopAll consent screen, and you get a token for that store only. Or join the ShopAll partner programme. You never ask for a password.