order_stops
Put a single run's stops in the best visiting order ("order my errands"). Provide start {lat, lon} and stops (1-100 entries of {location, label?, service_s?}); optionally an end destination or round_trip: true to return to the start. Costing "auto" = car, "truck" = lorry (pass truck as in route for a truck-legal order). Returns the stops in visit order with arrival offsets in seconds, plus total duration and distance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Optional fixed final destination. Mutually exclusive with `round_trip`; omitted (and not a round trip), the run ends at whichever stop the solver visits last. | |
| start | Yes | Where the run starts. | |
| stops | Yes | The stops to put in the best visiting order (1–100). | |
| truck | No | Truck profile (dimensions + ADR declaration); requires costing "truck". The travel-time matrix then respects dimensional and dangerous-goods restrictions. | |
| costing | No | Costing model: "auto" (default) or "truck". | auto |
| round_trip | No | Return to `start` after the last stop (default false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ordered | Yes | The stops in optimal visiting order. | |
| profile | Yes | The matrix costing profile ("auto" or "truck"). | |
| distance_m | No | Total travel distance in metres, when reported. | |
| duration_s | Yes | Total travel time in seconds. | |
| unassigned_stop_indexes | Yes | 0-based indexes of stops the solver could not fit (empty in the normal, unconstrained case). |