API Reference

API Parameters

This page enumerates some of the API parameters used by RouteStripe, for optimization options, vehicles, and visits.

Parameters

1. Optimization Options

ParameterTypeRequiredDescription
visit_balance_coefficientintegerOptionalSpecifies the type of task balancing between drivers (0 - determines optimal number of drivers, 1 - balances routes by number of tasks, 2 - balances routes by working time).
polylinesbooleanOptionalIf true, generates a polyline encoding the route of each vehicle and provides stop-to-stop distances.
avoid_tollsbooleanOptionalAvoids toll roads if true. Use with caution, especially for non-urban routes.
avoid_highwaysbooleanOptionalAvoids highways if true. Use with caution, especially when planning routes outside the city.
squash_durationnumberRequiredAllows reducing time for multiple deliveries to the same address (e.g., if a base visit is 5 min, setting squash_duration: 2 results in a total of 7 min instead of 10).

JSON Example for Optimization Options

Set general requirements for route calculation if necessary.

{
  "options": {
    "visit_balance_coefficient": 0,
    "polylines": true,
    "avoid_tolls": false,
    "avoid_highways": false,
    "squash_duration": 1
  }
}

2. Vehicles Parameters

Your fleet is an array that contains one of the main objects - a vehicle, to build a route, each request must contain at least one vehicle with a specified start_location or end_location.

Basic parameters of vehicles

ParameterTypeRequiredDescription
namestringRequiredTitle for vehicle.
profilestringOptionalVehicle type (car or truck). Defaults to car if not specified.
shift_startstringRequiredStart work time (hh:mm format).
shift_endstringRequiredEnd work time (hh:mm format).
start_locationLocationRequiredStart location (longitude, latitude).
end_locationLocationOptionalEnd location (longitude, latitude).

JSON Example for Basic Vehicles

{
  "fleet": [
    {
      "name": "Vehicle 1",
      "profile": "car",
      "shift_start": "09:00",
      "shift_end": "18:00",
      "start_location": {
        "lng": 50.123456,
        "lat": 50.123456
      },
      "end_location": {
        "lng": 50.123456,
        "lat": 50.123456
      }
    }
  ]
}

Additional Properties of Vehicles

Use additional parameters to refine calculations and task distribution:

ParameterTypeRequiredDescription
loadnumber<float>OptionalCurrent load (kg).
capacitynumber<float>OptionalVehicle capacity (m³).
visits_maxintegerOptionalMaximum number of visits per route.
max_distancestringOptionalLimits maximum route distance.
speed_factornumber<double>OptionalAdjusts speed calculation based on vehicle performance.
breaksarrayOptionalDefines driver breaks with service, start, and end times.
widthnumber<float>SoonVehicle width (m).
heightnumber<float>SoonVehicle height (m).
weightnumber<float>SoonVehicle weight (kg).

JSON Example for Additional Properties

{
  "fleet": [
    {
      "name": "Vehicle 1",
      "profile": "car",
      "shift_start": "09:00",
      "shift_end": "18:00",
      "start_location": {
        "lng": 50.123456,
        "lat": 50.123456
      },
      "end_location": {
        "lng": 50.123456,
        "lat": 50.123456
      },
      "load": 300,
      "capacity": 600,
      "visits_max": 50,
      "max_distance": "200",
      "speed_factor": 1,
      "breaks": [
        {
          "service": 30,
          "start": "12:00",
          "end": "13:00"
        }
      ]
    }
  ]
}

3. Visits Parameters

ParameterTypeRequiredDescription
locationLocationRequiredVisit location (longitude, latitude).
lngnumberRequiredLongitude.
latnumberRequiredLatitude.
typestringRequiredD - Delivery.
startstringRequiredStart time window (hh:mm).
endstringRequiredEnd time window (hh:mm).
durationnumberRequiredDuration in minutes.
loadintegerOptionalWeight (g).
capacityintegerOptionalVolume (cm³).