openapi: 3.0.0 info: title: LogisticsOS API Services description: > Powered by world's most powerful route optimization engine. Find out more at [https://logisticsos.com/](https://logisticsos.com/). version: '3.0' termsOfService: http://logisticsos.com/terms/ contact: email: support@logisticsos.com servers: - url: https://logisticsosapi.com tags: - name: Optimization APIs - name: Routing APIs paths: /vrp/v3: post: tags: - Optimization APIs summary: Vehicle Routing Problem operationId: OptimizationApIs_solveVrpProblem description: > Solve different types of vehicle routing problem (multi-vehicle route optimization), returns a `job_id` where you can check the job status and retrieve the result. requestBody: description: VRP problem to be solved required: true content: application/json: schema: $ref: '#/components/schemas/VrpRequest' responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -X POST -H "Content-Type: application/json" -H "x-api-key: ApiKeyAuth" \ https://logisticsosapi.com/vrp/v3 -d @request.json get: tags: - Optimization APIs summary: Vehicle Routing Problem Result operationId: vrp_result description: Return the optimization result in json format. parameters: - description: Job ID returned by `/vrp` POST. in: query name: job_id required: true schema: type: string responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '404': $ref: '#/components/responses/Response404' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -H "x-api-key: ApiKeyAuth" https://logisticsosapi.com/vrp/v3?job_id= /tsp/v3: post: tags: - Optimization APIs summary: Traveling Salesman Problem operationId: OptimizationApIs_solveTsp description: > Solve traveling salesman problem with various constraints (single-vehicle route optimization), returns a `job_id` where you can check the job status and retrieve the result. requestBody: description: TSP problem to be solved required: true content: application/json: schema: $ref: '#/components/schemas/TspRequest' responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -X POST -H "Content-Type: application/json" -H "x-api-key: ApiKeyAuth" \ https://logisticsosapi.com/tsp/v3 -d @request.json get: tags: - Optimization APIs summary: Traveling Salesman Problem Result operationId: tsp_result description: Return the optimization result in json format. parameters: - description: Job ID returned by `/tsp` POST. in: query name: job_id required: true schema: type: string responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '404': $ref: '#/components/responses/Response404' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -H "x-api-key: ApiKeyAuth" https://logisticsosapi.com/tsp/v3?job_id= /ondemand/v3: post: tags: - Optimization APIs summary: On-demand operationId: OptimizationApIs_assignOrders description: > Assign on-demand orders to existing drivers. Returns a `job_id` where you can check the job status and retrieve the result. requestBody: description: On-demand routing problem to be solved required: true content: application/json: schema: $ref: '#/components/schemas/OnDemandRequest' responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -X POST -H "Content-Type: application/json" -H "x-api-key: ApiKeyAuth" \ https://logisticsosapi.com/ondemand/v3 -d @request.json get: tags: - Optimization APIs summary: On-demand Result operationId: ondemand_result description: Return the optimization result in json format. parameters: - description: Job ID returned by `/ondemand` POST. in: query name: job_id required: true schema: type: string responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '404': $ref: '#/components/responses/Response404' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -H "x-api-key: ApiKeyAuth" https://logisticsosapi.com/ondemand/v3?job_id= /replan/v3: post: tags: - Optimization APIs summary: Replanning operationId: OptimizationApIs_replanRoutePlan description: > Re-optimize an exiting route plan. Returns a `job_id` where you can check the job status and retrieve the result. requestBody: description: Current route plan to be re-optimized. required: true content: application/json: schema: $ref: '#/components/schemas/ReplanRequest' responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -X POST -H "Content-Type: application/json" -H "x-api-key: ApiKeyAuth" \ https://logisticsosapi.com/replan/v3 -d @request.json get: tags: - Optimization APIs summary: Replanning Result operationId: replan_result description: Return the optimization result in json format. parameters: - description: Job ID returned by `/replan` POST. in: query name: job_id required: true schema: type: string responses: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '404': $ref: '#/components/responses/Response404' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -H "x-api-key: ApiKeyAuth" https://logisticsosapi.com/replan/v3?job_id= /route/v1: post: tags: - Routing APIs summary: Routing operationId: RoutingApIs_calculateRoute description: | Calculate route for a sequence of waypoints. requestBody: description: Sequence of waypoints to calculate route. required: true content: application/json: schema: $ref: '#/components/schemas/RoutingRequest' responses: '200': $ref: '#/components/responses/Response200Routing' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -X POST -H "Content-Type: application/json" -H "x-api-key: ApiKeyAuth" \ https://logisticsosapi.com/route/v1 -d @request.json /matrix/v1: post: tags: - Routing APIs summary: Matrix Routing operationId: RoutingApIs_calculateMatrix description: > Calculate a matrix of travel distances and durations between a list of locations. Small requests having less than 40,000 elements will be executed synchronously, and http return code will be 200 if succeeded. Larger requests will be executed asynchronously, and http return code will be 202. parameters: - description: > By default, Matrix Routing API returns result in JSON format. Alternatively, you can specify `application/octet-stream` in the `accept` HTTP header to request binary format, which might be preferred when you need faster parsing and smaller memory usage. in: header name: accept schema: type: string enum: - application/octet-stream - application/json default: application/json requestBody: description: List of locations to calculate travel distances and durations. required: true content: application/json: schema: $ref: '#/components/schemas/MatrixRoutingRequest' responses: '200': $ref: '#/components/responses/Response200MatrixRouting' '202': $ref: '#/components/responses/Response202' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -X POST -H "Content-Type: application/json" -H "x-api-key: ApiKeyAuth" \ https://logisticsosapi.com/matrix/v1 -d @request.json get: tags: - Routing APIs summary: Matrix Routing Result operationId: matrix_result description: > Return the Matrix Routing API result in units of meters and seconds. For more details regarding the format and error codes, please refer to the 200 response of the POST method. parameters: - description: Job ID returned by `/matrix` POST. in: query name: job_id required: true schema: type: string responses: '202': $ref: '#/components/responses/Response202' '303': $ref: '#/components/responses/Response303MatrixRouting' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '404': $ref: '#/components/responses/Response404' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -H "x-api-key: ApiKeyAuth" https://logisticsosapi.com/matrix/v1?job_id= /match/v1: post: tags: - Routing APIs summary: Map Matching operationId: RoutingApIs_calculateRoute description: | Calculate route from a list of GPS tracepoint. requestBody: description: List of GPS tracepoints to calculate route. required: true content: application/json: schema: $ref: '#/components/schemas/MapMatchingRequest' responses: '200': $ref: '#/components/responses/Response200MapMatching' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' x-codeSamples: - lang: curl source: > curl -X POST -H "Content-Type: application/json" -H "x-api-key: ApiKeyAuth" \ https://logisticsosapi.com/match/v1 -d @request.json components: responses: Response202: description: Job has been accepted. content: application/json: schema: $ref: '#/components/schemas/InProgressResponse' Response401: description: Missing or invalid API key content: application/json: schema: $ref: '#/components/schemas/VrpResultResponse' Response403: description: User does not have access to the API content: application/json: schema: $ref: '#/components/schemas/VrpResult403Response' Response404: description: Job ID does not exist content: application/json: schema: $ref: '#/components/schemas/VrpResult404Response' Response422: description: Request validation failed content: application/json: schema: $ref: '#/components/schemas/VrpResult422Response' Response500: description: Job failed due to unexpected server error content: application/json: schema: $ref: '#/components/schemas/FailedResponse5xx' Response502: description: Job failed due to bad response from backend server content: application/json: schema: $ref: '#/components/schemas/FailedResponse5xx' Response504: description: Job failed due to backend server timeout content: application/json: schema: $ref: '#/components/schemas/FailedResponse5xx' Response200Optimization: description: Job has finished successfully content: application/json: schema: $ref: '#/components/schemas/OptimizationResponse' Response400Optimization: description: Job failed due to client error content: application/json: schema: $ref: '#/components/schemas/FailedResponse400' Response200Routing: description: Request finished successfully content: application/json: schema: $ref: '#/components/schemas/RoutingResponse' Response200MatrixRouting: description: Request finished successfully content: application/json: schema: $ref: '#/components/schemas/MatrixRoutingResponseJSON' application/octet-stream: schema: $ref: '#/components/schemas/MatrixRoutingResponseBinary' Response303MatrixRouting: description: Request finished successfully content: application/json: schema: $ref: '#/components/schemas/MatrixResultResponse' headers: location: description: 303 redirect URL for the result. schema: type: string Response200MapMatching: description: Request finished successfully content: application/json: schema: $ref: '#/components/schemas/MapMatchingResponse' securitySchemes: ApiKeyAuth: type: apiKey in: header name: x-api-key schemas: Geometry: description: Specify the geographical information of this stop. type: object properties: lat: type: number minimum: -90 maximum: 90 lon: type: number minimum: -180 maximum: 180 curb: description: > Specifies the direction a vehicle may arrive at and depart from the order. If true, vehicle must stop at the closest curbside of this coordinate. type: boolean default: false required: - lat - lon ServiceNoConsumption: type: object properties: duration: description: The amount of time driver spends at this order. type: number default: 0 minimum: 0 pickup_quantities: description: > The size of the pickup. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. oneOf: - description: '' type: number default: 0 minimum: 0 - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 dropoff_quantities: description: > The size of the delivery. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. oneOf: - description: '' type: number default: 0 minimum: 0 - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 Service: type: object properties: duration: description: The amount of time driver spends at this order. type: number default: 0 minimum: 0 pickup_quantities: description: > The size of the pickup. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. oneOf: - description: '' type: number default: 0 minimum: 0 - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 dropoff_quantities: description: > The size of the delivery. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. oneOf: - description: '' type: number default: 0 minimum: 0 - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 consumption: description: > Consumption of vehicle's renewal capacity. This property can be either an integer or an array for multi-dimensions (up to 2) use case. oneOf: - description: '' type: integer default: 0 minimum: 0 maximum: 100000 - description: '' type: array items: type: integer minimum: 0 maximum: 100000 minItems: 2 maxItems: 2 TimeWindow: type: object properties: start: description: Time to visit this order no earlier than. type: number default: 0 minimum: 0 end: description: Time to visit this order no later than. type: number default: inf minimum: 0 BaseOrder: type: object properties: id: description: id of this order, has to be unique across all orders. type: string geometry: $ref: '#/components/schemas/Geometry' service: $ref: '#/components/schemas/Service' time_window: $ref: '#/components/schemas/TimeWindow' parking_time: description: > The parking time spent at this order. Orders with same location and delivered by same vehicle at the same time will share the same parking time, i.e., only applied once on first order. If vehicle also has a parking time, it will be added to order's parking time. type: number default: 0 minimum: 0 assignment_priority: description: > The priority level of this order to get assigned in whole optimization. E.g, orders with low order priority (bigger number) will not get assigned when there's not enough vehicles. type: number default: 3 minimum: 0 maximum: 3 sequence_priority: description: > Prioritize the visiting sequence of this order in a route. E.g, orders with high sequence priority (smaller number) will be visited earlier than orders that with low priority (bigger number) in the same route. Default is `null`, which means no priority relationship is specified. type: number minimum: 0 maximum: 9999 paired_order: description: > id of the order that has paired pickup and delivery relationships with current order. E.g, pickup from current order and then deliver to the paired order or verse visa. Such order pairs are guaranteed to be assigned to the same route and has first pickup and then delivery topology. type: string alternative_order: description: > id of the main order among all alternative orders. Only one of the alternative orders will be assigned. Can be used to defined multiple time windows, locations, etc. type: string next_order: description: id of the immediate next order to be visited. type: string BaseVehicleProps: type: object properties: speed_factor: description: > Specify a speed factor for this vehicle (types). It will be applied to the distance matrix. Cannot be used together with `average_speed`. type: number minimum: 0 maximum: 10 exclusiveMinimum: true average_speed: description: > Specify an average speed for this vehicle (types). A speed factor will be derived and applied to the distance matrix. Cannot be used together with `speed_factor`. type: number minimum: 0 exclusiveMinimum: true capacity: description: >- Capacity of the vehicle. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. At least one dimension should be non-zero. oneOf: - description: '' type: number default: inf minimum: 0 exclusiveMinimum: true - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 dispatch_after: description: Earliest time that this vehicle can be dispatched. type: number default: 0 minimum: 0 dismiss_before: description: Latest time that this vehicle must be dismissed. type: number default: inf minimum: 0 parking_time: description: Parking time for this vehicle at order location. type: number default: 0 minimum: 0 max_distance: description: Maximum distance the vehicle can travel. type: number default: inf minimum: 0 exclusiveMinimum: true max_travel_time: description: Maximum duration the vehicle can travel for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_total_time: description: Maximum duration the vehicle can be on duty for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_late_time: description: >- Maximum order time window violation the vehicle can have for the workday. type: number default: 0 minimum: 0 max_wait_time: description: >- Maximum wait time allowed for a vehicle to wait before an order time window. type: number default: inf minimum: 0 exclusiveMinimum: true RoutingProfile: type: object properties: name: description: name of the routing profile. type: string base_profile: description: > Specify a base profile from the default list, `[bicycle, car]`. Different base profile has different routing restrictions. type: string average_speed: description: > Specify an average speed for this routing profile. A speed factor will be derived and applied to the distance matrix. Cannot be used together with `speed_factor`. type: number minimum: 0 exclusiveMinimum: true speed_factor: description: > Specify a speed factor for this routing profile. It will be applied to the distance matrix. Cannot be used together with `average_speed`. type: number minimum: 0 maximum: 10 exclusiveMinimum: true required: - name - base_profile PolygonRestriction: type: object properties: id: description: id of this polygon. type: string geometries: description: nodes of this polygon. type: array items: type: object properties: lat: type: number minimum: -90 maximum: 90 lon: type: number minimum: -180 maximum: 180 minItems: 3 Units: description: > Specify units for all distance/duration based attribute values specified with different enums. type: object properties: distance: description: > Specify the distance units for all distance-based attribute values specified with different enums. type: string enum: - meter - kilometer - mile duration: description: > Specify the duration units for all duration-based attribute values specified with different enums. type: string enum: - second - minute - hour required: - distance - duration MapProviderAllowHere: description: Map provider for calculating OD matrix. type: string enum: - osm - here - tomtom default: osm MapProviderNoHere: description: Map provider for calculating OD matrix. type: string enum: - osm - tomtom default: osm VrpRequest: type: object properties: orders: description: Specify the orders the routes should visit. type: array items: $ref: '#/components/schemas/OrderVrp' minItems: 1 maxItems: 20000 start_depots: description: > Specify depots that vehicles depart from at the beginning of the workday. If not specified, route can start at any order. type: array items: $ref: '#/components/schemas/Depot' end_depots: description: > Specify depots that vehicles return to at the end of the workday. If not specified, route ends at last assigned order. type: array items: $ref: '#/components/schemas/Depot' breaks: description: > Specify any rest periods, or breaks, for all the routes in a given vehicle routing problem. type: array items: $ref: '#/components/schemas/Break' renewals: description: Specify renewal locations for vehicles to renew capacities. type: array items: $ref: '#/components/schemas/Renewal' vehicle_types: description: Specify groups of available vehicles. type: array items: $ref: '#/components/schemas/VehicleType' minItems: 1 maxItems: 1000 routing_profiles: description: > ~~Specify customized routing profiles.~~ This feature is deprecated, please use `average_speed` or `speed_factor` in `vehicle_types`. deprecated: true type: array items: $ref: '#/components/schemas/RoutingProfile' polygons: description: Specify polygon restrictions for vehicles. type: array items: $ref: '#/components/schemas/PolygonRestriction' maxItems: 100 solver_parameters: $ref: '#/components/schemas/SolverParamsVrp' units: $ref: '#/components/schemas/Units' od_location: description: > Url to a custom distance matrix. If provided, we will use it instead of calculating ourselves. The matrix can be in either JSON or binary format. For JSON format, it should be an object containing `base_profile` - `car` or `bicycle`, and the associated matrix objects. Matrix object has two one-dimension arrays - `durations` and `distances`, which represent the estimated travel time and distance in row-major order. `durations` should be in seconds, `distance` should be in meters. When calculating the matrix, the sequence of input locations (or origins) should be start depots, end depots, then orders. Below is an example of a 4x4 matrix containing both `car` and `bicycle` profile, ```json { "car": {"durations": [0,81,80,0], "distances": [0,622,622,0]}, "bicycle": {"durations": [0,158,157,0], "distances": [0,622,622,0]} } ``` For binary format, numbers should be stored in little-endian, where each matrix element consist of 2 4-bytes integers, representing the estimated travel time and distance. The units and sequence of input locations are same as JSON format. When having multiple `base_profile`, matrix values should be concatenated and sorted by the profile names. Using the JSON example, we would have ``. Note when having large distance matrix, it is recommended to compress the data before uploading. type: string maxLength: 1000 od_data_type: description: data type of the distance matrix provided in od_location type: string default: binary enum: - binary - json user_tags: description: > Define array of tags associated with this requests, which will be returned as-is in response. type: array items: type: string maxItems: 10 uniqueItems: true required: - orders - vehicle_types - units TimeWindowVrp: type: object properties: start: description: Time to visit this order no earlier than. type: number default: 0 minimum: 0 end: description: Time to visit this order no later than. type: number default: inf minimum: 0 depart_after: description: > Earliest possible time that vehicle visits this order shall depart from the start depot (e.g delivery perishable items). type: number default: 0 minimum: 0 return_before: description: > Latest possible time that vehicle visits this order shall return to the end depot (e.g boarding planes before given time). type: number default: inf minimum: 0 TimeWindowBreak: type: object properties: start: description: Time to take a break no earlier than. type: number minimum: 0 end: description: Time to take a break no later than. type: number minimum: 0 required: - start - end OrderVrp: type: object properties: id: description: id of this order, has to be unique across all orders. type: string geometry: $ref: '#/components/schemas/Geometry' service: $ref: '#/components/schemas/Service' time_window: $ref: '#/components/schemas/TimeWindowVrp' parking_time: description: > The parking time spent at this order. Orders with same location and delivered by same vehicle at the same time will share the same parking time, i.e., only applied once on first order. If vehicle also has a parking time, it will be added to order's parking time. type: number default: 0 minimum: 0 assignment_priority: description: > The priority level of this order to get assigned in whole optimization. E.g, orders with low order priority (bigger number) will not get assigned when there's not enough vehicles. type: number default: 3 minimum: 0 maximum: 3 sequence_priority: description: > Prioritize the visiting sequence of this order in a route. E.g, orders with high sequence priority (smaller number) will be visited earlier than orders that with low priority (bigger number) in the same route. Default is `null`, which means no priority relationship is specified. type: number minimum: 0 maximum: 9999 paired_order: description: > id of the order that has paired pickup and delivery relationships with current order. E.g, pickup from current order and then deliver to the paired order or verse visa. Such order pairs are guaranteed to be assigned to the same route and has first pickup and then delivery topology. type: string alternative_order: description: > id of the main order among all alternative orders. Only one of the alternative orders will be assigned. Can be used to defined multiple time windows, locations, etc. type: string next_order: description: id of the immediate next order to be visited. type: string cluster_label: description: > Orders with same cluster label will be put into same route (handled by same driver). type: string mx_label: description: > Mutually exclusive label, orders with different labels will not be put into same route. For example, you could segregate geographical zones with it. type: string is_unique: description: > If false, cost per order at this location will be ignored (at least 1 will be counted). type: boolean default: true capabilities: description: Array of vehicle capabilities that order requires. type: array items: type: string maxItems: 100 uniqueItems: true required: - id - geometry Depot: description: > Specify where the vehicle departs from or ends at. If not specified, route can start or end at any order. type: object properties: id: description: id of this depot, has to be unique across all depots. type: string geometry: $ref: '#/components/schemas/Geometry' service_duration: type: number default: 0 minimum: 0 time_window: $ref: '#/components/schemas/TimeWindow' required: - id - geometry Break: type: object properties: id: description: e.g "lunch_break". type: string duration: description: Specify the amount of time for this rest period or break. type: number minimum: 0 exclusiveMinimum: true max_working_time: description: Specify the max consecutive working time without the break. type: number minimum: 0 exclusiveMinimum: true time_window: $ref: '#/components/schemas/TimeWindowBreak' required: - id - duration Renewal: type: object properties: id: description: id of this renewal location. type: string geometry: $ref: '#/components/schemas/Geometry' duration: description: >- Specify the amount of time for vehicle to renew its capacity at this location. type: number default: 0 minimum: 0 required: - id - geometry CostParamsVrp: description: Specify cost parameters for this vehicle type. type: object properties: cost_per_order: description: cost for each completed order for this vehicle type. type: number default: 0 minimum: 0 cost_per_unit_quantity: description: cost for this vehicle type to service 1 unit quantity. oneOf: - type: number default: 0 minimum: 0 - type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 cost_per_unit_time: description: cost for this vehicle type to travel 1 unit time. type: number default: 1 minimum: 0 cost_per_unit_distance: description: cost for this vehicle type to travel 1 unit distance. type: number default: 0 minimum: 0 cost_per_overorder: description: >- cost for each completed order for this vehicle type when in overorder. type: number default: 0 minimum: 0 cost_per_unit_overtime: description: cost for this vehicle type to travel 1 unit time when in overtime. type: number default: 0 minimum: 0 cost_per_unit_overdistance: description: >- cost for this vehicle type to travel 1 unit distance when in overdistance. type: number default: 0 minimum: 0 fixed_cost: description: fixed cost to assign one vehicle with tasks. type: number default: 0 minimum: 0 distance_step_costs: description: > step costs based on distance ranges. The input is a list of 2-elements tuple: step and the associated cost. For example, assuming distance unit is km, then `[[5, 3], [10, 6]]` means 0-5 km is $3, and 5-10km is $6. Note that if the max step is less than vehicle's `max_distance`, we will assume max step to max distance has same cost of last defined step. Using above example, if vehicle's `max_distance` is 20km, then 10-20 km will be $6. type: array minItems: 2 maxItems: 10 items: type: array minItems: 2 maxItems: 2 items: description: >- WARNING: Missing items property in array schema. Missing items property has been filled with this AnyType schema. duration_step_costs: description: > step costs based on duration ranges. The input has same requirements as `distance_step_costs`. minItems: 2 maxItems: 10 items: type: array minItems: 2 maxItems: 2 items: description: >- WARNING: Missing items property in array schema. Missing items property has been filled with this AnyType schema. overorder_start: description: > Specify how many orders when overorder starts. e.g., a vehicle type may have a different cost when delivering more than 20 orders. type: number default: inf minimum: 0 exclusiveMinimum: true overtime_start: description: > Specify when overtime starts. e.g., a vehicle type may have 10 hours total time, and overtime starts from 8 hours. type: number default: inf minimum: 0 exclusiveMinimum: true overdistance_start: description: > Specify when overdistance starts. e.g., a vehicle type incurs extra cost when travelling over 50 miles. type: number default: inf minimum: 0 exclusiveMinimum: true RenewalParamsService: type: object properties: capacity: description: Service type renewal capacity. oneOf: - type: integer minimum: 0 maximum: 2000000000 exclusiveMinimum: true - type: array items: type: integer minimum: 0 maximum: 2000000000 minItems: 2 maxItems: 2 consumption_per_order: description: > Consumption of vehicle's renewal capacity per order. This property can be either an integer or an array for multi-dimensions (up to 2) use case. oneOf: - description: '' type: integer default: 0 minimum: 0 maximum: 100000 - description: '' type: array items: type: integer minimum: 0 maximum: 100000 minItems: 2 maxItems: 2 required: - capacity RenewalParamsTravel: type: object properties: capacity: description: > Travel type renewal capacity. At least one of `consumption_per_unit_distance` and `consumption_per_unit_duration` must be provided. type: number minimum: 0 exclusiveMinimum: true consumption_per_unit_distance: description: Consumption of vehicle's renewal capacity per unit distance. type: number minimum: 0 exclusiveMinimum: true consumption_per_unit_duration: description: > Consumption of vehicle's renewal capacity per unit duration, travel time only, i.e., excluding wait time and service time. type: number minimum: 0 exclusiveMinimum: true required: - capacity VehicleType: type: object properties: id: description: User input descriptor for this type of vehicle (e.g Minivan). type: string profile: description: >- Routing profile for the vehicle. Default profiles are `[car, bicycle]`, you can also use a custom profile defined in `routing_profiles` type: string default: car count: description: Specify number of available vehicles for this vehicle type. type: number default: inf minimum: 1 speed_factor: description: > Specify a speed factor for this vehicle (types). It will be applied to the distance matrix. Cannot be used together with `average_speed`. type: number minimum: 0 maximum: 10 exclusiveMinimum: true average_speed: description: > Specify an average speed for this vehicle (types). A speed factor will be derived and applied to the distance matrix. Cannot be used together with `speed_factor`. type: number minimum: 0 exclusiveMinimum: true capacity: description: >- Capacity of the vehicle. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. At least one dimension should be non-zero. oneOf: - description: '' type: number default: inf minimum: 0 exclusiveMinimum: true - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 dispatch_after: description: Earliest time that this vehicle can be dispatched. type: number default: 0 minimum: 0 dismiss_before: description: Latest time that this vehicle must be dismissed. type: number default: inf minimum: 0 parking_time: description: Parking time for this vehicle at order location. type: number default: 0 minimum: 0 max_distance: description: Maximum distance the vehicle can travel. type: number default: inf minimum: 0 exclusiveMinimum: true max_travel_time: description: Maximum duration the vehicle can travel for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_total_time: description: Maximum duration the vehicle can be on duty for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_late_time: description: >- Maximum order time window violation the vehicle can have for the workday. type: number default: 0 minimum: 0 max_wait_time: description: >- Maximum wait time allowed for a vehicle to wait before an order time window. type: number default: inf minimum: 0 exclusiveMinimum: true max_pickup_quantities: description: Maximum size of accumulated pickup for the workday. oneOf: - type: number default: 0 minimum: 0 - type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 max_dropoff_quantities: description: Maximum size of accumulated dropoff for the workday. oneOf: - type: number default: 0 minimum: 0 - type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 max_orders_per_route: description: > Maximum number of orders the vehicle can service per trip. Default is `100`. `Warning: lifting this constraint will significantly affect the performance.` type: number default: 100 minimum: 0 exclusiveMinimum: true min_orders_per_route: description: > Minimum number of orders the vehicle can service per trip. Note this is a soft constraint, solver will try hard to respect this constraint if possible, however, total cost may increase. type: number default: 0 minimum: 0 max_waypoints_per_route: description: > Maximum number of waypoints, defined as unique (lat, lon, timepoint), the vehicle can visit for the workday. type: number default: inf minimum: 2 exclusiveMinimum: true avoid_wait_time: description: >- Try to avoid wait time at each stop. May increase total travel time and distance. type: boolean default: false multi_dispatch: description: > Allow this vehicle type to be dispatched again after returning to depot. In each dispatch, `capacity` and `max_orders_per_route` will be reset. type: boolean default: false use_all_vehicles: description: > If solver dispatchs this vehicle type, setting this value to `true` will dispatch all available vehicles. type: boolean default: false start_depot: description: > Start_depot id. Set to `any` for start depot automation, set to `none` to start from any order. oneOf: - type: string default: any - type: array uniqueItems: true items: description: >- WARNING: Missing items property in array schema. Missing items property has been filled with this AnyType schema. end_depot: description: > End_depot id. Set to `any` for end depot automation, set to `none` for open end routing. oneOf: - type: string default: any - type: array uniqueItems: true items: description: >- WARNING: Missing items property in array schema. Missing items property has been filled with this AnyType schema. break_ids: description: Break_ids that defined in break items, e.g "lunch_break". type: array items: type: string maxItems: 5 uniqueItems: true capabilities: description: Array of capabilities that vehicle has. type: array items: type: string maxItems: 100 uniqueItems: true allowed_polygons: description: >- Only assign orders inside the specified polygons to this vehicle type. type: array items: type: string maxItems: 100 uniqueItems: true disallowed_polygons: description: >- Only assign orders outside the specified polygons to this vehicle type. type: array items: type: string maxItems: 100 uniqueItems: true cost_params: $ref: '#/components/schemas/CostParamsVrp' renewal_params: description: Renewals related parameters. oneOf: - $ref: '#/components/schemas/RenewalParamsService' - $ref: '#/components/schemas/RenewalParamsTravel' required: - id SolverParamsVrp: type: object properties: map_provider: $ref: '#/components/schemas/MapProviderAllowHere' traffic_type: description: > ~~Specify which traffic type to use. Not available with OpenStreetMap.~~ This parameter is no longer used. Specify a `traffic_time` in the past will imply `historical`, while a time in the future will imply `predictive`. deprecated: true type: string enum: - historical - predictive traffic_time: description: >- Specify the time point in ISO 8601 format for traffic query. For example, `2021-01-01T14:00:00-08:00` means 2021 Jan 1st, 2PM, UTC-08:00. If not specified, current time is used. Not available with OpenStreetMap. type: string snap_distance: description: > Specify the maximum distance to snap unroutable locations to nearest road network. type: number minimum: 0 exclusiveMinimum: true search_level: description: > Specify search level for optimization, from 0 to 2, default to 1. Setting to 0 will greatly reduce solver time but make solution quality worse. Setting to 2 will improve solution quality at the cost of increasing solver time. type: number default: 1 minimum: 0 maximum: 2 clustering_level: description: > Specify clustering level for optimization, from 0 to 2, default to 0, which means reducing overall cost is the highest priority. Setting to 1 will greatly increase cluster quality while also trying to minimize overall cost increase. Setting to 2 will further increase cluster quality but without a guarantee how much overall cost may increase. type: number default: 0 minimum: 0 maximum: 2 avoid_tolls: type: boolean default: false exhaustive_search: description: > ~~Further improve solution quality at the cost of increasing solver time.~~ This feature is deprecated, please use `search_level` instead. deprecated: true type: boolean default: false high_quality_cluster: description: > ~~Further improve cluster quality at the cost of using more vehicles or increasing travel time.~~ This feature is deprecated, please use `clustering_level` instead. deprecated: true type: boolean default: false balance_routes: description: > Balance routes between same vehicle type. May affect clustering quality and increase cost. type: boolean default: false soft_cluster_label: description: > When set to `true`, `cluster_label` will become a soft constraint, which suggest (instead of forcing) the solver to put orders with same `cluster_label` into same route. type: boolean default: false soft_capabilities: description: > Capabilities are hard constraints by default. However, you can specify them here to be soft constraints, i.e., it can be dropped when no matching vehicle can be found. type: array items: type: array items: type: string renewal_type: description: > Specify the renewal type, consumption will have different meanings depending on this value. For example, when set to `travel`, consumption is based on travel distance and duration. A common use case is EV charging, where the renewal capacity corresponds to the battery capacity, and consumption is based on travel distance. If set to `service`, consumption will occur on a per-order basis. A typical scenario is waste collection, where the vehicle will dump at renewal points when its capacity is fully consumed. type: string enum: - travel - service TspRequest: type: object properties: orders: description: Specify new orders to be assigned. type: array items: $ref: '#/components/schemas/OrderTsp' minItems: 1 maxItems: 500 vehicle: $ref: '#/components/schemas/VehicleTsp' start_depot: $ref: '#/components/schemas/Depot' end_depot: $ref: '#/components/schemas/Depot' breaks: description: > Specify any rest periods, or breaks, for all the routes in a given vehicle routing problem. type: array items: $ref: '#/components/schemas/Break' renewals: description: Specify renewal locations for vehicles to renew capacities. type: array items: $ref: '#/components/schemas/Renewal' routing_profile: description: > ~~Specify customized routing profile.~~ This feature is deprecated, please use `average_speed` or `speed_factor` in `vehicle`. deprecated: true type: object properties: name: description: name of the routing profile. type: string base_profile: description: > Specify a base profile from the default list, `[bicycle, car]`. Different base profile has different routing restrictions. type: string average_speed: description: > Specify an average speed for this routing profile. A speed factor will be derived and applied to the distance matrix. Cannot be used together with `speed_factor`. type: number minimum: 0 exclusiveMinimum: true speed_factor: description: > Specify a speed factor for this routing profile. It will be applied to the distance matrix. Cannot be used together with `average_speed`. type: number minimum: 0 maximum: 10 exclusiveMinimum: true required: - name - base_profile solver_parameters: $ref: '#/components/schemas/SolverParamsTsp' units: $ref: '#/components/schemas/Units' user_tags: description: > Define array of tags associated with this requests, which will be returned as-is in response. type: array items: type: string maxItems: 10 uniqueItems: true required: - orders - vehicle - units OrderTsp: type: object properties: id: description: id of this order, has to be unique across all orders. type: string geometry: $ref: '#/components/schemas/Geometry' service: $ref: '#/components/schemas/Service' time_window: $ref: '#/components/schemas/TimeWindow' parking_time: description: > The parking time spent at this order. Orders with same location and delivered by same vehicle at the same time will share the same parking time, i.e., only applied once on first order. If vehicle also has a parking time, it will be added to order's parking time. type: number default: 0 minimum: 0 assignment_priority: description: > The priority level of this order to get assigned in whole optimization. E.g, orders with low order priority (bigger number) will not get assigned when there's not enough vehicles. type: number default: 3 minimum: 0 maximum: 3 sequence_priority: description: > Prioritize the visiting sequence of this order in a route. E.g, orders with high sequence priority (smaller number) will be visited earlier than orders that with low priority (bigger number) in the same route. Default is `null`, which means no priority relationship is specified. type: number minimum: 0 maximum: 9999 paired_order: description: > id of the order that has paired pickup and delivery relationships with current order. E.g, pickup from current order and then deliver to the paired order or verse visa. Such order pairs are guaranteed to be assigned to the same route and has first pickup and then delivery topology. type: string alternative_order: description: > id of the main order among all alternative orders. Only one of the alternative orders will be assigned. Can be used to defined multiple time windows, locations, etc. type: string next_order: description: id of the immediate next order to be visited. type: string required: - id - geometry CostParamsTsp: description: Specify cost parameters for this vehicle type. type: object properties: cost_per_unit_time: description: cost for this vehicle type to travel 1 unit time. type: number default: 1 minimum: 0 cost_per_unit_distance: description: cost for this vehicle type to travel 1 unit distance. type: number default: 0 minimum: 0 VehicleTsp: description: Vehicle for this route. type: object properties: id: description: User input descriptor for this vehicle. type: string profile: description: >- Routing profile for the vehicle. Default profiles are `[car, bicycle]`, you can also use a custom profile defined in `routing_profiles` type: string default: car speed_factor: description: > Specify a speed factor for this vehicle (types). It will be applied to the distance matrix. Cannot be used together with `average_speed`. type: number minimum: 0 maximum: 10 exclusiveMinimum: true average_speed: description: > Specify an average speed for this vehicle (types). A speed factor will be derived and applied to the distance matrix. Cannot be used together with `speed_factor`. type: number minimum: 0 exclusiveMinimum: true capacity: description: >- Capacity of the vehicle. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. At least one dimension should be non-zero. oneOf: - description: '' type: number default: inf minimum: 0 exclusiveMinimum: true - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 dispatch_after: description: Earliest time that this vehicle can be dispatched. type: number default: 0 minimum: 0 dismiss_before: description: Latest time that this vehicle must be dismissed. type: number default: inf minimum: 0 parking_time: description: Parking time for this vehicle at order location. type: number default: 0 minimum: 0 max_distance: description: Maximum distance the vehicle can travel. type: number default: inf minimum: 0 exclusiveMinimum: true max_travel_time: description: Maximum duration the vehicle can travel for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_total_time: description: Maximum duration the vehicle can be on duty for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_late_time: description: >- Maximum order time window violation the vehicle can have for the workday. type: number default: 0 minimum: 0 max_wait_time: description: >- Maximum wait time allowed for a vehicle to wait before an order time window. type: number default: inf minimum: 0 exclusiveMinimum: true avoid_wait_time: description: >- Try to avoid wait time at each stop. May increase total travel time and distance. type: boolean default: false cost_params: $ref: '#/components/schemas/CostParamsTsp' renewal_params: description: Renewals related parameters. oneOf: - $ref: '#/components/schemas/RenewalParamsService' - $ref: '#/components/schemas/RenewalParamsTravel' required: - id SolverParamsTsp: type: object properties: map_provider: $ref: '#/components/schemas/MapProviderAllowHere' traffic_type: description: > ~~Specify which traffic type to use. Not available with OpenStreetMap.~~ This parameter is no longer used. Specify a `traffic_time` in the past will imply `historical`, while a time in the future will imply `predictive`. deprecated: true type: string enum: - historical - predictive traffic_time: description: >- Specify the time point in ISO 8601 format for traffic query. For example, `2021-01-01T14:00:00-08:00` means 2021 Jan 1st, 2PM, UTC-08:00. If not specified, current time is used. Not available with OpenStreetMap. type: string snap_distance: description: >- Specify the maximum distance to snap unroutable locations to nearest road network. type: number avoid_tolls: type: boolean default: false renewal_type: description: > Specify the renewal type, consumption will have different meanings depending on this value. For example, when set to `travel`, consumption is based on travel distance and duration. A common use case is EV charging, where the renewal capacity corresponds to the battery capacity, and consumption is based on travel distance. If set to `service`, consumption will occur on a per-order basis. A typical scenario is waste collection, where the vehicle will dump at renewal points when its capacity is fully consumed. type: string enum: - travel - service OnDemandRequest: type: object properties: current_routes: description: Specify current routes that's already planned. type: array items: $ref: '#/components/schemas/CurrentRoute' minItems: 1 maxItems: 500 orders: description: Specify new orders to be assigned. type: array items: $ref: '#/components/schemas/OrderOnDemand' minItems: 1 maxItems: 500 routing_profiles: description: > ~~Specify customized routing profiles.~~ This feature is deprecated, please use `average_speed` or `speed_factor` in `current_routes.[].vehicle`. deprecated: true type: array items: $ref: '#/components/schemas/RoutingProfile' polygons: description: Specify polygon restrictions for vehicles. type: array items: $ref: '#/components/schemas/PolygonRestriction' maxItems: 100 solver_parameters: $ref: '#/components/schemas/SolverParamsOnDemand' units: $ref: '#/components/schemas/Units' user_tags: description: > Define array of tags associated with this requests, which will be returned as-is in response. type: array items: type: string maxItems: 10 uniqueItems: true required: - current_routes - orders - units OrderOnDemand: type: object properties: id: description: id of this order, has to be unique across all orders. type: string geometry: $ref: '#/components/schemas/Geometry' service: $ref: '#/components/schemas/ServiceNoConsumption' time_window: $ref: '#/components/schemas/TimeWindow' parking_time: description: > The parking time spent at this order. Orders with same location and delivered by same vehicle at the same time will share the same parking time, i.e., only applied once on first order. If vehicle also has a parking time, it will be added to order's parking time. type: number default: 0 minimum: 0 assignment_priority: description: > The priority level of this order to get assigned in whole optimization. E.g, orders with low order priority (bigger number) will not get assigned when there's not enough vehicles. type: number default: 3 minimum: 0 maximum: 3 sequence_priority: description: > Prioritize the visiting sequence of this order in a route. E.g, orders with high sequence priority (smaller number) will be visited earlier than orders that with low priority (bigger number) in the same route. Default is `null`, which means no priority relationship is specified. type: number minimum: 0 maximum: 9999 paired_order: description: > id of the order that has paired pickup and delivery relationships with current order. E.g, pickup from current order and then deliver to the paired order or verse visa. Such order pairs are guaranteed to be assigned to the same route and has first pickup and then delivery topology. type: string alternative_order: description: > id of the main order among all alternative orders. Only one of the alternative orders will be assigned. Can be used to defined multiple time windows, locations, etc. type: string next_order: description: id of the immediate next order to be visited. type: string cluster_label: description: > Orders with same cluster label will be put into same route (handled by same driver). type: string mx_label: description: > Mutually exclusive label, orders with different labels will not be put into same route. For example, you could segregate geographical zones with it. type: string is_unique: description: > If false, cost per order at this location will be ignored (at least 1 will be counted). type: boolean default: true capabilities: description: Array of vehicle capabilities that order requires. type: array items: type: string maxItems: 100 uniqueItems: true disallowed_vehicles: description: Array of vehicles not allowed to take this order. type: array items: type: string maxItems: 100 uniqueItems: true max_adjacent_distance: description: > Maximum distance from previous and next stop (excluding end depot) to assign this order. type: number minimum: 0 exclusiveMinimum: true required: - id - geometry CurrentRouteStop: type: object properties: id: description: id of this order, has to be unique across all orders. type: string type: description: Type of this stop. type: string enum: - order - start_depot - end_depot lock_vehicle: description: If false, solver is allowed to transfer this order to other vehicle. type: boolean default: true geometry: $ref: '#/components/schemas/Geometry' service: $ref: '#/components/schemas/ServiceNoConsumption' time_window: $ref: '#/components/schemas/TimeWindow' parking_time: description: > The parking time spent at this order. Orders with same location and delivered by same vehicle at the same time will share the same parking time, i.e., only applied once on first order. If vehicle also has a parking time, it will be added to order's parking time. type: number default: 0 minimum: 0 assignment_priority: description: > The priority level of this order to get assigned in whole optimization. E.g, orders with low order priority (bigger number) will not get assigned when there's not enough vehicles. type: number default: 3 minimum: 0 maximum: 3 sequence_priority: description: > Prioritize the visiting sequence of this order in a route. E.g, orders with high sequence priority (smaller number) will be visited earlier than orders that with low priority (bigger number) in the same route. Default is `null`, which means no priority relationship is specified. type: number minimum: 0 maximum: 9999 paired_order: description: > id of the order that has paired pickup and delivery relationships with current order. E.g, pickup from current order and then deliver to the paired order or verse visa. Such order pairs are guaranteed to be assigned to the same route and has first pickup and then delivery topology. type: string alternative_order: description: > id of the main order among all alternative orders. Only one of the alternative orders will be assigned. Can be used to defined multiple time windows, locations, etc. type: string next_order: description: id of the immediate next order to be visited. type: string cluster_label: description: > Orders with same cluster label will be put into same route (handled by same driver). type: string mx_label: description: > Mutually exclusive label, orders with different labels will not be put into same route. For example, you could segregate geographical zones with it. type: string is_unique: description: > If false, cost per order at this location will be ignored (at least 1 will be counted). type: boolean default: true capabilities: description: Array of vehicle capabilities that order requires. type: array items: type: string maxItems: 100 uniqueItems: true disallowed_vehicles: description: Array of vehicles not allowed to take this order. type: array items: type: string maxItems: 100 uniqueItems: true max_adjacent_distance: description: > Maximum distance from previous and next stop (excluding end depot) to assign this order. type: number minimum: 0 exclusiveMinimum: true required: - type - id CurrentRouteBreak: type: object properties: id: description: id of a break stop type: string type: description: Type of this stop. type: string enum: - break time_window: $ref: '#/components/schemas/TimeWindowBreak' duration: description: Specify the amount of time for this rest period or break. type: number minimum: 0 exclusiveMinimum: true required: - id - type - time_window - duration CurrentRoute: type: object properties: vehicle: $ref: '#/components/schemas/VehicleOnDemand' stops: type: array items: oneOf: - $ref: '#/components/schemas/CurrentRouteStop' - $ref: '#/components/schemas/CurrentRouteBreak' minItems: 1 maxItems: 500 lock_first_n_orders: description: Lock the visiting sequence of first N orders. type: number default: 0 max_incremental_distance: description: > Assigning new orders should not increase the total distance more than this threshold. type: number default: inf minimum: 0 exclusiveMinimum: true is_reducible: description: If true and no orders are locked, this route can be optimized away. type: boolean default: false required: - vehicle - stops CostParamsOnDemand: description: Specify cost parameters for this vehicle type. type: object properties: cost_per_order: description: cost for each completed order for this vehicle type. type: number default: 0 minimum: 0 cost_per_unit_quantity: description: cost for this vehicle type to service 1 unit quantity. oneOf: - type: number default: 0 minimum: 0 - type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 cost_per_unit_time: description: cost for this vehicle type to travel 1 unit time. type: number default: 1 minimum: 0 cost_per_unit_distance: description: cost for this vehicle type to travel 1 unit distance. type: number default: 0 minimum: 0 cost_per_overorder: description: >- cost for each completed order for this vehicle type when in overorder. type: number default: 0 minimum: 0 cost_per_unit_overtime: description: cost for this vehicle type to travel 1 unit time when in overtime. type: number default: 0 minimum: 0 cost_per_unit_overdistance: description: >- cost for this vehicle type to travel 1 unit distance when in overdistance. type: number default: 0 minimum: 0 cost_per_unit_late_time: description: >- extra cost for this vehicle type to travel 1 unit time when in late time. type: number minimum: 0 fixed_cost: description: fixed cost to assign one vehicle with tasks. type: number default: 0 minimum: 0 overorder_start: description: > Specify how many orders when overorder starts. e.g., a vehicle type may have a different cost when delivering more than 20 orders. type: number default: inf minimum: 0 exclusiveMinimum: true overtime_start: description: > Specify when overtime starts. e.g., a vehicle type may have 10 hours total time, and overtime starts from 8 hours. type: number default: inf minimum: 0 exclusiveMinimum: true overdistance_start: description: > Specify when overdistance starts. e.g., a vehicle type incurs extra cost when travelling over 50 miles. type: number default: inf minimum: 0 exclusiveMinimum: true VehicleOnDemand: description: Vehicle for this route. type: object properties: id: description: User input descriptor for this vehicle. type: string profile: description: >- Routing profile for the vehicle. Default profiles are `[car, bicycle]`, you can also use a custom profile defined in `routing_profiles` type: string default: car speed_factor: description: > Specify a speed factor for this vehicle (types). It will be applied to the distance matrix. Cannot be used together with `average_speed`. type: number minimum: 0 maximum: 10 exclusiveMinimum: true average_speed: description: > Specify an average speed for this vehicle (types). A speed factor will be derived and applied to the distance matrix. Cannot be used together with `speed_factor`. type: number minimum: 0 exclusiveMinimum: true capacity: description: >- Capacity of the vehicle. This property can also be specified in multiple dimensions (up to 4) with an array, such as weight, volume, and quantity. At least one dimension should be non-zero. oneOf: - description: '' type: number default: inf minimum: 0 exclusiveMinimum: true - description: '' type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 dispatch_after: description: Earliest time that this vehicle can be dispatched. type: number default: 0 minimum: 0 dismiss_before: description: Latest time that this vehicle must be dismissed. type: number default: inf minimum: 0 parking_time: description: Parking time for this vehicle at order location. type: number default: 0 minimum: 0 max_distance: description: Maximum distance the vehicle can travel. type: number default: inf minimum: 0 exclusiveMinimum: true max_travel_time: description: Maximum duration the vehicle can travel for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_total_time: description: Maximum duration the vehicle can be on duty for the workday. type: number default: inf minimum: 0 exclusiveMinimum: true max_late_time: description: >- Maximum order time window violation the vehicle can have for the workday. type: number default: 0 minimum: 0 max_wait_time: description: >- Maximum wait time allowed for a vehicle to wait before an order time window. type: number default: inf minimum: 0 exclusiveMinimum: true max_pickup_quantities: description: Maximum size of accumulated pickup for the workday. oneOf: - type: number default: 0 minimum: 0 - type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 max_dropoff_quantities: description: Maximum size of accumulated dropoff for the workday. oneOf: - type: number default: 0 minimum: 0 - type: array items: type: number minimum: 0 minItems: 2 maxItems: 4 max_orders_per_route: description: > Maximum number of orders the vehicle can visit for the workday. Default is `100`. `Warning: lifting this constraint will significantly affect the performance.` type: number default: 100 minimum: 0 exclusiveMinimum: true min_orders_per_route: description: > Minimum number of orders the vehicle can service per trip. Note this is a soft constraint, solver will try hard to respect this constraint if possible, however, total cost may increase. type: number default: 0 minimum: 0 max_waypoints_per_route: description: > Maximum number of waypoints, defined as unique (lat, lon, timepoint), the vehicle can visit for the workday. type: number default: inf minimum: 2 exclusiveMinimum: true avoid_wait_time: description: >- Try to avoid wait time at each stop. May increase total travel time and distance. type: boolean default: false capabilities: description: Array of capabilities that vehicle has. type: array items: type: string maxItems: 100 uniqueItems: true allowed_polygons: description: >- Only assign orders inside the specified polygons to this vehicle type. type: array items: type: string maxItems: 100 uniqueItems: true disallowed_polygons: description: >- Only assign orders outside the specified polygons to this vehicle type. type: array items: type: string maxItems: 100 uniqueItems: true cost_params: $ref: '#/components/schemas/CostParamsOnDemand' required: - id SolverParamsOnDemand: type: object properties: map_provider: $ref: '#/components/schemas/MapProviderNoHere' traffic_time: description: >- Specify the time point in ISO 8601 format for traffic query. For example, `2021-01-01T14:00:00-08:00` means 2021 Jan 1st, 2PM, UTC-08:00. If not specified, current time is used. Not available with OpenStreetMap. type: string snap_distance: description: >- Specify the maximum distance to snap unroutable locations to nearest road network. type: number search_level: description: > Specify search level for optimization, from 0 to 2, default to 1. Setting to 0 will greatly reduce solver time but make solution quality worse. Setting to 2 will improve solution quality at the cost of increasing solver time. type: number default: 1 minimum: 0 maximum: 2 avoid_tolls: type: boolean default: false exhaustive_search: description: > ~~Further improve solution quality at the cost of increasing solver time.~~ This feature is deprecated, please use `search_level` instead. deprecated: true type: boolean default: false soft_capabilities: description: > Capabilities are hard constraints by default. However, you can specify them here to be soft constraints, i.e., it can be dropped when no matching vehicle can be found. type: array items: type: array items: type: string ReplanRequest: type: object properties: current_routes: description: Specify current routes that's already planned. type: array items: $ref: '#/components/schemas/CurrentRoute' minItems: 1 maxItems: 500 routing_profiles: description: > ~~Specify customized routing profiles.~~ This feature is deprecated, please use `average_speed` or `speed_factor` in `current_routes.[].vehicle`. deprecated: true type: array items: $ref: '#/components/schemas/RoutingProfile' solver_parameters: $ref: '#/components/schemas/SolverParamsReplan' units: $ref: '#/components/schemas/Units' user_tags: description: > Define array of tags associated with this requests, which will be returned as-is in response. type: array items: type: string maxItems: 10 uniqueItems: true required: - current_routes - units SolverParamsReplan: type: object properties: map_provider: $ref: '#/components/schemas/MapProviderAllowHere' traffic_time: description: >- Specify the time point in ISO 8601 format for traffic query. For example, `2021-01-01T14:00:00-08:00` means 2021 Jan 1st, 2PM, UTC-08:00. If not specified, current time is used. Not available with OpenStreetMap. type: string snap_distance: description: >- Specify the maximum distance to snap unroutable locations to nearest road network. type: number search_level: description: > Specify search level for optimization, from 0 to 2, default to 1. Setting to 0 will greatly reduce solver time but make solution quality worse. Setting to 2 will improve solution quality at the cost of increasing solver time. type: number default: 1 minimum: 0 maximum: 2 avoid_tolls: type: boolean default: false exhaustive_search: description: > ~~Further improve solution quality at the cost of increasing solver time.~~ This feature is deprecated, please use `search_level` instead. deprecated: true type: boolean default: false RoutingRequest: type: object properties: parameters: $ref: '#/components/schemas/SolverParamsRouting' locations: description: Specify sequence of waypoints. type: array items: $ref: '#/components/schemas/Geometry' minItems: 1 maxItems: 200 required: - locations SolverParamsRouting: description: Parameters of Routing API. type: object properties: map_provider: $ref: '#/components/schemas/MapProviderNoHere' profile: description: >- Specify a routing profile from the list, `[bicycle, car]`. Default is `car`. type: string traffic_time: description: >- Specify the time point in ISO 8601 format for traffic query. For example, `2021-01-01T14:00:00-08:00` means 2021 Jan 1st, 2PM, UTC-08:00. If not specified, current time is used. Not available with OpenStreetMap. type: string snap_distance: description: >- Specify the maximum distance to snap unroutable locations to nearest road network. type: number avoid_tolls: description: Specify true to avoid toll roads. type: boolean default: false alternatives: description: >- Specify number of alternative routes returned. Default is 0, which means only optimal route is returned. Actual number of routes returned may be fewer than specified number if it's larger than the service calculated. type: number default: 0 minimum: 0 maximum: 2 MatrixRoutingRequest: type: object properties: parameters: $ref: '#/components/schemas/SolverParamsMatrixRouting' origins: description: Specify list of origins. type: array items: $ref: '#/components/schemas/Geometry' minItems: 1 maxItems: 20000 destinations: description: Specify list of destinations. type: array items: $ref: '#/components/schemas/Geometry' minItems: 1 maxItems: 20000 required: - origins SolverParamsMatrixRouting: description: Parameters of Matrix Routing API. type: object properties: map_provider: $ref: '#/components/schemas/MapProviderNoHere' profile: description: >- Specify a routing profile from the list, `[bicycle, car]`. Default is `car`. type: string speed_factor: description: > Specify a speed factor for this routing profile. It will be applied to the distance matrix. Cannot be used together with `average_speed`. type: number minimum: 0 maximum: 10 exclusiveMinimum: true average_speed: description: > Specify an average speed for this routing profile. A speed factor will be derived and applied to the distance matrix. Cannot be used together with `speed_factor`. type: number minimum: 0 exclusiveMinimum: true traffic_time: description: >- Specify the time point in ISO 8601 format for traffic query. For example, `2021-01-01T14:00:00-08:00` means 2021 Jan 1st, 2PM, UTC-08:00. If not specified, current time is used. Not available with OpenStreetMap. type: string snap_distance: description: >- Specify the maximum distance to snap unroutable locations to nearest road network. type: number avoid_tolls: description: Specify true to avoid toll roads. type: boolean default: false MapMatchingRequest: type: object properties: parameters: $ref: '#/components/schemas/SolverParamsMapMatching' waypoints: description: Specify list of GPS tracepoints. type: array items: $ref: '#/components/schemas/MapMatchingTracepoint' minItems: 1 required: - waypoints MapMatchingTracepoint: type: object properties: lat: type: number minimum: -90 maximum: 90 lon: type: number minimum: -180 maximum: 180 curb: description: > Specifies the direction a vehicle may arrive at and depart from the order. If true, vehicle must stop at the closest curbside of this coordinate. type: boolean default: false radius: type: number minimum: 1 maximum: 100 timestamp: type: number minimum: 0 required: - lat - lon SolverParamsMapMatching: description: Parameters of Map Matching API. type: object properties: map_provider: $ref: '#/components/schemas/MapProviderNoHere' profile: description: >- Specify a routing profile from the list, `[bicycle, car]`. Default is `car`. type: string InProgressResponse: type: object properties: job_id: description: ID assigned to this job, can be used to fetch the result. type: string status: description: status of this job type: string enum: - IN_QUEUE - IN_PROGRESS message: description: status message type: string FailedResponse400: type: object properties: job_id: description: ID assigned to this job, can be used to fetch the result. type: string status: description: status of this job type: string enum: - FAILED message: description: error message type: string reasons: description: array of failed reasons type: array items: type: string details: $ref: '#/components/schemas/ViolationDetails' warnings: description: array of warnings type: array items: type: string FailedResponse5xx: type: object properties: job_id: description: ID assigned to this job, can be used to fetch the result. type: string status: description: status of this job type: string enum: - FAILED message: description: error message type: string OptimizationResponse: type: object properties: job_id: description: ID assigned to this job, can be used to fetch the result. type: string status: description: status of this job type: string enum: - SUCCEED solver_time: description: Time elapsed in route optimization in seconds. type: string plan_summary: $ref: '#/components/schemas/OptimizationSummary' routes: type: array items: $ref: '#/components/schemas/Route' unassigned: description: List of unassigned orders. type: array items: $ref: '#/components/schemas/UnassignedStop' units: $ref: '#/components/schemas/Units' user_tags: type: array items: type: string warnings: description: List of warnings found. type: array items: type: string OptimizationSummary: type: object properties: distance: type: number total_time: type: number travel_time: type: number wait_time: type: number late_time: type: number service_time: type: number num_routes: type: number unassigned: type: number assigned: type: number assigned_pairs: type: number average_speed: type: string total_cost: type: number Route: type: object properties: summary: $ref: '#/components/schemas/RouteSummary' stops: type: array items: $ref: '#/components/schemas/RouteStop' RouteSummary: type: object properties: distance: description: Travel distance in user defined unit type: number total_time: description: >- Total time span for this trip, including travel time, wait time, break time, and service time etc. type: number travel_time: description: Travel time is driving duration. type: number service_time: type: number begin_time: type: number end_time: type: number wait_time: type: number late_time: type: number pickup_quantity: type: number dropoff_quantity: type: number paired_pickup_quantity: type: number paired_delivery_quantity: type: number capacity_utilization: type: number num_breaks: type: number num_orders: type: number num_waypoints: type: number vehicle_id: type: string route_id: type: number profile: type: string total_cost: type: number RouteStop: type: object properties: id: type: string position: type: number arrival_time: type: number wait_time: type: number service_time: type: number late_time: type: number depart_time: type: number current_load: type: number type: type: string enum: - order - start_depot - end_depot - break paired_stop: type: string geometry: type: object properties: lon: type: number minimum: -180 maximum: 180 lat: type: number minimum: -90 maximum: 90 zipcode: type: string curb: type: boolean UnassignedStop: type: object properties: id: description: ID of this unassigned order. type: string reason: description: >- Human-readable reasons of this unassigned order, separated by semicolon. type: string details: $ref: '#/components/schemas/ViolationDetails' ViolationDetails: description: | List of details for this unassigned order. type: array items: type: array items: - description: > Reason code. | Code | Reason | |------|--------| | 0 | insufficient vehicles | | 1 | order service duration exceeds vehicle max_total_time | | 2 | invalid sequence in ondemand current routes | | 3 | order depart_after/return_before violation | | 4 | map snap or geocoding failure | | 5 | paired/same cluster label orders have map snap or geocoding failure | | 101 | vehicle max_total_time violation | | 102 | vehicle max_travel_time violation | | 103 | vehicle max_distance violation | | 104 | vehicle max_late_time violation | | 105 | vehicle max_wait_time violation | | 200 | vehicle capacity violation | | 201 | vehicle max_orders_per_route violation | | 202 | num orders with same cluster_label exceeds vehicle max_orders_per_route | | 203 | vehicle max_waypoints_per_route violation | | 204 | renewal violation | | 205 | break violation | | 300 | order and vehicle capabilities mismatch | | 301 | disallowed vehicle or polygon violation | | 302 | paired/same cluster label orders have capabilities, disallowed vehicle, or polygons violation | | 400 | start depot(s) has map snap or geocoding failure | | 401 | end depot(s) has map snap or geocoding failure | type: integer - description: Vehicle ID, `null` if apply to all vehicles. type: string - description: Violation value, `null` if not applicable. type: string RoutingResponse: type: object properties: status: type: string enum: - SUCCEED routes: description: List of routes found. type: array items: $ref: '#/components/schemas/RoutingResponseRoute' waypoints: description: List of waypoints snapped to road network from input locations. type: array items: $ref: '#/components/schemas/RoutingResponseWaypoint' RoutingResponseRoute: type: object properties: geometry: description: A polyline representation of this route. type: string distance: description: Total distance (in meters) of the route. type: number duration: description: Total duration (in seconds) of the route. type: number legs: description: List of routes between waypoints. type: array items: $ref: '#/components/schemas/RoutingResponseRouteLeg' RoutingResponseRouteLeg: type: object properties: distance: description: Distance (in meters) between an adjacent waypoints. type: number duration: description: Duration (in seconds) between an adjacent waypoints. type: number RoutingResponseWaypoint: type: object properties: distance: description: Distance (in meters) between the input and snapped coordinate. type: number name: description: Name of the street the input coordinate snapped to. type: string location: description: Snapped coordinate of the input coordinate. type: object properties: lat: type: number lon: type: number MatrixRoutingResponseJSON: type: object properties: status: type: string enum: - SUCCEED num_origins: type: number num_destinations: type: number durations: description: > List of estimated travel time in seconds (row major order). Negative numbers indicate an error, -1 means no route can be found, -2 means location is too far from the road network and cannot be snapped. type: array items: type: number distances: description: >- List of estimated distance in meters (row major order). Negative numbers indicate an error, -1 means no route can be found, -2 means location is too far from the road network and cannot be snapped. type: array items: type: number MatrixRoutingResponseBinary: description: > Matrix Routing API result in binary format. The values are stored as 4-byte integers using little-endian representation. Each matrix element consists of two integers: distance and duration (in meters and seconds). For example, a 3x3 matrix would result in 72 bytes, as it comprises 9 elements, with each element occupying 8 bytes: a 4-byte integer for duration, followed by a 4-byte integer for distance. Negative numbers indicate errors, where a value of -1 means no route can be found between the two locations. And -2 means a location is too far from the road network, possibly due to user input error or missing map data. type: string format: binary MapMatchingResponse: type: object properties: matchings: description: List of routes that assemble the tracepoints provided. type: array items: $ref: '#/components/schemas/MapMatchingResponseMatch' trace_points: description: List of tracepoints matched in order. type: array items: $ref: '#/components/schemas/MapMatchingResponseTrace' MapMatchingResponseMatch: type: object properties: confidence: description: Confidence of the match, bigger means more confident type: number minimum: 0 maximum: 1 geometry: description: A polyline representation of this route. type: string distance: description: Total distance (in meters) of the route. type: number duration: description: Total duration (in seconds) of the route. type: number legs: type: array items: $ref: '#/components/schemas/RoutingResponseRouteLeg' MapMatchingResponseTrace: type: object properties: matchings_index: description: Index of the route in the matchings array. type: number waypoint_index: description: Index of the waypoint in current matched route. type: number distance: description: Distance (in meters) between the input and snapped coordinate. type: number name: description: Name of the street the input coordinate snapped to. type: string location: description: Snapped coordinate of the input coordinate. type: object properties: lat: type: number lon: type: number VrpResultResponse: type: object properties: message: type: string VrpResult403Response: type: object properties: message: type: string VrpResult404Response: type: object properties: message: type: string VrpResult422Response: type: object properties: message: type: string reasons: description: array of failed reasons type: array items: type: string MatrixResultResponse: type: object properties: download_url: description: > URL to download the Matrix Routing API result in binary format, see explanation in POST Matrix Routing API 200 response. type: string security: - ApiKeyAuth: [] PostResponsesCommonErrors: '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' GetResponsesCommonErrors: '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '404': $ref: '#/components/responses/Response404' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' PostResponsesOptimization: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504' GetResponsesOptimization: '200': $ref: '#/components/responses/Response200Optimization' '202': $ref: '#/components/responses/Response202' '400': $ref: '#/components/responses/Response400Optimization' '401': $ref: '#/components/responses/Response401' '403': $ref: '#/components/responses/Response403' '404': $ref: '#/components/responses/Response404' '422': $ref: '#/components/responses/Response422' '500': $ref: '#/components/responses/Response500' '502': $ref: '#/components/responses/Response502' '504': $ref: '#/components/responses/Response504'