# Solve a route optimization problem Start by reading the introduction to the Route Optimization API. To solve a new vehicle routing problem, make a HTTP POST to this URL https://graphhopper.com/api/1/vrp?key= It returns the solution to this problem in the JSON response. Please note that this endpoint is well suited for solving smaller problems. Larger vehicle routing problems that take longer than 10 seconds to solve cannot be processed using this endpoint. To solve them, please use the batch mode URL instead. Endpoint: POST /vrp Version: 1.0.0 Security: key ## Request fields (application/json): - `vehicles` (array) Specifies the available vehicles. - `vehicles.vehicle_id` (string, required) Specifies the ID of the vehicle. Ids must be unique, i.e. if there are two vehicles with the same ID, an error is returned. Example: "vehicle-1" - `vehicles.type_id` (string) The type ID assigns a vehicle type to this vehicle. You can specify types in the array of vehicle types. If you omit the type ID, the default type is used. The default type is a car with a capacity of 0. Example: "my-own-type" - `vehicles.shifts` (array) An array of shift configurations for this vehicle. - `vehicles.shifts.shift_id` (string) A unique identifier for this vehicle's shift. - `vehicles.shifts.start_address` (object) - `vehicles.shifts.start_address.location_id` (string, required) Specifies the id of the location. Example: "550e8400-e29b-11d4-a716-446655440000" - `vehicles.shifts.start_address.name` (string) Name of location. Example: "Queens Victoria Street 70, Second Floor, Flat 245" - `vehicles.shifts.start_address.lon` (number, required) Longitude of location. Example: -0.092869 - `vehicles.shifts.start_address.lat` (number, required) Latitude of location. Example: 51.512665 - `vehicles.shifts.start_address.street_hint` (string) Optional parameter. Specifies a hint containing the street name to better snap the coordinates (lon,lat) to the road network. For example, if an address or building has two or more neighboring streets, you can control which street is used to find the closest location. Example: "Queens Victoria Street 70" - `vehicles.shifts.start_address.curbside` (string) Optional parameter. Specifies on which side a point should be relative to the driver when they leave/arrive at a start/target/via point. Only supported for motor vehicles and OpenStreetMap. If you would like to arrive at this address without having to cross the street, use curbside=right/left for countries with right/left-hand driving. Using curbside=any is the same as not specifying this parameter at all. Enum: "right", "left", "any" - `vehicles.shifts.end_address` (object) If this is omitted AND return_to_depot is true then the vehicle needs to return to its start_address. - `vehicles.shifts.earliest_start` (integer) Earliest start of vehicle in seconds. It is recommended to use the unix timestamp. - `vehicles.shifts.latest_end` (integer) Latest end of vehicle in seconds, i.e. the time the vehicle needs to be at its end location at latest. Omit this field to indicate no limit. - `vehicles.shifts.return_to_depot` (boolean) If true, vehicle returns to its start location (or specified end location). If false, vehicle can end at any customer location that optimizes the objective function. - `vehicles.shifts.break` (any) - `vehicles.return_to_depot` (boolean) If it is false, the algorithm decides where to end the vehicle route. It ends in one of your customers' locations. The end is chosen such that it contributes to the overall objective function, e.g. min transport_time. If it is true, you can either specify a specific end location (which is then regarded as end depot) or you can leave it and the driver returns to its start location. - `vehicles.skills` (array) An array of skills, i.e. an array of strings (not case sensitive). Example: ["drilling_machine","screw_driver"] - `vehicles.max_distance` (integer) Specifies the maximum distance (in meters) a vehicle can go. Example: 400000 - `vehicles.max_driving_time` (integer) Specifies the maximum driving time (in seconds) a vehicle/driver is allowed, i.e. the maximum time spent on the road (service and waiting times are not included). Example: 28800 - `vehicles.max_jobs` (integer) Specifies the maximum number of jobs a vehicle can load. Example: 12 - `vehicles.min_jobs` (integer) Specifies the minimum number of jobs a vehicle should load. This is a soft constraint, i.e. if it is not possible to fulfill “min_jobs”, we will still try to get as close as possible to this constraint. Example: 12 - `vehicles.max_activities` (integer) Specifies the maximum number of activities a vehicle can conduct. Example: 24 - `vehicles.move_to_end_address` (boolean) Indicates whether a vehicle should be moved even though it has not been assigned any jobs. - `vehicle_types` (array) Specifies the available vehicle types. These types can be assigned to vehicles. - `vehicle_types.type_id` (string, required) Specifies the id of the vehicle type. If a vehicle needs to be of this type, it should refer to this with its type_id attribute. Example: "my-own-type" - `vehicle_types.profile` (string) The routing profile. It determines the network, speed and other physical attributes used when computing the route. See the section about [routing profiles](#tag/Map-Data-and-Routing-Profiles) for more details and valid profile values. - `vehicle_types.capacity` (array) Specifies an array of capacity dimension values which need to be int values. For example, if there are two dimensions such as volume and weight then it needs to be defined as [ 1000, 300 ] assuming a maximum volume of 1000 and a maximum weight of 300. Example: [100,500] - `vehicle_types.speed_factor` (number) Specifies a speed factor for this vehicle type. For example, if a vehicle using this type should travel at half the speed calculated by our routing engine, set the speed factor to 0.5. - `vehicle_types.service_time_factor` (number) Specifies a service time factor for this vehicle type. For example, if a vehicle/driver using this type can complete services twice as fast as specified in the service or shipment, set this to 0.5. - `vehicle_types.cost_per_meter` (number) _BETA feature_! Cost parameter per distance unit, here meter is used - `vehicle_types.cost_per_second` (number) _BETA feature_! Cost parameter per time unit, here second is used - `vehicle_types.cost_per_activation` (number) _BETA feature_! Cost parameter vehicle activation, i.e. fixed costs per vehicle - `vehicle_types.consider_traffic` (boolean) Specifies whether traffic should be considered. If "tomtom" is used and this is false, free-flow travel times from TomTom are calculated. If this is true, historical traffic information is used. Traffic data is not yet available for "openstreetmap", so setting this to true has no effect when using OpenStreetMap. - `vehicle_types.network_data_provider` (string) Specifies the network data provider. Either use [openstreetmap](#tag/Map-Data-and-Routing-Profiles/OpenStreetMap) (default) or [tomtom](#tag/Map-Data-and-Routing-Profiles/TomTom) (add-on required). Enum: "openstreetmap", "tomtom" - `services` (array) Specifies the orders of the type "service". These are, for example, pickups, deliveries, or other stops to be visited by the specified vehicles. Each of these orders contains only one location. - `services.id` (string, required) Specifies the id of the service. Ids need to be unique so there must not be two services/shipments with the same id. Example: "7fe77504-7df8-4497-843c-02d70b6490ce" - `services.type` (string) Specifies type of service. This makes a difference if items are loaded or unloaded, i.e. if one of the size dimensions > 0. If it is specified as service or pickup, items are loaded and will stay in the vehicle for the rest of the route (and thus consumes capacity for the rest of the route). If it is a delivery, items are implicitly loaded at the beginning of the route and will stay in the route until delivery (and thus releases capacity for the rest of the route). Enum: "service", "pickup", "delivery" - `services.priority` (integer) Specifies the priority. Can be 1 = high priority to 10 = low priority. Priority only affects the solution when not all services can be assigned (e.g., due to insufficient vehicle capacity, conflicting time windows, or vehicle constraints). In these cases, the optimizer preferentially assigns high-priority services and leaves low-priority services unassigned. The lower the priority, the earlier these services are omitted from the solution. When all services can be served within the given constraints, priority has no effect - all services are assigned regardless of their priority values, and the optimizer focuses solely on the specified objective (e.g., minimizing distance or number of vehicles). Example: 1 - `services.name` (string) A meaningful name for the service, e.g. "deliver pizza". Example: "deliver pizza" - `services.address` (object) - `services.duration` (integer) Specifies the duration of the service in seconds, i.e. how long it takes to perform the actual service. This time is charged for each activity—if multiple services occur at the same location, their durations are summed. Example: 1800 - `services.preparation_time` (integer) Specifies the preparation time in seconds. This time is added after arrival and before the service can begin, modeling tasks like finding a parking spot. Preparation time is only charged once when the location differs from the previous stop—if multiple consecutive activities share the same location, it is applied only to the first. Example: 300 - `services.setup_time` (integer) Specifies the setup time in seconds. This is a fixed overhead charged when arriving at a new location (e.g., dock check-in, security clearance, equipment preparation). Unlike duration, setup time is only charged once per location—if multiple consecutive activities share the same location, it is applied only to the first. The activity timeline is: arrival → preparation_time → waiting (if early) → setup_time → duration. Example: 600 - `services.time_windows` (array) Specifies an array of time window objects (see TimeWindow object below). Specify the time either with the recommended Unix timestamp (the number of seconds since 1970-01-01) or you can count the seconds relative to Monday morning 00:00 and define the whole week in seconds. For example, Monday 9am is represented by 9 hours 3600 sec/hour = 32400. Wednesday 1pm corresponds to 2 days 24 hours/day 3600 sec/hour + 13 hours 3600 sec/hour = 219600. See our tutorial for more information. Example: [{"earliest":32400,"latest":36000},{"earliest":50400,"latest":54000}] - `services.time_windows.earliest` (integer) Specifies the opening time of the time window in seconds, i.e. the earliest time the service can start. - `services.time_windows.latest` (integer) Specifies the closing time of the time window in seconds, i.e. the latest time the service can start. Omit this field to indicate no limit. - `services.size` (array) Size can have multiple dimensions and should correspond to the capacity dimension array of the vehicle type. For example, if the item that needs to be delivered has two size dimensions, volume and weight, specify it as follows: [ 20, 5 ], assuming a volume of 20 and a weight of 5. Example: [30,5,1] - `services.required_skills` (array) Specifies an array of required skills, i.e. an array of strings (not case sensitive). For example, if this service needs to be performed by a technician with a drilling_machine and a screw_driver, specify the array as follows: ["drilling_machine","screw_driver"]. This means that the service can only be done by a vehicle (technician) that has both drilling_machine AND screw_driver in its skill array. Otherwise, it remains unassigned. Example: ["drilling_machine","screw_driver"] - `services.allowed_vehicles` (array) Specifies an array of allowed vehicles, i.e. an array of vehicle IDs. For example, if this service can only be performed by EITHER technician_peter OR technician_stefan, specify this as follows: ["technician_peter","technician_stefan"]. Example: ["technician_peter","technician_stefan"] - `services.disallowed_vehicles` (array) Specifies an array of disallowed vehicles, i.e. an array of vehicle IDs. Example: ["driver-A","driver-B"] - `services.preferred_vehicles` (array) Specifies an array of preferred vehicles. - `services.preferred_vehicles.vehicle_id` (string) Id of the preferred vehicle. - `services.preferred_vehicles.priority` (integer) Number between 1 and 10 which indicates the priority of the preferred vehicle. 1 indicates the highest priority, 10 the lowest. - `services.max_time_in_vehicle` (integer) Specifies the maximum time in seconds a delivery can stay in the vehicle. Currently, it only works with services of "type":"delivery". Omit this field to indicate no limit. Example: 900 - `services.group` (string) Group this service belongs to. See the group relation and [this post](https://discuss.graphhopper.com/t/4040) on how to utilize this. Example: "group-A" - `shipments` (array) Specifies the available shipments. Each shipment consists of a pickup and a delivery. For a single shipment, the pickup must always occur before the delivery. However, pickups and deliveries from multiple shipments can be sequenced independently. - `shipments.id` (string, required) Specifies the ID of the shipment. IDs must be unique, so there must not be two services/shipments with the same ID. Example: "7fe77504-7df8-4497-843c-02d70b6490ce" - `shipments.name` (string) A meaningful name for the shipment, e.g. "pick up and deliver pizza to Peter". Example: "pick up and deliver pizza to Peter" - `shipments.priority` (integer) Specifies the priority. Can be 1 = high priority to 10 = low priority. Priority only affects the solution when not all shipments can be assigned (e.g., due to insufficient vehicle capacity, conflicting time windows, or vehicle constraints). In these cases, the optimizer preferentially assigns high-priority shipments and leaves low-priority shipments unassigned. The lower the priority, the earlier these shipments are omitted from the solution. When all shipments can be served within the given constraints, priority has no effect - all shipments are assigned regardless of their priority values, and the optimizer focuses solely on the specified objective (e.g., minimizing distance or number of vehicles). Example: 1 - `shipments.pickup` (object, required) - `shipments.pickup.address` (object) Specifies pickup or delivery address. - `shipments.pickup.duration` (integer) Specifies the duration of the pickup or delivery in seconds, e.g. how long it takes to load or unload items. This time is charged for each stop—if multiple pickups or deliveries occur at the same location, their durations are summed. Example: 1800 - `shipments.pickup.preparation_time` (integer) Specifies the preparation time in seconds. This time is added after arrival and before the pickup or delivery can begin, modeling tasks like finding a parking spot. Preparation time is only charged once when the location differs from the previous stop—if multiple consecutive activities share the same location, it is applied only to the first. Example: 300 - `shipments.pickup.time_windows` (array) Specifies an array of time window objects (see time window object below). For example, if an item needs to be delivered between 7am and 10am then specify the array as follows: [ { "earliest": 25200, "latest" : 32400 } ] (starting the day from 0 in seconds). Example: [{"earliest":32400,"latest":36000},{"earliest":50400,"latest":54000}] - `shipments.pickup.group` (string) Group this stop belongs to. See the group relation and [this post](https://discuss.graphhopper.com/t/4040) on how to utilize this. Example: "ASAP" - `shipments.delivery` (object, required) - `shipments.required_skills` (array) Specifies an array of required skills, i.e. an array of strings (not case sensitive). For example, if this shipment needs to be handled by a technician with a drilling_machine and a screw_driver, specify the array as follows: ["drilling_machine","screw_driver"]. This means that the shipment can only be done by a vehicle (technician) that has both drilling_machine AND screw_driver in its skill array. Otherwise, it remains unassigned. Example: ["drilling_machine","screw_driver"] - `shipments.allowed_vehicles` (array) Specifies an array of allowed vehicles, i.e. an array of vehicle IDs. For example, if this shipment can only be handled by EITHER "technician_peter" OR "technician_stefan", specify this as follows: ["technician_peter","technician_stefan"]. Example: ["technician_peter","technician_stefan"] - `shipments.max_time_in_vehicle` (integer) Specifies the maximum time in seconds a shipment can stay in the vehicle. Omit this field to indicate no limit. Example: 1800 - `relations` (array) Defines additional relationships between orders. - `objectives` (array) Specifies an objective function. The vehicle routing problem is solved in such a way that this objective function is minimized. Example: [{"type":"min","value":"vehicles"},{"type":"min","value":"completion_time"}] - `objectives.type` (string, required) Type of objective function, i.e. min, min-max, or balance. * min: Minimizes the objective value. * min-max: Minimizes the maximum objective value. * balance: (Beta) Optimizes for balanced workloads across drivers. Use with value: completion_time to balance working time, or value: activities to balance the number of stops per driver. For instance, min -> vehicles minimizes the number of employed vehicles. min -> completion_time minimizes the sum of your vehicle routes' completion time. If you use, for example, min-max -> completion_time, it minimizes the maximum of your vehicle routes' completion time, i.e. it minimizes the overall makespan. This only makes sense if you have more than one vehicle. In case of one vehicle, switching from min to min-max should not have any impact. If you have more than one vehicle, then the algorithm tries to constantly move stops from one vehicle to another such that the completion time of longest vehicle route can be further reduced. For example, if you have one vehicle that takes 8 hours to serve all customers, adding another vehicle (and using min-max) might halve the time to serve all customers to 4 hours. However, this usually comes with higher transport costs. If you want to minimize vehicles first and, second, completion_time, you can also combine different objectives like this: json "objectives" : [ { "type": "min", "value": "vehicles" }, { "type": "min", "value": "completion_time" } ] If you want to balance activities or the number of stops among all employed drivers, you need to specify it as follows: json "objectives" : [ { "type": "min-max", "value": "completion_time" }, { "type": "min-max", "value": "activities" } ] #### Balance Objective (Beta) The balance objective type provides a more sophisticated approach to workload balancing compared to min-max. While min-max only minimizes the maximum route value, balance optimizes for equal distribution of work across all drivers by minimizing the coefficient of variation (CV) of workloads. Use balance with: * value: completion_time - Balance working time (service time + travel time + waiting time) across drivers * value: activities - Balance the number of stops per driver The optional level parameter (1-3) controls how strongly to prioritize balance: * level: 1 - Mild balance preference, allows some variation for better travel efficiency * level: 2 - Moderate balance (default), good trade-off between balance and efficiency * level: 3 - Strict balance, prioritizes equal workloads even at the cost of longer travel Example: json "objectives" : [ { "type": "balance", "value": "completion_time", "level": 2 } ] When to use balance vs min-max: * Use balance when you want all drivers to have similar workloads (fairness) * Use min-max when you only care about minimizing the longest route (makespan) Note: The balance objective currently only supports services. Requests that combine balance objectives with shipments will return a 400 error. Enum: "min", "min-max", "balance" - `objectives.value` (string, required) The value of the objective function. The objective value transport_time solely considers the time your drivers spend on the road, i.e. transport time. In contrary to transport_time, completion_time also takes waiting times at customer sites into account. The completion_time of a route is defined as the time from starting to ending the route, i.e. the route's transport time, the sum of waiting times plus the sum of activity durations. The completion_time_last_stop, on the other hand, refers to the completion time of the very last order in a tour or, in other words, the completion time without the last section from the last stop to the end of the tour. This is typically used if the orders are to be processed as quickly as possible. If you solely want to minimize route duration, you should use simply use route_duration. The objective value vehicles can only be used along with min and minimizes vehicles. For balance objective type, only completion_time and activities are supported. Enum: "completion_time", "completion_time_last_stop", "route_duration", "transport_time", "vehicles", "activities" - `objectives.level` (integer) (Beta) Level for balance objectives (1-3). Controls how strongly to prioritize balanced workloads. * 1 - Accept some workload variation for better travel efficiency * 2 - Moderate balance (default) * 3 - Strictly equal workloads, even at cost of longer travel Only valid when type is balance. Ignored for other objective types. - `cost_matrices` (array) Specifies your own transport time and distance matrices. - `cost_matrices.type` (string) Type of cost matrix. Currently "default" and "google" are supported. Enum: "default", "google" - `cost_matrices.location_ids` (array) - `cost_matrices.data` (object) JSON data of matrix response - `cost_matrices.data.times` (array) - `cost_matrices.data.distances` (array) - `cost_matrices.data.info` (object) Additional information for your request - `cost_matrices.data.info.copyrights` (array) - `cost_matrices.data.info.took` (number) - `cost_matrices.profile` (string) Vehicle profile, or empty for a catch-all fallback. - `configuration` (object) Specifies general configurations. - `configuration.routing` (object) This contains all routing specific configurations. - `configuration.routing.calc_points` (boolean) It lets you specify whether the API should provide you with route geometries for vehicle routes or not. Thus, you do not need to do extra routing to get the polyline for each route. - `configuration.routing.consider_traffic` (boolean) Indicates whether historical traffic information should be considered. - `configuration.routing.network_data_provider` (string) Specifies the data provider. Read more about it [here](#tag/Map-Data-and-Routing-Profiles). Enum: "openstreetmap", "tomtom" - `configuration.routing.curbside_strictness` (string) In some cases curbside constraints cannot be fulfilled. For example in one-way streets you cannot arrive at a building that is on the left side of the street such that the building is to the right of you (unless you drove the one-way street the wrong/illegal way). You can set the curbside_strictness to soft to ignore the curbside constraint in such cases or set it to strict to get an error response instead. You can also set it to ignore to ignore all curbside constraints (this is useful to compare the results with and without constraints without modifying every single address). Enum: "ignore", "soft", "strict" - `configuration.routing.fail_fast` (boolean) Indicates whether matrix calculation should fail immediately when points cannot be connected. - `configuration.routing.return_snapped_waypoints` (boolean) Indicates whether the solution should include snapped waypoints. Unlike the address coordinates, a snapped waypoint is the access point to the road network. - `configuration.routing.snap_preventions` (array) Optional parameter. 'Snapping' is the process of finding the closest road location for GPS coordinates provided in the points array. The snap_preventions array allows you to prevent snapping to specific types of roads. For example, if the array includes bridge, then the routing engine will avoid snapping to a bridge, even if it is the closest road for the given point. Note that once snapped the routing algorithm can still route over bridges (or the other values). To avoid this you need to use the custom_model. Enum: "motorway", "trunk", "bridge", "ford", "tunnel", "ferry" - `configuration.optimization` (object) This contains all optimization specific configurations. - `configuration.optimization.free_insertion` (boolean) If you use groups, you sometimes want to place orders without group assignment in the best position, i.e. sometimes in the middle of a group and not before or after the group. This is not allowed by default. However, if this field here is "true", these orders (without a group assignment) can be inserted freely. - `configuration.optimization.free_insertion_exempt_groups` (array) When free_insertion is enabled, ungrouped orders can be inserted anywhere, including inside groups. Use this property to specify groups where ungrouped orders should NOT be inserted. This is useful when you have groups like "asap" (must be served first) or "last" (must be served last) that should stay compact. For example, with free_insertion_exempt_groups: ["asap", "last"], ungrouped orders can be inserted freely between other groups, but not inside the "asap" or "last" groups, and not between start and "asap" or between "last" and end when using in_direct_sequence relations with these groups. - `algorithm` (object) Use objectives instead. - `algorithm.problem_type` (string) Enum: "min", "min-max" - `algorithm.objective` (string) Enum: "transport_time", "completion_time" ## Response 200 fields (application/json): - `copyrights` (array) Example: ["GraphHopper","OpenStreetMap contributors"] - `status` (string) Indicates the current status of the job Enum: "waiting_in_queue", "processing", "finished" - `waiting_time_in_queue` (integer) Waiting time in milliseconds. Example: 300000 - `processing_time` (integer) Processing time in ms. If job is still waiting in queue, processing_time is 0 Example: 900000 - `solution` (object) Only available if status field indicates finished. - `solution.distance` (integer) Overall distance traveled in meters, i.e. the sum of each route's transport distance. Example: 1200 - `solution.transport_time` (integer) Overall time travelled in seconds, i.e. the sum of each route's transport time. Example: 12000 - `solution.max_operation_time` (integer) Operation time of longest route in seconds. Example: 4000 - `solution.waiting_time` (integer) Overall waiting time in seconds. Example: 200 - `solution.service_duration` (integer) Overall service time in seconds. Example: 1200 - `solution.preparation_time` (integer) Overall preparation time in seconds. - `solution.setup_time` (integer) Overall setup time in seconds. - `solution.completion_time` (integer) Overall completion time in seconds, i.e. the sum of each route's operation time. Example: 12000 - `solution.no_vehicles` (integer) Number of employed vehicles. Example: 10 - `solution.no_unassigned` (integer) Number of jobs that could not be assigned to final solution. Example: 1 - `solution.routes` (array) An array of routes - `solution.routes.vehicle_id` (string) Id of vehicle that operates route Example: "driver-stefan" - `solution.routes.distance` (integer) Distance of route in meters. Example: 10000 - `solution.routes.transport_time` (integer) Transport time of route in seconds Example: 1800 - `solution.routes.completion_time` (integer) Completion time of route in seconds Example: 1800 - `solution.routes.waiting_time` (integer) Waiting time of route in seconds - `solution.routes.service_duration` (integer) Service duration of route in seconds - `solution.routes.preparation_time` (integer) Preparation time of route in seconds - `solution.routes.setup_time` (integer) Setup time of route in seconds - `solution.routes.activities` (array) Array of activities - `solution.routes.activities.type` (string) type of activity Enum: "start", "end", "service", "pickupShipment", "deliverShipment", "pickup", "delivery", "break" - `solution.routes.activities.id` (string) Id referring to the underlying service or shipment, i.e. the shipment or service this activity belongs to - `solution.routes.activities.name` (string) Human-readable name copied from the underlying service or shipment, if one was set on the request. Omitted for start/end activities and when the request did not specify a name. - `solution.routes.activities.location_id` (string) Id that refers to address - `solution.routes.activities.address` (object) Address of activity - `solution.routes.activities.address.location_id` (string) Specifies the id of the location. Example: "550e8400-e29b-11d4-a716-446655440000" - `solution.routes.activities.address.name` (string) Name of location. Example: "Queens Victoria Street 70, Second Floor, Flat 245" - `solution.routes.activities.address.lon` (number) Longitude of location. Example: -0.092869 - `solution.routes.activities.address.lat` (number) Latitude of location. Example: 51.512665 - `solution.routes.activities.address.street_hint` (string) Optional parameter. Specifies a hint for each address to better snap the coordinates (lon,lat) to road network. E.g. if there is an address or house with two or more neighboring streets you can control for which street the closest location is looked up. Example: "Queens Victoria Street 70" - `solution.routes.activities.address.snapped_waypoint` (object) Access point to the road network. It is only available if return_snapped_waypoints is true (by default it is false). - `solution.routes.activities.arr_time` (integer) Arrival time at this activity in seconds. If type is start, this is not available (since it makes no sense to have arr_time at start). However, end_time is available and actually means \"departure time\" at start location. It is important to note that arr_time does not necessarily mean \"start of underlying activity\", it solely means arrival time at activity location. If this activity has no time windows and if there are no further preparation times, arr_time is equal to activity start time. - `solution.routes.activities.end_time` (integer) End time of and thus departure time at this activity. If type is end, this is not available (since it makes no sense to have an end_time at end) end_time at each activity is equal to the departure time at the activity location. - `solution.routes.activities.end_date_time` (string) Translation of unix timestamp in end_time to end date time string with zone offset. It will be in the following ISO-8601 format: 2007-12-03T10:15:30+01:00. - `solution.routes.activities.arr_date_time` (string) Translation of unix timestamp in arr_time to arrival date time string with zone offset. It will be in the following ISO-8601 format: 2007-12-03T10:15:30+01:00. - `solution.routes.activities.waiting_time` (integer) Waiting time at this activity in seconds. A waiting time can occur if the activity has at least one time window. If arr_time < time_window.earliest a waiting time of time_window_earliest - arr_time occurs. - `solution.routes.activities.preparation_time` (integer) preparation time at this activity in seconds - `solution.routes.activities.setup_time` (integer) Setup time at this activity in seconds. Setup time is charged when the location differs from the previous activity, representing location overhead like dock check-in or security clearance. - `solution.routes.activities.distance` (integer) Cumulative distance from start to this activity in meters. - `solution.routes.activities.driving_time` (integer) Cumulative driving time from start to this activity in seconds. - `solution.routes.activities.load_before` (array) Array with size/capacity dimensions before this activity - `solution.routes.activities.load_after` (array) Array with size/capacity dimensions after this activity - `solution.routes.activities.priority` (integer) Priority copied from the underlying service or shipment (1 = highest, 10 = lowest, default 2). Omitted for start/end activities. - `solution.routes.activities.group` (string) Group identifier copied from the underlying activity (pickup or delivery side for shipments). Omitted for start/end activities and when the request did not specify a group. - `solution.routes.activities.time_window` (object) The time window the solver actually scheduled this activity into. Only present when the request specified at least one explicit, non-default time window for the activity; the trivial [0, MAX] window is suppressed. - `solution.routes.activities.time_window.earliest` (integer) Specifies the opening time of the time window in seconds, i.e. the earliest time the service can start. - `solution.routes.activities.time_window.latest` (integer) Specifies the closing time of the time window in seconds, i.e. the latest time the service can start. Omit this field to indicate no limit. - `solution.routes.points` (array) One entry for every vehicle - `solution.unassigned` (object) - `solution.unassigned.services` (array) An array of ids of unassigned services Example: ["service-1","service-3"] - `solution.unassigned.shipments` (array) An array of ids of unassigned shipments Example: ["shipment-5"] - `solution.unassigned.breaks` (array) An array of ids of unassigned breaks - `solution.unassigned.details` (array) An array of details, i.e. reason for unassigned services or shipments - `solution.unassigned.details.id` (string) Id of unassigned service/shipment - `solution.unassigned.details.code` (integer) Reason code (most likely reason). See reasons array for additional probable reasons. Code | Reason :------|:--------- 1 | cannot serve required skill 2 | cannot be visited within time window 3 | does not fit into any vehicle due to capacity 4 | cannot be assigned due to max distance constraint of vehicles 21 | could not be assigned due to relation constraint 22 | could not be assigned due to allowed vehicle constraint 23 | could not be assigned due to max-time-in-vehicle constraint 24 | driver does not need a break 25 | could not be assigned due to disallowed vehicle constraint 26 | could not be assigned due to max drive time constraint 27 | could not be assigned due to max job constraint 28 | could not be assigned due to max activity constraint 29 | could not be assigned due to group relation constraint 30 | could not be assigned due to driving time break 50 | underlying location cannot be accessed over road network by at least one vehicle 51 | location is isolated and cannot reach any other location over road network - `solution.unassigned.details.reason` (string) Human readable reason as listed above (most likely reason) - `solution.unassigned.details.reasons` (array) Array of probable reasons why this job could not be assigned, sorted by likelihood (most likely first). This provides more context than the single code/reason fields, which only show the most likely reason. For example, a job might fail due to a relation constraint (code 21), but the underlying cause could be a time window violation (code 2). In this case, both reasons would appear in this array. - `solution.unassigned.details.reasons.code` (integer) Reason code (see Detail.code for the full list of codes) - `solution.unassigned.details.reasons.reason` (string) Human readable reason - `solution.unassigned.activities` (array) Per-activity breakdown of every unassigned job. For each unassigned service there is exactly one entry; for each unassigned shipment there are two entries (one with type: "pickupShipment" and one with type: "deliverShipment"), both sharing the shipment id. Schedule-derived fields (arr_time, end_time, waiting_time, distance, driving_time, preparation_time, setup_time, load_before, load_after) are zero or omitted because the job was never placed on a route. The descriptive fields name, priority, and group are echoed from the original request when present, so consumers can render or audit unassigned stops without joining back to the request. time_window is omitted because the solver never picked one. - `solution.costs` (integer) - `solution.time` (integer) Use transport_time instead. ## Response 400 fields (application/json): - `message` (string) Short error message Example: "Bad Request" - `hints` (array) Optional error information. - `hints.message` (string) error message Example: "unsupported json property [vehiles]. allowed properties: [vehicles, vehicle_types, services, shipments, relations, algorithm, objectives, cost_matrices, configuration]" - `hints.details` (string) Details Example: "class java.lang.IllegalArgumentException" - `status` (string) status Example: "finished" ## Response 500 fields (application/json): - `code` (integer) Example: 500 - `message` (string) Details Example: "There has been an internal server error."