Skip to content

Start optimization job

POST
/optimization/start

Start an optimization job processing

object
job_id
required

Unique identifier for this optimization job

string
webhook_url
required

URL to receive optimization status updates and results

string format: uri
start_date

Start date for the optimization window

string format: date
max_run_time
required

Maximum time in seconds the optimizer can run

number
write_solution_timing_ms
required

Interval in milliseconds for writing intermediate solutions

number
number_of_threads

Number of threads for parallel processing

integer
orders
required

List of orders to be optimized

Array<object>
object
id
required

Unique identifier for the order

string
ship_to_id
required

ID of the delivery destination

string
ship_to

Delivery destination details

object
location
object
geo_lat

Latitude coordinate

number
geo_lon

Longitude coordinate

number
order_items
required

Line items for the order

Array<object>
object
product_id
required

ID of the product

string
quantity
required

Quantity to deliver

number
time_window_start_ts
required

Start of the delivery time window

string format: date-time
time_window_end_ts
required

End of the delivery time window

string format: date-time
pickup_location_id
required

ID of the pickup/terminal location

string
resource_shift_id

ID of the assigned driver shift (for pinned orders)

string
pinned

Whether this order is pinned to a specific driver

boolean
priority_label

Priority label for the order

string
Allowed values: urgent high medium low none
priority

Priority value (string or number)

string
task_priority

Task priority value

string
is_priority

Whether this is a priority order

boolean
unassigned_cost

Cost penalty if this order is not assigned

number
location

Location reference

object
id

Location ID

string
shifts
required

List of driver shifts available for routing

Array<object>
object
id
required

Unique identifier for the shift

string
vehicle_id
required

ID of the vehicle assigned to this shift

string
start_time
required

Shift start time

string format: date-time
end_time
required

Shift end time

string format: date-time
start_location

Starting location for the shift

object
id

Location ID

string
geo_lat

Latitude coordinate

number
geo_lon

Longitude coordinate

number
end_location

Ending location for the shift

object
id

Location ID

string
geo_lat

Latitude coordinate

number
geo_lon

Longitude coordinate

number
resource

Driver/resource assigned to this shift

object
id

Resource ID

string
vehicle

Vehicle details

object
tanks

Vehicle tank configuration

object
tanks

List of tanks on the vehicle

Array<object>
object
size

Tank capacity

number
schedule_date
required

Date of the scheduled shift

string format: date
timezone
required

Timezone for the shift (e.g., America/New_York)

string
depots
required

List of depot/terminal locations

Array<object>
object
id
required

Unique identifier for the depot

string
name
required

Name of the depot/terminal

string
location
required

Depot location coordinates

object
id
required

Location ID

string
geo_lat
required

Latitude coordinate

number
geo_lon
required

Longitude coordinate

number
terminal_products

Products available at this terminal

Array<object>
object
product_id
required

ID of the product

string
allocations

Product allocation limits

Array<object>
object
period

Allocation period

string
Allowed values: DAY WEEK
allocation

Allocation amount

number
allocation_pct

Allocation percentage

number
price

Product pricing at this terminal

object
price

Price per unit

number
route_legs

Pre-defined route legs with travel times to include in optimization

Array<object>
object
start_location_id
required

ID of the starting location

string
end_location_id
required

ID of the ending location

string
time
required

Travel time in minutes between locations

number
penalty_matrix

Matrix defining penalties for resource-location combinations

Array<object>
object
resource_id
required

ID of the resource/driver

string
location_id
required

ID of the location

string
penalty_data
required

Penalty configuration

object
penalty

Penalty value for this resource-location pair

number
keep_assignments

Whether to preserve existing driver-order assignments

boolean
pickup_flow_rate

Flow rate for pickup operations (gallons per minute)

number
delivery_flow_rate

Flow rate for delivery operations (gallons per minute)

number
use_closest_terminal

Whether to use the closest terminal for pickups

boolean
pick_up_on_empty

Whether to allow pickups when vehicle is empty

boolean
cost_per_distance

Cost per unit of distance traveled

number
cost_per_time

Cost per unit of time spent

number
additional_driver_cost

Cost for adding an additional driver

number
overtime_cost

Cost penalty per unit of driver overtime

number
balance_cost

Cost penalty for imbalanced workloads across drivers

number
unallocated_allowed_amount

Maximum allowed unallocated quantity

number
unallocated_cost

Cost penalty per unit of unallocated orders

number
priority_unassigned_cost

Cost for unassigned high-priority orders

number
medium_unassigned_cost

Cost for unassigned medium-priority orders

number
low_priority_unassigned_cost

Cost for unassigned low-priority orders

number
unused_capacity_penalty

Penalty for unused vehicle capacity

number
reload_penalty

Penalty for each reload/refill trip

number
product_map_constraint

Whether to enforce product compatibility constraints

boolean
balance_schedule

Whether to balance deliveries across the schedule

boolean

Optimization job started

object
job_id
string
status
string