Events
Everything worth reacting to raises an event: a customer is approved, a licence is about to expire, an order is confirmed. Events are how the product tells anything outside itself that something happened, and they are how the product tells itself — the same mechanism serves both, so there is nothing that happens internally that you cannot also see.
Where they live
Every event is written to an outbox in the same transaction as the work that caused it. That is the whole design in one sentence, and it is the reason you can trust the list: an event cannot exist for something that did not happen, and something cannot happen without its event. There is no separate publish step that can fail after the fact.
You read the outbox through the API:
GET /api/v1/events?event_type=customer.approved&limit=50
GET /api/v1/events/types
GET /api/v1/events/types is the list of every event this version can raise,
with a description and the shape of its payload. It is generated from the same
registry the code publishes through, so it cannot describe an event the product
does not raise.
Reading events needs event.read.
The shape of one
{
"id": "0f2b8a1e-…",
"event_type": "customer.approved",
"occurred_at": "2026-05-17T09:14:03Z",
"status": "published",
"payload": { "customer_id": "…", "number": "C-00042" }
}
Three things about the payload are worth relying on:
- Identifiers, not documents. A payload names what happened and to what. It does not carry a copy of the record, because a copy is a thing that goes stale between being written and being read — fetch the record if you need it.
- No personal data, no tax ids, no licence numbers. The same rule the logs follow. An event is read by more things than the record is.
occurred_atis UTC. As is every instant in this API. Business dates — the date on a document — are dates, in the entity's own timezone, and are not the same thing.
Following the feed
The feed is everything that happened, oldest first, resumable from any event you were given:
GET /api/v1/events/feed?types=stock.*,receipt.posted&limit=100
GET /api/v1/events/feed?after=<the last id you saw>
Keep the last id and pass it as after next time. types takes event types
and families — stock.* is every stock event. GET /api/v1/events?after=…
answers the same way, for code written against it.
An event reaches the feed once it is committed, never before, so a cursor never skips one: an event written early in a long transaction that finished late is given to you late, not lost behind one you already read.
Live, as it happens
GET /api/v1/events/stream?types=warehouse_task.*
Accept: text/event-stream
Server-sent events, which a browser's EventSource, a handheld and a robot's
controller all speak. Each frame is one event:
id: 0f2b8a1e-…
event: stock.moved
data: {"id":"0f2b8a1e-…","type":"stock.moved","occurred_at":"…","entity_id":"…","data":{…}}
A stream lasts five minutes and then ends; reconnect with Last-Event-ID and
you carry on from where you were. follow=false sends what is waiting and
stops. Machines signed in with their own key have the same stream for task
events at GET /api/v1/wcs/events/stream.
Webhooks
To have events sent to you instead, an administrator adds a webhook on
Settings → Integrations → Webhooks: an https:// address and the events it
wants. Every request is a POST of the same JSON the stream carries, signed:
ERP-Signature: t=1760000000,v1=5f2c…
ERP-Event-Type: stock.moved
ERP-Delivery-Id: 7a1d…
ERP-Delivery-Attempt: 1
v1 is HMAC-SHA256, keyed with the webhook's secret, over the timestamp, a
full stop and the raw body. Check it before you trust the body, and refuse a
timestamp more than five minutes old:
import hashlib, hmac, time
def genuine(secret: str, header: str, body: bytes) -> bool:
fields = dict(part.split("=", 1) for part in header.split(","))
if abs(time.time() - int(fields["t"])) > 300:
return False
expected = hmac.new(
secret.encode(), f"{fields['t']}.".encode() + body, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, fields["v1"])
Answer with any 2xx. Anything else — or no answer within ten seconds — is tried again after a minute, five minutes, half an hour, two hours, six and twelve; after that the delivery waits on the Webhooks tab for somebody to send it again. Redirects are not followed.
Ordering and duplicates
The feed and the stream are in the order events were committed. Webhook deliveries are not ordered: each is tried on its own schedule, so a retried delivery can arrive after a later one. Every payload carries what it is about and when it happened; order by that where order matters.
Every route may give you an event more than once — a retried read, a webhook
whose answer was lost. Treat the id as the deduplication key. Exactly-once
delivery across a network is a promise no system can keep.