The lifecycle of last mile fulfillment of orders includes the Plan, Assign and Track stages.
The 'Plan' stage involves batching and sequencing orders for available drivers. The 'Assign' stage involves finding the specific driver to fulfill the order based on live location, drive time to the order destination, profile data, etc and dispatching the order for fulfillment. The 'Track' stage involves live tracking the order to fulfillment and sharing live progress with your operations team and end customers. Further, tracking requires your teams to proactively be informed about orders at risk so they can investigate and take remediating action to improve your end customer's experience and logistics efficiency.
HyperTrack's 'Self-improving Routes' feature enables you do do all of this and this guide will walk you through how you can use the feature.
1. Setup Operations Groups
The first step to get started is to setup the planning parameters for your operation. Planning of orders in HyperTrack is scoped to individual 'Operations Groups'. Operations groups represent the level at which orders and drivers are grouped for assignment.
For example, in different contexts for different businesses, operations group can be defined at a store, warehouse or even city level. The fields required to setup your operations groups are described below.
|Operations Group Label||required||Order Planning for a business is scoped to entities like warehouses, hubs, regions etc. This parameter specifies the entity your business uses as operations groups.||string||"store"|
|Operations Group Handle||required||This is the unique identifier for a specific operations group that manages orders||string||"ny_grocery_store"|
|Operations Group Home||required for dispatches from a warehouse||This is the location of the operations group||GeoJson Point|
|Mode||required||This specifies if how operation primatily plans orders. ||ENUM|
|Route Start Location||required||This specifies the location at which an order for the specific operations group will start||ENUM|
|Default shift start time||required for scheduled||This specifies the default shift start time for drivers||Time string||08:00:00|
|Default shift length||required for scheduled||This specifies default driver shift length in minutes for planning||INT||480|
|Route capacity||optional||This is the maximum order quantity a driver can fulfill on a single route. When ingesting orders, we also accept the capacity used by the order which will need to be in the same unit as this parameter for collect results. For instance if you prefer your drivers do not fulfill more than 5 orders in a route and route capacity can be 5 and each order's used capacity can be 1.||INT||5|
|Route maximum distance||optional||This is the maximum distance in miles a single route can have.||INT||30|
|Objective Function||required||This specifies the objective function for route optimization||ENUM|
|Product Types||optional||This specifies all the product types the operations groups can fulfill. Orders and drivers associated with an operations group must have one of the product types that can be fulfilled by the operations group||string||['alcohol', 'ice-cream', 'grocery']|
|Route completion type||required||This specifies the rules for how a route should be completed.||ENUM|
Please contact your HyperTrack support team to setup.
2. Setup Drivers and their availability
If you are using the HyperTrack Visits app as your driver app, you will need to invite your drivers and have them install Visits app to get the
Device ID as described here.
The HyperTrack Drivers API lets you ingest and manage your drivers. You can POST to
/drivers with the parameters below to get started.
|Driver Handle||required||This is the unique identifier for a driver in your system like the driver name or id||string|
|Operations Group Handle||required||This is the identifier of the operations group to which this driver is associated||string|
|Profile||optional||This specifies profile parameters for the driver||dict|
|Device ID||optional for creation||This is the ID of the device on which the driver app including the HyperTrack SDK is installed. At a time, a driver can only be associated with one device. However the historical values of the device are stored in case the driver changes the device.||string|
|Product Types||optional||These are the product types that the driver can fulfill. These must be a subset of the product types enabled for the operations group to which the driver is associated||string||['ice-cream', 'grocery']|
|Home||optional||This is the home destination of the driver which will be used in case the driver is expcected to start routes from home||GeoJSON Point|
|Schedule||optional||This describes the default work schedule of the driver by day.||object[Date string]|
|Unavailable on||optional||This is to define temporary leaves the driver might take that need to be managed.||array[Date string]|
Drivers are considered for planning depending on the planning mode of the operations group. For ops groups that have
scheduled mode, drivers will be considered based on the driver schedules in the driver profile described in the table above. This is used for planning orders in the future (like next day orders) where schdeules are more important as opposed to live location at the time of planning.
For ops groups that have
pool mode, driver availability is decided using the live availability parameter as described here. Drivers in the
available state will be considered for planning. If an available driver is currently on a route, that will be taken into account when they are included in planning. When drivers are no longer accepting new orders, they should be made
unavailable as described here.
3. Order Planning and Assignment
This step provides the orders to be planned for last mile fulfillment and batches and sequences them for the relevant drivers who are available based on the driver setup parameters defined.
Note as a pre-requisite for order planning you will need to setup webhooks as describe here to receive planning updates.
For orders in an operations group, HyperTrack will auto-include drivers who are available for planning. To batch and sequence orders for the available fleet, you will need to POST to the
/orders endpoint with the following parameters:
|intent||required||This specifies which HyperTrack feature you would like to use for the order.||ENUM string|
|ops_group_handle||required||This specifies the operations group for which this order is being planned||string|
|orders||required||Array of orders that need to be planned||Array||see sample API docs here|
|order.destination||required||Object to define the order destination||Object|
|order.destination.geometry||required to define the order destination geofence geometry. You can also use a Geofence id if you are managing Geofences separately through HyperTrack.||GeoJSON Point|
|Order.destination.address||optional||This provides the text address of the order destination||string|
|Order.scheduled_after||optional||This specifies the start of the time window within which an order must start fulfillment||Datetime string|
|Order.scheduled_at||optional||This specifies the end of the time window within which an order must start fulfillment||Datetime string|
|Order.expected_service_time||required||This specifies expected service time for the order in seconds. Default value is 300s||int||300|
|Order.metadata||optional||metadata related to the order||dict|
|Order.capacity_used||optional||This specifies how much of fulfillment capacity will be utilized by this order. It is used to constrain the number of orders in a single route||int||1|
|Order.type||optional||This can be used for delivery or pick up orders. The default value is ||ENUM string|
|Order.product_type||optional||This specifies product type of the order. Only drivers who can service this product type will be considered for assignment and optimization||string|
Order planning is an async process. A successful planning request will receive a response with a message indicating order planning has been initiated. When planning is completed you will receive a
order_planning_completed webhook after which you can fetch your routes from
/orders/routes with the ops group handle to get the routes planned for it.
Each route will have a
route_id which can be used to dispatch it for live tracking.
4. Dispatch route and start tracking
To start live tracking of the route planned through HyperTrack make the following API call:
5. Track the orders dispatched and share live tracking with customers
Live tracking of an ongoing route can be viewed on the map in your HyperTrack Dashboard. Each order has a shareable URL that can be sent to the customer to allow them to view the live location of the driver who is on the way to deliver their package. To learn more please visit this guide.
For questions or comments about orders view, please do not hesitate to contact us.