Back to Back Order Assignments

What are Back-to-Back Orders?

Back-to-back orders refer to the scenario where a driver who is currently completing a trip is assigned a new order in real-time, without needing to return to an idle state. This new order typically has a pickup location that is either near the driver’s current path or aligns with the general direction of their ongoing drop-off. Once the driver accepts the new order, the assignment system intelligently factors in the driver’s current trip completion before planning the route to the new pickup. This ensures seamless transition between consecutive trips, improves driver utilization, and reduces passenger wait times.

How to configure a Back-to-Back Order?

To enable back-to-back trip planning using the Driver Assignment API, define the remaining_waypoints field within the vehicles object. This field represents the set of drop-offs the driver still needs to complete for their current trip. Once specified, the system takes these remaining stops into account before assigning and sequencing the new order, ensuring the driver's route covers both the ongoing and upcoming tasks in the correct order.

Following is a sample vehicle configuration which needs to cover two remaining drop-off points in order to complete an ongoing trip:

1
"vehicles": [
2
{
3
"id": "Car 1",
4
"location": {
5
"lat": 34.08276781,
6
"lng": -118.31481656
7
},
8
"remaining_waypoints": [
9
{
10
"lat":34.08034401,
11
"lng":-118.31349953
12
},
13
{
14
"lat":34.07256151,
15
"lng":-118.29522714
16
}
17
]
18
}]

Example: API Request with Back-to-Back Orders

The following API request demonstrates how to enable back-to-back order planning by setting the remaining_waypoints for each vehicle. These waypoints represent the stops that the drivers still need to complete before they can pick up a new order. The API then ensures that new assignments are scheduled to begin only after these waypoints are completed. Request Payload

Sample Request

1
curl --location 'https://api.nextbillion.io/optimization/driver-assignment/v1?key=<you_api_key>' --header 'Content-Type: application/json' --data '{
2
"filter": {...},
3
"orders": {...},
4
"vehicles": {...}
5
}

Sample Response

1
{
2
"status": 200,
3
"result": {
4
"trips": "[...]",
5
"unassigned_orders": "[...]",
6
"available_vehicles": null
7
}
8
}

The Driver Assignment API considers the remaining_waypoints you configured as active stops the driver must complete before taking up any new orders. Each vehicle begins its trip with a type: "ongoing" step representing a stop from the current/ongoing trip.

The system ensures that the new order’s pickup only happens after the ongoing step is completed. This sequencing enables high utilization of drivers without compromising real-world trip logic.

Check out all the advanced features of Driver Assignment API and learn how to leverage them for fast, efficient on-demand order fulfillment.

© 2025 NextBillion.ai all rights reserved.