API Reference
API Reference

Note - This is a BETA release feature

We've introduced a new endpoint that will help you in re-estimating arrival times for visits if your driver has fallen behind schedule or if the dispatcher makes manual changes to the routes.

https://api.routific.com/v1/min-idle

The /min-idle endpoint can be used to make manual edits to a previously optimized solution, or to get updated ETAs for your routes.

Check out our guides for more information on real-world applications of this endpoint.

📘

The /min-idle endpoint is intended to be used for estimating arrival times for your visits based on the route sequence provided in the API request. It is not meant for re-optimizing an existing solution.

The schematics of the API request is similar to that of the other API endpoints as it contains a visits, fleet, and an optional options object at the highest level.

The only addition being that it also requires a solution object that lists an array of routes with visit IDs. See the sidebar for how a solution object looks like when sending a request to /min-idle endpoint.

🚧

The solution object in the API request only supports solutions returned by the /vrp and /vrp-long endpoints.
It does not currently support solutions returned by /pdp and /pdp-long endpoints, which have a 'pickup' and 'delivery' type constraint associated with each visit.

{
    "visits": {
        "coco_and_tengtengs": {
            "duration": 10,
            "location": {
                "lat": 49.280231,
                "lng": -123.095983
            }
        },
        "sugar_and_spice": {
            "duration": 10,
            "location": {
                "lat": 49.280232,
                "lng": -123.054692
            }
        },
        "jimmy_pestos": {
            "duration": 10,
            "location": {
                "lat": 49.268199,
                "lng": -123.003409
            }
        },
        "tiny_gyoza": {
            "duration": 15,
            "location": {
                "lat": 49.215390,
                "lng": -123.091364
            }
        },
        "finnegans": {
            "duration": 10,
            "location": {
                "lat": 49.263801,
                "lng": -123.141087
            }
        }
    },
    "fleet": {
        "vehicle_1": {
            "start_location": {
                "lat": 49.2847463,
                "lng": -123.1123453
            },
            "end_location": {
                "lat": 49.2847463,
                "lng": -123.1123453
            }
        }
    },
    "solution": {
        "vehicle_1": [
            "jimmy_pestos",
            "finnegans",
            "sugar_and_spice",
            "tiny_gyoza",
            "coco_and_tengtengs"
        ]
    }
}
{
    "status": "success",
    "total_travel_time": 100,
    "total_idle_time": 0,
    "total_break_time": 0,
    "num_unserved": 0,
    "unserved": null,
    "solution": {
        "vehicle_1": [
            {
                "location_id": "vehicle_1_start",
                "location_name": "Nameless Node",
                "arrival_time": "00:00"
            },
            {
                "location_id": "jimmy_pestos",
                "location_name": "Nameless Node",
                "arrival_time": "00:18",
                "finish_time": "00:28"
            },
            {
                "location_id": "finnegans",
                "location_name": "Nameless Node",
                "arrival_time": "00:51",
                "finish_time": "01:01"
            },
            {
                "location_id": "sugar_and_spice",
                "location_name": "Nameless Node",
                "arrival_time": "01:19",
                "finish_time": "01:29"
            },
            {
                "location_id": "tiny_gyoza",
                "location_name": "Nameless Node",
                "arrival_time": "01:48",
                "finish_time": "02:03"
            },
            {
                "location_id": "coco_and_tengtengs",
                "location_name": "Nameless Node",
                "arrival_time": "02:20",
                "finish_time": "02:30"
            },
            {
                "location_id": "vehicle_1_end",
                "location_name": "Nameless Node",
                "arrival_time": "02:35"
            }
        ]
    },
    "total_working_time": 155
}

The endpoint responds with the following information based on the route sequence provided in the solution object:

  • Total driving time
  • Total distance
  • ETA for each location in the visits object.

The response also contains a boolean identifier called "too_late" that indicates whether a stop falls outside of a delivery window, and as such will be considered late by the ETA estimates.

Note: Total distance is part of the response only when the polylines parameter is enabled in the Options object.