Skip to main content
POST
/
v1
/
optimization-strategies
Create Optimization Strategy
curl --request POST \
  --url https://api.sandbox.usenash.com/v1/optimization-strategies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "label": "<string>",
  "optimizationSchedules": [
    {
      "cronExpression": "<string>",
      "startDate": "2023-11-07T05:31:56Z",
      "endDate": "2023-11-07T05:31:56Z",
      "inputTimezoneId": "<string>"
    }
  ],
  "contractIds": [
    "<string>"
  ],
  "shiftContractId": "<string>",
  "pickupServiceTimeSeconds": 123,
  "dropoffServiceTimeSeconds": 123,
  "incrementalServiceTimeSeconds": 123,
  "enableAutoDispatch": true,
  "autodispatchWithinXMinutesOfPickupTime": 123,
  "earliestDispatchMinutesBeforePickup": 123,
  "pickupTimeFromInMinutes": 123,
  "pickupTimeToInMinutes": 123,
  "contractOptimizationOverrideParameters": [
    {
      "contractId": "<string>",
      "vehicleCount": 123,
      "dispatchStrategyId": "<string>",
      "leadTimeMinutes": 123,
      "fixedCost": 123,
      "maxOrdersPerRoute": 123,
      "minOrdersPerRoute": 123,
      "useAllVehicles": true
    }
  ],
  "unassignedOrdersOptionsGroupId": "<string>",
  "defaultTrafficSource": "<string>",
  "trafficTimeOffsetWeeks": 123,
  "zones": [
    "<string>"
  ],
  "storeLocations": [
    "<string>"
  ],
  "softCapabilities": [
    "<string>"
  ],
  "searchLevel": 123,
  "clusteringLevel": 123,
  "softClusterLabel": true,
  "saveOptimizedRoutes": true,
  "dynamicCadenceConfig": {
    "tiersBeforeCutoff": [
      {
        "intervalMinutes": 123,
        "maxHours": 123
      }
    ]
  }
}
'
[
  {
    "error": {
      "code": "<string>",
      "message": "<string>",
      "details": {}
    },
    "response_status": "<string>",
    "RequestID": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
label
string
required

Human-readable name for the strategy.

optimizationSchedules
OptimizationScheduleInputSerializer · object[] | null
contractIds
string[] | null

Contracts considered during optimization.

shiftContractId
string | null

Contract id of the provider supplying shifts for this strategy.

pickupServiceTimeSeconds
integer | null
dropoffServiceTimeSeconds
integer | null
incrementalServiceTimeSeconds
integer | null
enableAutoDispatch
boolean | null
autodispatchWithinXMinutesOfPickupTime
integer | null

Deprecated. Use pickup_time_from_in_minutes / pickup_time_to_in_minutes.

earliestDispatchMinutesBeforePickup
integer | null

Deprecated. Use pickup_time_from_in_minutes / pickup_time_to_in_minutes.

pickupTimeFromInMinutes
integer | null

Lower bound (inclusive) of the pickup time window to optimize, in minutes from now.

pickupTimeToInMinutes
integer | null

Upper bound (exclusive) of the pickup time window to optimize, in minutes from now.

contractOptimizationOverrideParameters
ContractOverrideParametersSerializer · object[] | null
unassignedOrdersOptionsGroupId
string | null
defaultTrafficSource
string | null
trafficTimeOffsetWeeks
integer | null
zones
string[] | null

Zone ids assigned to this strategy.

storeLocations
string[] | null

Store location ids assigned to this strategy.

softCapabilities
string[] | null
searchLevel
integer | null
clusteringLevel
integer | null
softClusterLabel
boolean | null
balanceRoutes
enum<string> | null
Available options:
none,
same_vehicle_type,
all_vehicle_types
saveOptimizedRoutes
boolean | null
dynamicCadenceConfig
DynamicCadenceConfigInputSerializer · object | null

Response

422 - application/json

Unprocessable Content

error
NashErrorDetails · object
required
response_status
string
required
RequestID
string
required