Understanding Order, Shipment, and Tour Relationship
Overview
In our system, there is no direct connection between an Order
and a Tour
. Instead, the connection is made through a Shipment
. This design allows for flexibility, as an order can have multiple shipments that may be distributed across different tours.
How Orders, Shipments, and Tours Interact
The relationship follows this pattern:
An order contains one or more shipments
Each shipment is assigned to a tour
Therefore, tours are related to orders via their associated shipments
This indirect relationship provides flexibility for complex scenarios where orders might be split across multiple shipments and tours.
Auto-Routing Feature
When an order is created in Hub with the "auto-route" setting enabled, both a shipment and a tour are automatically generated. In this specific case, there is a guaranteed one-to-one relationship between the order and the tour, as the tour is created directly from that single order.
How Auto-Routing Works
With auto-routing enabled:
Tours are automatically created from shipments when orders are placed
The system creates the tour synchronously during order creation
Orders with status "request" are not auto-routed as they do not create shipments
The created tour information is immediately available in the order webhook as a second property
tour
(not within theorder
object!)Note: This feature is currently in staging and not yet available in production.
Configuring Auto-Routing
Auto-routing can be enabled through the General settings of the Hub settings in MissionControl. When activated, this feature ensures that orders are immediately assigned to tours without manual intervention.
Accessing Tour Information
Note: This feature is currently in staging and not yet available in production.
The order-created
webhook includes an optional Tour
field. This field is populated with tour information when a tour is created immediately (such as when auto-routing is enabled). If the order has not yet been assigned to a tour, this field will be empty.
When auto-routing is enabled, the tour information is guaranteed to be available in the webhook payload, allowing integrated systems to access and store the tour details immediately.
Legacy Information
Note that the legacy pricing information under fare
on the order
has been replaced by lineItems
.