On Demand Delivery
Product Used: Driver Assignment API
Background
Consider a quick commerce vendor in Los Angeles selling groceries, beverages and frozen desserts from a dark store (a delivery-only warehouse) in a dense neighborhood bordering downtown. Customers often order bulky baskets which the vendor fulfills using a small fleet of delivery vans. Orders arrive all day with some of them involving frozen items, and each one has to leave the store as soon as possible to meet the quick delivery promise. However, any order can’t be automatically assigned to the nearest available vehicle, since each order must be evaluated against the vehicle's specific attributes to ensure compatibility with the order's contents.
Problem Statements
To assign every new order as soon as it is placed, quick commerce dispatchers need to overcome the following challenges:
Meeting short delivery promises at peak hours
Quick commerce promises delivery in minutes, so there is no time to batch orders into a planned route. At peak hours most vans are still finishing a drop when the next order is packed. Assigning only idle vans leaves orders waiting at the store, while assigning any van regardless of distance pushes pickups past the promised window. Dispatchers need to know which van can reach the store soonest, including vans that are about to finish a delivery.
Matching right vehicles for frozen foods
Ice cream, frozen meals and chilled drinks need a refrigerated van, while dry groceries can go in any van. Relying solely on distance or time to assign orders ignores a vehicle's capabilities. For instance, sending frozen items in a standard vehicle risks product spoilage. Manually verifying vehicle features for every incoming order creates significant bottlenecks when immediate dispatch is critical.
Solution
NextBillion.ai's Driver Assignment API supports real-time order-to-vehicle matching, allowing dispatchers to assign each new order to the best available van within seconds while respecting pickup time limits and van equipment.
Cap the time to order pickup
Set filter.pickup_eta to rule out any van that would take longer than the desired number of seconds to reach the store, and set options.travel_cost to driving_eta so that vans reaching faster are preferred. In our example scenario, the pickup limit is 600 seconds:
Match cold orders to refrigerated vans
Describe each van's equipment in vehicles.attributes as key and value pairs, then add orders.vehicle_preferences.required_all_of_attributes to the orders that need it. A van must meet every listed condition to be considered, so a frozen order is never assigned to a van without cooling. In our example scenario, only Delivery Van 2 is refrigerated, and the frozen dessert order requires it:
Include busy vans as well
Configure the stops a van still has to complete on its ongoing delivery trip, using vehicles.remaining_waypoints. If the van can reach the warehouse within the filter.pickup_eta limit after completing its current delivery, the API can assign the new order to that van if it reaches before any other vans. In our example, Delivery Van 3 is finishing a drop near the store:
Sample Request and Response
Following is a JSON request that we built for this case and the corresponding response.
API Request
API Response
All three orders are assigned, and unassigned_orders is empty. QC Order 102-Frozen Desserts goes to Delivery Van 2, the only refrigerated van, even though Delivery Van 1 reaches the store first with a pickup eta of 70 seconds against 305. Delivery Van 3 completes its ongoing step before picking up QC Order 103-Party Snacks, so a van that was still busy takes the order instead of leaving it waiting at the store. The dispatcher gets every order on its way within minutes, without checking van locations or equipment by hand.