Order webhooks & API
Your AI agent takes orders in chat. These webhooks push each of those events to your own website the moment it happens — order created, staff confirmed, cancelled, and the cart the customer is still building — so your site never has to poll.
403.
1. Register an endpoint
Either tick the events on the Integration screen → your agent → Webhooks, or register from your own installer:
curl -X POST https://everysecond.ai/api/v1/webhooks \
-H "Authorization: Bearer es_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Shop backend",
"url": "https://example.com/hooks/everysecond",
"events": ["order.created", "order.confirmed", "order.cancelled", "cart.item_added"]
}'
The response contains a secret (whsec_…). Store it — it is what
verifies the signature on every request. You can read it again on the dashboard, or replace
it with POST https://everysecond.ai/api/v1/webhooks/{id}/rotate.
2. Events
| Event | Fires when | data |
|---|---|---|
order.created | An order is saved — by the AI after the customer confirms, or by staff on the dashboard. | order |
order.updated | Items, address, fulfillment or notes changed — or your merchant_ref / tracking_url through the status API (only when the value really changed). | order, changed[] |
order.confirmed | A human accepted the order (the staff gate). | order, confirmed_by |
order.status_changed | Any status transition (pending → preparing → …), including a forced correction from your system. | order, previous_status, status |
order.cancelled | The order was cancelled and its stock released. | order, cancelled_by |
order.failed | A confirmed order could not be saved — out of zone, out of stock, item no longer on the menu. A rescuable lost sale. | reason, context, attempt |
cart.item_added | The customer added something to their basket in chat. | cart, items[] (what was added) |
cart.item_removed | They dropped items or reduced a quantity. | cart, items[] (what left) |
cart.updated | Any basket change — the full snapshot plus the diff. | cart, added[], removed[] |
cart.converted | That basket became a real order. | cart, order |
cart.closed | Your system closed the basket without an order (DELETE /chats/{id}/cart — e.g. paid on your site). | cart (with closed_at, closed_reason) |
| Store & catalog — store integrations (8) and every product write | ||
product.created | A menu item / store product was added — on the dashboard, through the menu API, by a CSV/XLSX import or a store / feed sync. One event per branch row. | product, source |
product.updated | Anything an integrator would care about changed (price, offer, stock, availability, name, links…) — including the stock an order takes or gives back (source: "order"). A resync that changes nothing sends nothing. | product, source, changes[] |
product.deleted | A product left the catalogue (deleted, removed from the store, or no longer in the feed / file). | product (last known values), source |
store.connected | A Shopify / Salla / EasyOrders store, a product feed or a product file was connected. | store |
store.disconnected | The owner disconnected it, or the store uninstalled our app. | store, reason (owner | uninstalled) |
store.needs_reauth | The store refused our credentials (token revoked, refresh expired) — the owner must connect it again. | store, error |
catalog.sync_completed | A catalogue sync finished. | store, trigger, counts, duration_ms |
catalog.sync_failed | A sync could not finish — nothing was deleted. | store, trigger, error, counts |
store.order_received | An order placed on the store itself arrived (when the connection imports orders). order.created fires too, with order.source = the platform. | store, store_order_id, order |
webhook.test | You pressed Test. Always delivered, whatever the subscription. | message, sample_order |
order.validate | Synchronous and optional. Your system is asked — and answers — before the agent quotes a basket and when the customer confirms. See 7.3. | stage, items[], customer, fulfillment |
Carts in chat
There is no "add to cart" button in a conversation, so the cart is the running list
of items the agent has gathered. It is priced from your menu (offers applied), holds no
stock, and lives until the customer confirms — at which point it converts and
order.created fires. A basket that never converts is an abandoned cart you can
follow up on; read them any time from GET https://everysecond.ai/api/v1/orders/carts.
Every cart.* event carries source: "agent" when the chat changed the
basket, "api" when your own system did through
PUT / DELETE /chats/{id}/cart.
If you keep a cart of your own in step, skip the events with source: "api" — they are your own
changes coming back. The cart object also says who changed it last (changed_by). A customer has
at most one open basket; one that converted or was closed keeps its id and contents, and the next purchase
opens a new basket.
Each basket line (in cart.items and in the items / added /
removed lists of the events) carries a line_id — "item:311" for a menu
item, "bundle:4" for a bundle offer — and merchant_quote.items[] (your last
order.validate answer, 7.3) uses the same line_id to say which line each of your
prices or available_qty belongs to. Money in a cart is always a decimal number
(120.0, never 120), like everywhere else.
3. What a request looks like
POST /hooks/everysecond HTTP/1.1
Content-Type: application/json
User-Agent: EverySecond-Webhooks/1.0
X-EverySecond-Signature: t=1785312000,v1=6f1c…
X-EverySecond-Event: order.created
X-EverySecond-Event-Id: 6f9d2c14-… ← same id on every retry/replay
X-EverySecond-Delivery: 4821
{
"id": "6f9d2c14-…",
"event": "order.created",
"created_at": "2026-07-28T14:20:03+00:00",
"project": { "id": 130, "name": "My restaurant" },
"data": {
"order": {
"id": 512,
"status": "pending",
"merchant_ref": "SO-1042", ← your order number (7.3 / 7.4), else null
"payment_url": null,
"tracking_url": null,
"requires_staff_approval": false,
"awaiting_approval": false,
"created_by": "ai",
"channel": "whatsapp", ← whatsapp | messenger | instagram | api | website | dashboard
"chat_id": null, ← the chat API chat id when channel = api
"conversation_url": "https://everysecond.ai/leads/88",
"branch": { "id": 7, "name": "Downtown" },
"customer": { "name": "Ahmed", "phone": "01012345678", "phone_e164": "+201012345678",
"language": "ar", "sender_id": "201012345678", "lead_id": 88 },
"fulfillment_type": "delivery",
"address": "12 Nile St, building 4, flat 7",
"address_details": { "area": "Maadi", "street": "12 Nile St", "building": "4", "unit": "7",
"notes": "next to the pharmacy" },
"delivery_zone": "Maadi",
"items": [
{ "menu_item_id": 31, "external_id": "SKU-1042", "offer_id": null, "components": null,
"name": "Burger", "options": { "size": "Large" },
"unit_price": 120.0, "qty": 2, "line_total": 240.0 }
],
"items_total": 240.0,
"delivery_fee": 20.0,
"total": 260.0,
"currency": "EGP",
"customer_confirmed_at": "2026-07-28T14:20:03+00:00",
"staff_confirmed_at": null
}
}
}
Prices are always the price the item was sold at (a live offer is already applied,
and a bundle is one line with a components snapshot). Never re-price from your
own catalogue.
4. Verify the signature
X-EverySecond-Signature is t=<unix>,v1=<hex>, where the HMAC-SHA256
is computed over "<t>.<raw request body>" with your endpoint secret.
Compare in constant time, and reject anything older than a few minutes.
For 24 hours after a secret rotation the header carries one v1 per secret
(t=…,v1=<new>,v1=<old>,v1=<new>) — accept the request when any
v1 matches (rotation).
// PHP
$raw = file_get_contents('php://input');
$header = $_SERVER['HTTP_X_EVERYSECOND_SIGNATURE'] ?? '';
$t = null; $signatures = [];
foreach (explode(',', $header) as $part) {
[$k, $v] = array_pad(explode('=', $part, 2), 2, '');
if ($k === 't') { $t = $v; }
if ($k === 'v1') { $signatures[] = $v; } // more than one while a rotation overlaps
}
$expected = hash_hmac('sha256', $t . '.' . $raw, $secret);
$valid = false;
foreach ($signatures as $signature) { $valid = hash_equals($expected, $signature) || $valid; }
if ($t === null || !$valid || abs(time() - (int) $t) > 300) {
http_response_code(400);
exit;
}
$event = json_decode($raw, true);
// Node / Express (mount with express.raw({ type: '*/*' }))
const crypto = require('crypto');
const pairs = (req.get('X-EverySecond-Signature') || '').split(',').map(p => p.split('='));
const t = (pairs.find(([k]) => k === 't') || [])[1];
const expected = Buffer.from(crypto.createHmac('sha256', secret).update(`${t}.${req.body}`).digest('hex'));
const ok = pairs.some(([k, v]) => k === 'v1' && v.length === expected.length && crypto.timingSafeEqual(expected, Buffer.from(v)));
if (!ok) return res.sendStatus(400);
const event = JSON.parse(req.body);
5. Responding, retries and duplicates
- Answer 2xx as soon as you have stored the event. Anything else counts as a failure.
- We wait up to 10 seconds for your response. Do the slow work after answering.
- Failures retry 5 times with backoff: 10s, 1m, 5m, 30m, 2h. Then the delivery is marked failed and you can resend it by hand from the dashboard log.
- After 20 consecutive failed deliveries the endpoint switches itself off, with the reason shown on the Integration screen. Re-enabling clears the counter.
- Deduplicate on
X-EverySecond-Event-Id: a retry or a manual resend carries the same id as the original. - Only
https://URLs are accepted, and hosts resolving to private network addresses are refused.
6. Reading orders directly
Same Authorization: Bearer es_… key. Useful for catching up after downtime.
| Route | Does |
|---|---|
GET https://everysecond.ai/api/v1/orders | Orders, newest first. Filters: status (one of the order statuses — anything else is 422), branch_id, since (a date; unreadable → 422), since_id, per_page. |
GET https://everysecond.ai/api/v1/orders/{id} | One order, in the exact shape the webhook sends. |
POST https://everysecond.ai/api/v1/orders/{id}/confirm | The staff gate, from your back office: confirms a pending order and emits order.confirmed. Already confirmed → 200, nothing sent again. Further along (preparing, out for delivery…) or cancelled → 409 invalid_transition; a late confirm never moves an order back. Does not message the customer. |
POST https://everysecond.ai/api/v1/orders/{id}/cancel | Cancel, release reserved stock, emit order.cancelled and — by default — tell the customer in their chat (body, optional: notify_customer, message, as in 7.4; the response carries notification). Allowed until the order is delivered (then 409 invalid_transition); already cancelled → 200, nothing sent. |
GET https://everysecond.ai/api/v1/orders/carts | Baskets being built right now (?status=active|converted|closed|all; anything else is 422). |
GET https://everysecond.ai/api/v1/orders/branches | Branches of this project. |
GET https://everysecond.ai/api/v1/orders/branches/{id}/menu | The menu behind every menu_item_id you receive, with live offer pricing (now also external_id, options and ordering rules). |
GET https://everysecond.ai/api/v1/orders/ref/{merchant_ref} | One order by your order number. |
Statuses only move forward: pending → confirmed → preparing →
ready_for_pickup (pickup) or out_for_delivery (delivery) → delivered, and
cancelled from anything not yet delivered. A move the order cannot make is answered
409 with a machine-readable code and where the order stands:
{ "error": "Order 512 is out_for_delivery; only a pending order can be confirmed.",
"code": "invalid_transition",
"details": { "status": "out_for_delivery", "requested": "confirmed", "allowed": ["delivered", "cancelled"] } }
allowed lists the statuses the order can move to now through the status API (7.4) — empty for a
delivered or cancelled order.
7. Connect your own store, POS or ERP
If your products, prices, stock and orders already live in another system, you can connect it instead of re-typing the menu into the dashboard. Everything in this section is optional and additive: a merchant who never calls these endpoints sees exactly the old behaviour, and hand-made menu items and synced items live side by side.
| Part | What it gives you |
|---|---|
| 7.1 Menu write API | Push your catalogue, addressed by your own product id. |
| 7.2 Your ids in every event | external_id on each line, your order number, E.164 phone, structured address, channel. |
| 7.3 Validation webhook | Your system has the final say on price and stock before an order is placed; returns your order number and a payment link. |
| 7.4 Status updates | Report preparing → out for delivery → delivered; the customer hears it in the same chat. |
| 7.5 Ordering rules | Items that can't be ordered in chat, per-order caps, staff approval — enforced by the platform. |
7.1 Menu write API — keyed by your product id
| Route | Does |
|---|---|
PUT https://everysecond.ai/api/v1/orders/menu/items/{external_id} | Create one item, or merge into the existing one. Idempotent — send it again and nothing is duplicated. Not a replace: name and price are required, optional fields you leave out keep their current value (send null to clear one). |
PATCH https://everysecond.ai/api/v1/orders/menu/items/{external_id} | Change only the fields you send — e.g. {"available": false} or {"price": 95}. The item must exist (404 otherwise). |
DELETE https://everysecond.ai/api/v1/orders/menu/items/{external_id} | Remove it (?branches=3,5 to remove from some branches only). Past orders keep their lines. |
POST https://everysecond.ai/api/v1/orders/menu/items/batch | Up to 500 entries: {"items": [{"op": "upsert"|"patch"|"delete", "external_id": …, …}]}. Each entry succeeds or fails on its own. |
GET https://everysecond.ai/api/v1/orders/menu/items | Your synced catalogue (?updated_since= — a date; unreadable → 422 —, per_page ≤ 500), one entry per external id. |
GET https://everysecond.ai/api/v1/orders/menu/items/{external_id} | One item, with the menu_item_id it has in each branch. |
PUT https://everysecond.ai/api/v1/orders/menu/items/SKU-1042
Authorization: Bearer es_your_project_key
Content-Type: application/json
{
"name": { "en": "Vitamin C 1000mg", "ar": "فيتامين سي ١٠٠٠ مجم" },
"description": { "en": "30 effervescent tablets", "ar": "٣٠ قرص فوار" },
"category": "Vitamins",
"price": 85.00,
"offer_price": 69.00,
"available": true,
"stock_qty": 40,
"image_url": "https://cdn.your-store.com/sku-1042.jpg",
"product_url": "https://your-store.com/p/sku-1042",
"option_group": "Vitamin C",
"options": { "size": "30 tablets" },
"branches": "all",
"orderable_in_chat": true,
"max_qty_per_order": 3,
"requires_staff_approval": false
}
# 201 (created) / 200 (updated)
{ "result": "created",
"data": { "external_id": "SKU-1042", "price": 85.0, "offer_price": 69.0, …,
"branches": [ { "branch_id": 7, "menu_item_id": 311, "effective_price": 69.0, "image": "…" } ] } }
| Field | Notes |
|---|---|
name, price | Required on PUT. name and description take a string or {"en", "ar"}; the Arabic text is used as-is when the customer writes Arabic. |
offer_price | A standing sale price. The customer pays the lowest of the list price, this, and any live campaign on the dashboard. |
available, stock_qty | Unavailable or sold-out items are hidden from the agent. stock_qty: null = not tracked. |
image_url | Copied to our storage in the background (https, ≤ 8 MB, jpeg/png/webp/gif) so the agent can send the photo in chat and show it on the item's product card (an item without a photo gets no card). An http:// URL is fetched as https:// (same host and path); if your host does not serve it over https, the item keeps showing your own URL and is not sent as a photo — prefer https URLs. product_url is where a tap on the card's photo leads. |
option_group, options | Variants of one product — a dish in three sizes, a shampoo in two. Each variant is its own item with its own id and price. |
branches | "all" (default on create) or a list of branch ids. One catalogue for every branch is maintained once. Without it, an update writes every branch that carries the item. On an existing item it only adds: a listed branch that does not carry the item yet gets a copy of it (all its fields except stock, with what you sent on top — PUT and PATCH alike); branches you leave out keep their row. Remove from a branch with DELETE …?branches=. |
menu_item_id, so carts, orders and
offers that point at it keep meaning the same product. Items you edit by hand on the dashboard have no
external_id and are never touched by a sync.
7.2 Your ids and structured fields in every event
Additive fields on every order payload (webhooks and the read API alike) — nothing existing changed shape:
| Field | What it is |
|---|---|
items[].external_id, items[].options | Your product id and variant, snapshotted when the order was placed. Also on cart lines. |
merchant_ref | Your own order number, once you have given one (7.3 or 7.4). |
customer.phone_e164, customer.language | The phone as +974… for matching an account — a number typed the local way is read in the country of the agent's order currency (QAR → Qatar, SAR → Saudi Arabia, EGP → Egypt…); the language the customer used (ar/en). In order.validate, customer.name is the name the customer gave (or null — never a channel handle) and customer.phone is the number as typed. |
address_details | area, street, building, unit, lat, lng, notes — alongside the address text line. Parts the customer didn't say are absent; area falls back to the matched delivery zone. |
channel, chat_id, conversation_url | Where the order came from, the chat API chat id when it came through the API, and a link staff can open to read the conversation. |
payment_url, tracking_url, requires_staff_approval, awaiting_approval | From 7.3, 7.4 and 7.5. |
7.3 Optional validation webhook — order.validate
Register an endpoint for order.validate (same registration, same signing as every other event).
Your system then gets a signed request at two moments and can have the final say:
| stage | When | What your answer does |
|---|---|---|
quote | The customer's basket changed in chat, before the agent reads the summary back. | Your fee and total are shown to the agent for the summary; ok:false or a short available_qty is told to the customer straight away. The answer is kept on the cart as merchant_quote, one items[] entry per basket line you answered for, each with that line's line_id (answers about items not in the basket are dropped). |
place | The customer said yes. | Your unit_price and delivery_fee replace ours on the order; merchant_ref and payment_url are saved and sent to the customer; ok:false stops the order. |
How your answer is read, exactly:
items[]entries are matched to our lines byexternal_id, elsemenu_item_id, elsebundle_id. Onlyunit_price,available_qtyandmessageare read from them — aqtyyou send is ignored; the quantity is always the customer's.- At
placethe order total is recomputed: each line is yourunit_price(ours where you sent none) × the customer's quantity, plus yourdelivery_feeon a delivery order (ours where you sent none; a pickup order has no fee). Thetotalyou send is not used at this stage. When the result differs from what the agent quoted, the customer is told the final total. - At
quotethe basket's own prices stay the menu's; yourtotalanddelivery_feeare what the agent reads back. - A
merchant_refanother order of this agent already carries is not attached — the order still goes ahead (without a ref; logged on our side), because refs must stay unique for/orders/ref/{merchant_ref}. Return a fresh number for every order. - Amounts must be numbers from 0 to 99,999,999 and
payment_urlan http(s) link; anything else is ignored, not rejected.
// EverySecond → your endpoint (inside the usual envelope: data = …) { "stage": "place", "branch_id": 7, "currency": "QAR", "channel": "whatsapp", "fulfillment": { "type": "delivery", "zone": "West Bay", "address": "…", "address_details": { "area": "West Bay", … } }, "customer": { "name": "Mona", "phone": "55512345", "phone_e164": "+97455512345", "language": "ar", "sender_id": "97455512345", "lead_id": 88 }, "items": [ { "external_id": "SKU-1042", "menu_item_id": 311, "name": "Vitamin C 1000mg", "qty": 2, "unit_price": 69.0 } ], "items_total": 138.0, "delivery_fee": 15.0 } // your endpoint → EverySecond (HTTP 200, JSON) { "ok": true, "items": [ { "external_id": "SKU-1042", "qty": 2, "unit_price": 69.0, "available_qty": 2 } ], "delivery_fee": 15.0, "total": 153.0, "merchant_ref": "SO-1042", "payment_url": "https://pay.your-store.com/SO-1042", "message": null } // or, to refuse — message is what the customer is told { "ok": false, "message": "Sorry, we don't deliver to that area after 10 pm." }
"ok" all mean "no answer" — the agent carries
on exactly as it does without the webhook. Only an explicit "ok": false stops an order. Each call is in
your endpoint's delivery log with its status and response time. Training Yard (test) orders never call it.
If your system accepted an order at place but we then could not save it (the last unit sold a
moment earlier), you receive order.failed — void your merchant_ref on it.
7.4 Status updates that reach the customer
| Route | Does |
|---|---|
POST https://everysecond.ai/api/v1/orders/{id}/status | Set a status. By default the customer is told in the same conversation. |
POST https://everysecond.ai/api/v1/orders/ref/{merchant_ref}/status | The same, addressed by your own order number. |
GET https://everysecond.ai/api/v1/orders/status-templates · PUT | Which approved WhatsApp template announces each status when the 24-hour window has closed. |
POST https://everysecond.ai/api/v1/orders/512/status
{ "status": "out_for_delivery", "tracking_url": "https://track.example.com/abc",
"notify_customer": true, "merchant_ref": "SO-1042" }
# 200
{ "data": { …the order… },
"notification": { "sent": true, "via": "chat" } }
| Field | Notes |
|---|---|
status | confirmed, preparing, ready_for_pickup (pickup orders), out_for_delivery (delivery orders), delivered, cancelled (releases stock). Forward only — see below. |
notify_customer | Default true. Only a real change is announced — repeating a call never messages the customer twice. |
message | Optional text to send instead of the standard line (which is in the customer's language, with your order number and tracking link). |
merchant_ref, tracking_url | Saved on the order; merchant_ref must be unique on the agent (409 otherwise). order.updated (with changed) fires only when a value really changes — re-sending the same ref or link sends nothing. |
force | Default false. true lets you correct a mistake: a move back (e.g. delivered → preparing) or cancelling a delivered order. The correction is saved and mirrored in order.status_changed (and order.cancelled for a cancel), but the customer is never messaged about it, and a step back to confirmed does not send order.confirmed again. |
Rules. Statuses only move forward (see section 6); anything else is
409 invalid_transition with the allowed next statuses, unless you send "force": true.
cancelled is final — not even force moves a cancelled order (409). While an order is
awaiting_approval, fulfilment statuses are refused (422) until it is confirmed;
out_for_delivery on a pickup order and ready_for_pickup on a delivery order are refused (422).
Sending the status the order already has is accepted and changes nothing.
notification.via is chat (sent in the conversation — recorded in the transcript and retried if
Meta refuses it) or template (WhatsApp, outside the 24-hour window: the template you mapped to that status,
sent as a one-recipient campaign; campaign_id is returned). When nothing was sent, reason says why:
not_requested (you sent notify_customer: false), status_unchanged,
forced_correction (a force move), no_conversation (e.g. an order typed on the dashboard),
channel_disconnected (the agent's WhatsApp number or page is no longer connected),
outside_messaging_window (Messenger/Instagram after 24 h), outside_messaging_window_no_template,
template_not_approved, template_invalid (the mapped template's variables don't fit; error says how),
insufficient_whatsapp_credits, template_send_failed, unsupported_channel.
The status is saved whatever the notification outcome. POST https://everysecond.ai/api/v1/orders/{id}/cancel answers with the same
notification.
Template variables, in order: {{1}} customer name, {{2}} order number, {{3}} status,
{{4}} tracking link.
PUT https://everysecond.ai/api/v1/orders/status-templates
{ "templates": { "out_for_delivery": 12, "delivered": 14, "preparing": null } }
7.5 Item-level ordering rules
| Field | What the platform does | Examples |
|---|---|---|
orderable_in_chat: false | The agent can answer about the item but never puts it in a cart or an order; an attempt is refused. | In-store-only items, made-to-order cakes, prescription medicines |
max_qty_per_order | Caps the quantity in the cart; a larger order is refused and the customer is offered the maximum. | Limited drops, promo items, OTC medicines |
requires_staff_approval: true | The order is taken but marked awaiting_approval; the customer is told it needs your team's OK, and fulfilment statuses are refused until it is confirmed. | Catering trays, custom orders, regulated products |
Set them through the menu API or on the dashboard (Orders → menu item → Chat ordering rules). Orders your staff type in are not bound by them.
8. E-commerce flow & store integrations
An agent runs one of two orders flows (Orders screen → flow): F&B (menu, branches,
delivery zones — everything above) or e-commerce: a store catalogue the agent searches a few
products at a time, recommends 1–3 of and links to. The links are attached by the platform from the catalogue
(never written by the model): on the chat API, the website widget and the Training Yard each recommended product
is a card with product_url (View product), buy_url (Buy now — a Shopify cart permalink
when the store has one) and orderable (whether "add to order" applies); on WhatsApp, Messenger and
Instagram the reply ends with the product link(s). Checkout per agent: both (default — links, and the
agent can also take the order in chat), link (links only, no order in chat) or chat.
Orders taken in chat are ordinary orders: every order.* and cart.* event fires.
| Source | How it connects | Kept in step by | Links |
|---|---|---|---|
| Shopify | Shop domain + the client ID / secret of a custom app the store creates in its Dev Dashboard (we mint the 24 h token), or a pre-2026 admin token. | Product + order webhooks (HMAC-verified) and a daily resync. | Product page + Buy now (/cart/{variant}:1) |
| Salla | Connect button → Salla consent page (OAuth). | App webhooks (signature-verified) and a daily resync. | Product page |
| EasyOrders | API key (Public API) + your store URL. | Resync every 6 h; orders by webhook. | Product page ({store}/products/{slug}) |
| Product feed | A Google Merchant / Meta catalogue feed URL (XML, CSV or TSV). | Refetched every 6 h (1–168). | The feed's link |
| CSV / XLSX file | Upload on the Orders screen (English or Arabic headers). | Each new upload. | A link / buy_url column |
| Your own system | The menu API above (7.1) — send product_url. | Your calls. | product_url |
Synced products are ordinary menu items: their external_id is <platform>:<variant or product id>
(e.g. shopify:44012345), one per variant, so the menu API and every order line can address them.
When a connection imports orders, orders placed on the store land on the Orders screen with
source = the platform, store_order_id and merchant_ref = the store's order
number; a redelivered store webhook never creates a second order, statuses only move forward, and store orders
never move stock (the store's own product updates do). Every order payload now carries source
(chat | dashboard | shopify | salla | easyorders) and
store_order_id.
data.product on product.*: menu_item_id, branch_id, external_id,
store_source, store_product_id, store_variant_id, name {en, ar}, category,
price, offer_price, effective_price, currency, available,
stock_qty, in_stock, image_url, product_url, buy_url,
option_group, options, orderable_in_chat, updated_at.
source: dashboard | api | shopify | salla | easyorders |
feed | csv | order. data.store on store.* / catalog.*:
id, platform, status, shop_domain, store_url, store_name,
product_count, last_sync_at, last_sync_status, last_sync_counts, last_error
— never a credential. counts: created, updated, unchanged, deleted,
skipped, total, errors[]; trigger: connect | manual |
schedule | upload.
{ "event": "product.updated",
"data": { "source": "shopify", "changes": ["offer_price", "stock_qty"],
"product": { "menu_item_id": 9021, "external_id": "shopify:44012345", "name": { "en": "Linen Shirt - M / White" },
"price": 199.0, "offer_price": 149.0, "effective_price": 149.0, "currency": "SAR", "stock_qty": 7,
"product_url": "https://store.example/products/linen-shirt", "buy_url": "https://store.example/cart/44012345:1" } } }
Inbound store webhooks (what the stores call — registered for you on Shopify; on EasyOrders paste the URL shown on the
Orders screen into Public API → Webhooks; Salla's is the app's): https://everysecond.ai/webhook/stores/shopify/{token}
(X-Shopify-Hmac-Sha256), https://everysecond.ai/webhook/stores/salla (X-Salla-Signature),
https://everysecond.ai/webhook/stores/easyorders/{token} (secret header). A bad signature is refused with 401.
Limits and answers
- Menus: no hard item limit; the agent is shown the sellable items of the branch it sells from. For very large catalogues, keep
categoryandoption_groupfilled — the agent matches names in Arabic and English. - Rate limit: the usual 120 requests / minute per key — use
batchfor catalogue syncs. - An order can carry a payment link: return
payment_urlat stageplace.
Managing endpoints from code
| Route | Does |
|---|---|
GET https://everysecond.ai/api/v1/webhooks | List endpoints + every available event name. |
POST https://everysecond.ai/api/v1/webhooks | Create one; returns the secret. |
PATCH https://everysecond.ai/api/v1/webhooks/{id} | Change url / events / is_active. |
DELETE https://everysecond.ai/api/v1/webhooks/{id} | Remove it and its delivery log. |
POST https://everysecond.ai/api/v1/webhooks/{id}/rotate | New signing secret, effective immediately. |
POST https://everysecond.ai/api/v1/webhooks/{id}/test | Send a signed webhook.test event and report what your server answered. |
GET https://everysecond.ai/api/v1/webhooks/{id}/deliveries | Recent attempts with status codes and errors. |
POST https://everysecond.ai/api/v1/webhooks/deliveries/{id}/redeliver | Replay one delivery byte-for-byte. |
X-RateLimit-Remaining.