Webhooks
Have Looped tell your system when stock or a sales order changes
Polling works, but your shop or integration ends up asking every minute for news that mostly isn't there. With a webhook, Looped sends a signed POST to your URL when something you care about happens, and you only do work when there's work to do.
The events
| Event | When | To subscribe, you need |
|---|---|---|
stock.changed | Up to once a minute, for the items whose available stock changed (up to 500 an event) | inventory:items.read |
sales_order.created | A sales order is made: by hand, from a quote or from an online store order | invoices:quotes.read |
sales_order.invoiced | An invoice is raised from a sales order, for part or all of it | invoices:quotes.read |
sales_order.cancelled | A sales order is cancelled | invoices:quotes.read |
You can only subscribe an endpoint to events you could read yourself, so a key can't send data it couldn't see to a URL.
Every delivery is one event:
{
"id": "evt_ckz4m2...",
"type": "sales_order.created",
"createdAt": "2026-11-24T07:13:12.000Z",
"teamId": "c7q3ek8h...",
"data": {
"id": "...",
"serial": "SO-0042",
"status": "OPEN",
"clientName": "Online Store",
"customerReference": "10423",
"currency": "ZAR",
"total": 797,
"invoice": null,
"channel": { "storeId": "...", "provider": "custom", "orderId": "web-10423", "orderNumber": "10423" }
}
}A sales order event from an online store carries channel, so you can match it to your own order without another call. stock.changed carries the same rows as /v1/inventory/stock-levels, with company-wide totals across every location; for one store's locations, read stock-levels?store= when you're told.
Adding an endpoint
In Manage, open Settings → Webhooks and click New webhook. Enter the URL, pick the events and save. Looped shows the endpoint's signing secret once; copy it into your secrets manager. Or use the API:
curl https://api.looped.sh/v1/webhooks \
-H "X-API-Key: looped_..." \
-H "Content-Type: application/json" \
-d '{"url": "https://shop.example.com/looped/webhooks", "events": ["stock.changed", "sales_order.created"]}'Managing webhooks needs manage:integrations.read to see them and manage:integrations.write to change them. The URL has to be https on a public host; Looped won't send to private or local addresses.
Send test (or POST /v1/webhooks/:id/test) sends a webhook.test event straight away and shows you what your endpoint answered. A test is never retried.
Checking the signature
Looped signs every delivery the way Standard Webhooks does, so you can check it with their library for your language, or by hand. Each delivery has three headers:
webhook-id: the event's id. It stays the same on a retry, so you can use it to ignore one you've already handled.webhook-timestamp: when it was sent, in Unix seconds.webhook-signature:v1,and the base64 HMAC-SHA256 ofid.timestamp.body, keyed with the base64-decoded part of your secret afterwhsec_.
import { createHmac, timingSafeEqual } from "node:crypto"
function fromLooped(secret: string, headers: Headers, body: string): boolean {
const id = headers.get("webhook-id") ?? ""
const timestamp = headers.get("webhook-timestamp") ?? ""
// Refuse anything older than five minutes, so a captured delivery can't be replayed.
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64")
const expected = `v1,${createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest("base64")}`
return (headers.get("webhook-signature") ?? "")
.split(" ")
.some((given) => given.length === expected.length && timingSafeEqual(Buffer.from(given), Buffer.from(expected)))
}Check the signature against the raw body, before you parse it. A JSON parser that reorders or reformats the body will change it.
Answering and retries
Answer with any 2xx within 15 seconds; do the real work after you've answered if it takes longer. Anything else (another status, a timeout, a connection that fails) is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 10 hours: eight attempts over a little more than a day. After that, the delivery is marked failed and stays in the log.
Events can arrive out of order, and a retry can arrive after a newer event. Each event says when it happened (createdAt), and its data holds absolute values (what's available now, the order's status now), so keep the newest and you're fine.
If every delivery to an endpoint fails for 3 days, Looped switches it off and says why on its page. Turn it back on once it answers again; from then on it gets new events, and you can resend the ones it missed from the log.
The delivery log
Each endpoint's page in Settings → Webhooks lists its deliveries from the last 30 days, with search and filters by event and result. Open one to see what was sent, what your endpoint answered and when the next attempt is, and to Resend it. The API has the same: GET /v1/webhooks/:id/deliveries and POST /v1/webhooks/:id/deliveries/:deliveryId/resend.
If a secret leaks, Rotate secret (or POST /v1/webhooks/:id/rotate-secret). Deliveries are signed with the new secret from then on, and the old one stops working straight away, so update your endpoint at the same time.
Are you an AI? Visit llms.txt — these docs as plain markdown.