# Event type


Something that happened to one entity, in one transaction.

## Fields

### id

`ID!`

The event's id. It is opaque and unique, and it increases in the order that events were
written, which is not always the order that the feed returns them. Resume with a cursor,
never with an id.

### type

`String!`

The event type, one of those listed on [`events`](/chameleoon-max/query/events).

### entityType

[`EventEntityType!`](/chameleoon-max/type/event-entity-type)

The type of the entity that the event happened to.

### entityId

[`UUID!`](/chameleoon-max/type/uuid)

The MAX id of the entity that the event happened to.

### version

`Int!`

The event's number within its entity: 1, 2, 3 and so on, without gaps. Order one entity's
events by it.

### occurredAt

[`Time!`](/chameleoon-max/type/time)

When the event was written, on the MAX clock.

### origin

[`EventOrigin`](/chameleoon-max/type/event-origin)

Where a receipt, issue, transfer or shipment came from. Null for other entities, and null
for a shipment without a consignment. `origin.id` and `origin.salesOrderId` are returned
whatever else your API key may read. They are bare ids and may name records that your API
key cannot open.

### transitions

[`[EventTransition!]!`](/chameleoon-max/type/event-transition)

The tracked fields that changed, each with its old and new value. Empty when only untracked
data changed.

Values are strings: enum codes, `"true"` or `"false"`, decimal integers, instants as RFC 3339
text in UTC, or text as stored (an order's `invoiceNumber`, an invoice's `number`, a receipt
advice's `supplierReference`). A value is null when there is none.

The tracked fields of each entity type are:

- Orders track `status`, `fulfilmentStatus`, `paymentStatus`, `blockedReason`,
  `isPriority`, `invoiceNumber` and `hasOpenExceptions`.
- Receipts, issues and transfers track `status` and `revision`.
- Attached documents track `status` (`ACTIVE` or `REMOVED`) and `versionNo`, the number of
  the current version.
- Consignments track `status`.
- Shipments track `status` and `trackingStatus`.
- Transfer advices track `status`, `plannedAt`, `lineCount` (the number of lines) and
  `linesChangedAt` (the latest change of a line that is still there).
- Receipt advices track `status`, `expectedAt`, `supplierReference`, `lineCount` and
  `linesChangedAt`.
- Invoices track `status`, `paymentStatus`, `number`, `cancelled` and `updatedAt`.

On a transfer advice, adding or removing a line moves `lineCount`, and changing or adding a
line moves `linesChangedAt`. Removing the most recently changed line moves `linesChangedAt`
back, so compare the values and do not assume that it only grows.

Priced as 3 transitions, however many it holds.

Costs 3 points plus 3 × one transition's selection.

### actor

[`EventActor!`](/chameleoon-max/type/event-actor)

Who caused the event.

## Used by

- [`EventConnection`](/chameleoon-max/type/event-connection)
- [`EventEdge`](/chameleoon-max/type/event-edge)
