Events

Understanding tracking events

Last updated 19 Aug 2024

Events are notifications that transporters provide from the time of booking until the shipment is considered done. Skrym receives events from transporters in one of two different ways:

Webhook
Polling

When we receive an event, we immediately store the original transporter event in our system so that in case of confusion/error or any other reason we can always go back and check what we originally received.

flowchart LR ret(Retailer) sk(Skrym) tr(Transporter) tr -- Webhook --> sk sk -. Polling .-> tr sk -- Webhook --> ret

This is particularly important as many transporters delete event data for shipments older than 6 months.

Skrym provides a set of default event types that we use to categorize the events we receive. These are:

Skrym EventDescription
arrivalThe shipment has arrived at a checkpoint
delayThe shipment is delayed
errorAn error has occurred with the shipment
deliveredThe shipment has been delivered
notificationA notification has been sent to the recipient
departureThe shipment has left a checkpoint

Skrym maps the transporter's event to one of these types. This is done to ensure that we can provide a consistent experience across all transporters.

Events determine Shipment Status

Each shipment has a status. Some events make the status change, while some other does not. A status can be one of four values:

OK
DELAY
PROBLEM
DONE
ARCHIVED
  • When Skrym receives a transporter event that indicates an error, the shipment's status tends to be changed to
    PROBLEM
  • Notifications events, such as when a text reminder has been sent to the recipient, will never lead to a change in status

Anatomy of an Event

The struct for a skrym event is defined by a few fields.

Some data about when the event was created and what the event is tracking (e.g what shipment it is about). It also contains some data regarding what the event means. That data we store in the field EventAspect.

Event Aspect
Checkpoint

Read more