Skip to content

Optization API Documentation

POST /solver/optimize


Query Parameters

Parameter Type Required Description
api_key string Yes Your API key

Request Body: application/json

Inputs

Field Type Required Description
vehicles [Vehicle] Yes Vehicle identifier
jobs [Job] Yes Job identifier
options Option Yes Option identifier

Vehicles

Field Type Required Description
id String Yes Vehicle identifier
start [Number, Number] Yes Vehicle's start location (default: [0.0, 0.0])
end [Number, Number] Optional Vehicle's end location (default: null)
constraints Constraints Optional Vehicle constraints and cost parameters

Constraints

Field Type Required Description
profile String Optional Travel profile: "car" or "truck" (default: "car")
capacity Integer ≥ 0 Optional Vehicle's load capacity
time_window [String, String] Optional Active time window: ["HH:MM:SS", "HH:MM:SS"]
max_distance Integer > 0 Optional Maximum distance (in meters)
max_travel_time Integer ≥ 0 Optional Maximum allowed travel time (in seconds)
max_tasks Integer ≥ 0 Optional Max number of tasks per vehicle
per_km Integer ≥ 0 Optional Cost per kilometer (default: 0)
per_hour Integer ≥ 0 Optional Cost per hour (default: 3600)
fixed Integer ≥ 0 Optional Fixed cost per route (default: 0)

Jobs

Field Type Required Description
id String Yes Job identifier
amount Integer ≥ 1 Yes Job demand/amount
start Location Optional Start location
end Location Optional End location
priority Integer (0–100) Optional Priority of job

Location

Field Type Required Description
coordinate [Number, Number] Yes Coordinates (default: [0.0, 0.0])
setup Integer ≥ 0 Optional Setup time in seconds
service Integer ≥ 0 Optional Service time in seconds
time_window [String, String] Optional Time window: ["HH:MM:SS", "HH:MM:SS"]

Options

Field Type Default Description
problem String "TSP" Type of routing problem (e.g., TSP, VRP, CVRP, VRPTW)
objective String "distance" What to optimize: "distance", "duration", or "cost"
solver String "heuristic" Solver type: "heuristic" or "mathematical"
model String null The generated model to use (Optional)
map String "cartesian" Coordinate system: "cartesian" or "geographic"
restrictions Restrictions null The restrictions to apply (Optional)

Restrictions

Field Type Default Description
timeout Integer 0 The timeout in seconds (Optional)
avoid_tolls Boolean false No toll roads. When true, the route avoids toll roads.
avoid_zones Array of Polygons [] Custom polygons to avoid during routing. Each polygon should have at least 3 points

Response

Outputs

Field Type Description
summary Summary Summary object with global indicators of the solution.
unassigned [Job] Jobs that couldn't be assigned to any route.
routes [Route] Routes assigned to vehicles.
directions [Direction] Geometries and points for each route.

Summary

Field Type Description
cost Integer Total cost of the solution.
routes Integer Total number of assigned routes.
amount Integer Total quantity transported.
unassigned Integer Number of unassigned jobs.
setup Integer Total setup time (seconds).
service Integer Total service time (seconds).
duration Integer Total duration (seconds).
distance Integer Total distance (meters).
waiting_time Integer Total waiting time (seconds).
priority Integer Total priority value of all jobs.

Route

Field Type Description
vehicle String ID of the vehicle assigned to this route.
cost Integer Total cost for this route.
amount Integer Total quantity carried.
duration Integer Total route duration (seconds).
distance Integer Total distance traveled (meters).
setup Integer Total setup time (seconds).
service Integer Total service time (seconds).
waiting_time Integer Total waiting time (seconds).
priority Integer Total priority value for the jobs in this route.
steps [Step] Steps representing the route sequence.

Step

Field Type Description
type String (enum) Step type: start, job, pickup, delivery, break, end.
id String (optional) ID of the job/step.
location Location Location object of the step.
setup Integer (optional) Setup time at this step (seconds).
service Integer (optional) Service time at this step (seconds).
time_window [String, String] Time window allowed at this step.
load Integer Load carried by the vehicle after this step.
duration Integer Total duration so far (seconds).
distance Integer Total distance so far (meters).
waiting_time Integer Waiting time at this step (seconds).
arrival Integer (optional) Arrival time at this step (seconds).

Direction

Field Type Description
vehicle String ID of the vehicle assigned to this route.
points [Number, Number] Array of [x, y] coordinates representing the route geometry.