v1
Akkad API
Connect your own website or system to your store: read its products, stock, categories and orders, and place orders in it.
Stable. /v1 only grows: no field, route or value is ever removed or renamed, so your integration keeps working. A change that could break it would come as a new version.
Base URLhttps://api.akkad.io/v1
Your first request
Works with any key. Use it to check a key, and to read the currency every amount is in.
curl https://api.akkad.io/v1/store \
-H "Authorization: Bearer akk_live_..."{
"id": "3f2a9c1e-…",
"name": "…",
"currency": "IQD",
"timezone": "Asia/Baghdad",
"scopes": [
"items.read",
"orders.read"
]
}Reference
- Store1 endpointThe store a key belongs to: its name, currency and timezone.
- Items2 endpointsProducts with their variants, prices, photos and stock.
- Categories2 endpointsThe store's categories and subcategories.
- Brands2 endpointsThe store's brands.
- Orders4 endpointsOrders from every channel, with their lines and recipient.
- Customers2 endpointsThe store's saved customers.
- Shipping2 endpointsThe delivery company's cities and zones, for orders.
Keys
The store owner makes a key in the web admin: Settings → API keys. The API comes with the Pro plan and above. A key is shown once. Send it on every request:
Authorization: Bearer akk_live_...Call the API from your server only. A key in a web page can be read by anyone, so a request sent by a browser is refused (403 browser_not_allowed).
A key belongs to one store, so no request carries a store id. Each key has scopes — what it may do. A request outside them gets 403 missing_scope.
| Scope | Gives |
|---|---|
items.read | items, variants, categories, brands |
items.cost | the cost field on items and variants |
orders.read | orders, with the recipient's details |
orders.write | quote and place orders (includes orders.read) |
customers.read | the customers list |
Lists
Lists are newest first and come in pages:
GET /v1/orders?limit=50
→ {"data": [...], "next_cursor": "..."}
GET /v1/orders?limit=50&cursor=...next_cursor: null means the last page. limit is 1–100 (default 50).
To keep another system in step, call a list with updated_since set to the time your last run STARTED, minus a few minutes. A change is saved a moment before it becomes visible, and your clock and ours differ — the overlap makes sure nothing slips between two runs. A row may come twice; keep the newest by updated_at.
Deleted items and orders never show up in updated_since — they are simply gone. If your system keeps a copy, read the whole list again now and then (once a day is enough) and drop what is no longer there.
Placing an order
The store prices every order itself: each line at the item's price in the store, delivery by the store's own rules for the city, its offers and the promo code. Your site never sends prices.
1. GET /v1/shipping/cities. When it says zones_required, the store delivers with a company that works by zones: your checkout lets the shopper pick the city from that list and the zone from GET /v1/shipping/cities/{city_id}/regions, and your order sends both ids. They are stored exactly as you send them — Akkad never guesses, checks or corrects them: a wrong zone is refused by the delivery company or delivered to the wrong place. An order without them waits for the store to pick the zone by hand. 2. On your checkout page, POST /v1/orders/quote with the lines and the city (and its city_id). Show the shopper its total. 3. POST /v1/orders with the same lines, the recipient, expected_total (that total) and an Idempotency-Key header you make for this order. A different total is refused with 409 total_changed and the right one. 4. Send payment_status: paid when your site already took the money, unpaid for cash on delivery. The order arrives pending (the store confirms it) or processing (confirmed, stock taken at once). Either way it is refused with insufficient_stock when an item is short, unless the item takes pre-orders.
Sending the same Idempotency-Key again answers with the first order, never a second one — so retrying after a lost answer is always safe. A key belongs to ONE order: use your own order id, never a cart id that is used again (a second order with the same key gets the first order back, not a new one).
Webhooks
Instead of asking what changed, let the store tell your site. The owner adds your https address in the web admin (Settings → Webhooks; one per store), picks the events and copies the signing secret (whsec_..., shown once).
| Event | When |
|---|---|
order.created | an order is placed, from any channel |
order.updated | an order changes: status, delivery, notes, lines |
item.updated | a product's price or stock changes |
We POST JSON within about half a minute: {"id", "event", "created_at", "store_id", "data"} — data is the order or item exactly as GET /v1/orders/{id} / GET /v1/items/{id} returns it now.
Check every message before trusting it: compute HMAC-SHA256 of X-Akkad-Timestamp + "." + the raw body with your secret; it must equal the hex after v1= in X-Akkad-Signature. Compare with a constant-time function (hmac.compare_digest in Python, crypto.timingSafeEqual in Node, hash_equals in PHP), and refuse a timestamp more than 5 minutes away from your clock — an old message sent again is then refused too.
Answer any 2xx quickly. Anything else is retried after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h; after a whole day without one delivered message the webhook switches off and the owner is emailed. Messages are hints: one may come twice or out of order, and deletions are not sent — use updated_since (and a full read now and then, see Lists) to stay exact.
Formats
- Times are ISO 8601 in UTC:
2026-01-31T10:00:00Z. - Money is a number in the store's currency (
GET /v1/store). - Ids are strings.
Errors
{"error": {"code": "order_not_found", "message": "No order with this id.", "request_id": "..."}}Branch on code; message is for a person. 422 validation_failed adds fields naming what is wrong.
| Status | Code | Meaning |
|---|---|---|
| 400 | insufficient_stock | not enough stock for the order |
| 401 | invalid_api_key | no key, or it is wrong, revoked or expired |
| 402 | subscription_inactive | the store's subscription lapsed |
| 403 | browser_not_allowed | the request came from a web page |
| 403 | plan_not_included | the store's plan does not include the API |
| 403 | missing_scope | the key lacks the scope |
| 403 | order_limit_reached | the store used this month's orders on its plan |
| 403 | order_refused | the store does not take orders from this customer |
| 404 | ..._not_found | no such thing in this store |
| 409 | total_changed | the store's total is not your expected_total |
| 409 | idempotency_key_conflict | the Idempotency-Key is taken in this store; send a new one |
| 422 | validation_failed | a parameter is not valid |
| 422 | promo_code_invalid | the promo code does not apply |
| 422 | digital_not_supported | digital items cannot be ordered through the API yet |
| 429 | rate_limited | too many requests, or too many wrong keys from one address |
Limits
Requests are counted per store (all its keys together). Each store has a bucket: it holds half a minute's worth of calls and refills steadily over the minute. On Pro that is 30 calls at once, then one a second (60 a minute); higher plans get more. Every answer carries X-RateLimit-Limit (the bucket's size), X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the bucket is full again). Over the limit: 429 with Retry-After (seconds until the next call is allowed).