Webhooks

You can use RoutiGo webhook subscriptions to receive real time notifications about particular events, such as routes being started or assignments being fulfilled. After you have subscribed to a RoutiGo webhook, your applications will be notified of a change, allowing you to easily create powerful integrations with your systems. A common example is synchronising the status of your orders and being able to implement your custom logic on changes. This method is much more efficient than traditional periodical polling mechanisms.

Note: If you've been with us for a longer period you might be used to our older format:General information andManagement API

Event triggers

After the webhook subscription is configured, the events that were specified will trigger a webhook notification each time they occur. This notification contains a JSON payload or the specified type, optional query parameters and HTTP headers that provide context. Additionally, RoutiGo can automatically send data, such as the time when the shipment took place, based on the trigger.

Keep reading for the possible event triggers or check out the API references to find out how to register a webhook:API references

TOUR_PLANNED
Indicates a tour has been successfully planned and released in the dashboard. At this point, the communication with the clients is performed if enabled, and the communicated time windows are set for all stops in this specific route. From this point onward the system will try and maintain the order of stops according to these new windows. This also means the route is now ready to be assigned to a driver. This state cannot be reverted.
TOUR_ASSIGNED
An event that is triggered after a tour has been assigned to or picked up by a driver. This makes the driver now responsible for driving this route and removes the option to assign this route to another driver, unless it is unassigned. The assigned driver will be displayed on the tracking page if enabled. This state can be reverted from the driver app and the RoutiGo dashboard. Reverting will trigger the `TOUR_UNASSIGNED` event. It is worth noting that a driver can only be assigned to one route at a time.
TOUR_UNASSIGNED
An event that is triggered after a tour has been unassigned/unclaimed from/by a driver. This is the reversal of the `TOUR_ASSIGNED` event and changes the state of the tour to where it can again be assigned or claimed by another driver.
TOUR_STARTED
An event that is triggered after a driver has indicated that the tour has been started. This is performed from within the RoutiGo driver smartphone app. Once this event is triggered the assumption is made that the driver starts the route, assuming it is past the planned starting time of the route (if not, route calculations will assume the planned starting time).
TOUR_FINISHED
An event that is triggered after a driver has indicated that the tour is finished and all stops are done. From this point onward the driver is now again available for route assignment.
STOP_DONE
An event that is triggered when an entire stop has been marked as done, and if applicable the registrations have been filled in.
SHIPMENT_DONE
An event that is triggered when both locations of a shipment have been marked as done.
ASSIGNMENT_DONE
An event that is triggered when a single assignment (of a stop) has been marked as done, and if applicable the registrations have been filled in. Based on this event the assignment will be given an `end status`. By default, this will be set to `DELIVERED`. This event can be triggered multiple times if the driver changes the registrations of an assignment, but can not be reverted.

Event types

The payload the webhook sends to your system is determined by the configured event type. There are four possible event types; Tour (TOUR), Shipment (SHIPMENT), Stop (STOP), Assignment (ASSIGNMENT).

For a comprehensive understanding of the types and their meanings, we highly recommend reviewing theterminology.

A summary of event triggers and types compatibility

Event Trigger / Event Type
Tour
Stop
Shipment
Assignment
TOUR_PLANNED
TOUR_ASSIGNED
TOUR_UNASSIGNED
TOUR_STARTED
TOUR_FINISHED
STOP_DONE
SHIPMENT_DONE
ASSIGNMENT_DONE