How dispatch filters riders
When an order is created, Yonne runs this sequence:- Find all online riders
- Filter by courier affiliation
- Filter by vehicle capacity — riders whose vehicle cannot carry the shipment are excluded
- Apply vehicle-class rules (see Bike Rule below)
- Prefer the smallest valid vehicle class
- Sort remaining candidates by distance and assign the nearest
How weight is calculated
Yonne computesrequired_weight_kg from your inputs:
| Input | Value used |
|---|---|
weight_estimate only | Upper bound of the bucket (see table below) |
weight_estimate + total_weight_kg | The greater of the two values |
Weight bucket upper bounds
weight_estimate | required_weight_kg used for routing |
|---|---|
0-5kg | 5 |
5-10kg | 10 |
10-20kg | 20 |
20-50kg | 50 |
50kg+ | > 50 (use total_weight_kg for accuracy) |
total_weight_kg with the actual weight so routing and pricing agree on the correct vehicle class.
The bike rule
BIKE riders are excluded for any shipment withrequired_weight_kg above 50.
This is a hard system rule. Even if a specific bike rider has a custom capacity override, they will not be assigned to shipments above the threshold.
If your product weighs 55 kg, only CAR, VAN, or TRUCK class vehicles are eligible.
The quote response tells you the vehicle class
CallPOST /api/v1/external/quote before creating an order. The response includes the routing recommendation:
suggested_vehicle_class in your checkout UI so customers know what type of vehicle to expect.
What happens when no vehicle is available
If no online rider has sufficient capacity, the create-order call returns422:
What to do
- Do not silently downgrade the vehicle class and retry — that changes the shipment contract.
- Do not retry in a tight loop — capacity will not appear instantly.
- Surface a clear message to your customer: “No delivery vehicles are available for this shipment right now. Please try again in a few minutes or contact support.”
- Keep the order in a
pendingorfailedstate in your system until the merchant confirms they want to retry.
