Events

The envelope of every event, its type names, how to read order and repeats, and when to poll instead.

On this page

An event is a record that something changed, sent to you after it happened.

The envelope

Every event of every product has the same envelope. Only data changes with the type. This is the event that the reservation of the first request produces:

A movement of Inventory

{
  "specversion": "1.0",
  "id": "5e2b9c47-8d13-4a6f-b0e5-71c4a2d93f68",
  "type": "com.rdcopilot.inventory.movement.v1",
  "source": "urn:rdcopilot:service:inventory-runtime",
  "time": "2026-11-20T09:41:07Z",
  "customerOrgId": "a3f1d7c2-64be-4b09-9d58-2c0e7f1a8b34",
  "legalCompanyId": "c8b25e90-1d47-4f3a-a6d2-93e0b51f7c68",
  "aggregateType": "inventory-balance",
  "aggregateId": "e17d3b60-4a98-4c25-9f02-6b8a1d5c7e39",
  "aggregateRevision": 8,
  "correlationId": "3b7e41a8-9c25-4d60-b8f3-1a05e6d27c94",
  "causationId": "4c8a1f72-e6b9-4d35-a0c8-5b2e9d7f1a63",
  "actor": {
    "serviceId": "erp",
    "userId": "9a4e7b10-2c6d-4f38-b5a1-0d3e8c7f6b25"
  },
  "data": {
    "movementId": "f2a95c08-6d41-4e7b-83a0-b7d14e92c5a6",
    "productId": "7d0c4e19-b3a2-4f65-8e91-2a6f5c8d3b40",
    "locationId": "1b9e6a35-d4c7-4082-b5f3-9e0a7c2d8164",
    "onHandDelta": "0",
    "reservedDelta": "24"
  }
}

FieldMeaning
specversionVersion of the envelope format.
idIdentifier of this event. A repeated delivery of the same event has the same id.
typeWhat happened, in the form above.
sourceThe product that sent the event.
timeWhen the event happened, as a date and time with a time zone.
customerOrgIdYour organisation.
legalCompanyIdThe legal company that the event belongs to, test or live.
aggregateTypeThe kind of record that changed.
aggregateIdThe record that changed.
aggregateRevisionThe revision of the record after the change.
correlationIdTies together everything that came from one request or one flow.
causationIdThe document or operation that caused this event.
actorWho or what made the change.
dataThe content of the event. Its shape depends on type.

Type names

A type has the form com.rdcopilot.<product>.<event>.v1, such as com.rdcopilot.inventory.movement.v1. The v1 is the version of data: its fields keep their names, types and meanings. A field can be added to data. A change that could break a reader gets a new type, ending in v2.

Tenancy and tracing

In the example above, correlationId is the operationId of the reservation and causationId is the sales order. A subscription receives the events of the legal company that its client was issued for.

Order and repetition

An event can arrive twice, and an event can arrive after a newer one. Two fields settle both.

CaseWhat you do
The same id againIt is a repeat. Skip it.
An aggregateRevision older than the one you hold for that aggregateIdIt is late. Skip it: your state is newer.

Events or polling

You needUse
To react when something changesEvents: Webhooks
To fill a copy from nothingA list, read with the cursor: Pagination
To check one record nowA read of the record
To catch up after your endpoint was downReplay parked events

The events of each product

Each product lists its event types in its own docs.

In the product docs