POST
/
v1
/
shift
Create a shift
curl --request POST \
  --url https://api.sandbox.usenash.com/v1/shift \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "sft_fKUFVWZQGbEfsyMwJYntE2",
  "name": "Shift 1",
  "plannedStart": "2021-01-01T00:00:00Z",
  "plannedEnd": "2021-01-01T00:00:00Z",
  "plannedBreakDuration": 30,
  "shiftMetadata": {
    "key": "value"
  },
  "optimizationParams": {
    "serviceTimeRelativeEfficiency": 1,
    "plannedBreaks": [
      {
        "end": 30,
        "start": 0
      }
    ],
    "departureDelay": 15,
    "vehicleConfig": {
      "key": "value"
    }
  },
  "status": "active",
  "storeLocationId": "123",
  "externalStoreLocationId": "123",
  "zoneIds": [
    "123"
  ],
  "externalZoneIds": [
    "123"
  ]
}'
{
  "id": "<string>",
  "name": "<string>",
  "plannedStart": "<string>",
  "plannedEnd": "<string>",
  "plannedBreakDuration": 123,
  "shiftMetadata": {},
  "optimizationParams": {
    "serviceTimeRelativeEfficiency": 1,
    "plannedBreaks": [
      {
        "end": 30,
        "start": 0
      }
    ],
    "departureDelay": 15,
    "vehicleConfig": {
      "key": "value"
    }
  },
  "status": "<string>",
  "storeLocationId": "<string>",
  "externalStoreLocationId": "<string>",
  "zoneIds": [
    "<string>"
  ],
  "externalZoneIds": [
    "<string>"
  ],
  "courierId": "<string>",
  "vehicleId": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Body

application/json

Input for creating a shift.

name
string
required

The name of the shift.

Example:

"Shift 1"

plannedStart
string
required

The planned start timestamp of the shift.

Example:

"2021-01-01T00:00:00Z"

plannedEnd
string
required

The planned end timestamp of the shift.

Example:

"2021-01-01T00:00:00Z"

id
string | null

The ID of the shift.

Example:

"sft_fKUFVWZQGbEfsyMwJYntE2"

plannedBreakDuration
integer | null

The planned break duration of the shift.

Example:

30

shiftMetadata
object | null

The metadata of the shift.

Example:
{ "key": "value" }
optimizationParams
object | null

The optimization parameters of the shift. Input for creating optimization params.

status
string | null

The status of the shift.

Example:

"active"

storeLocationId
string | null

The store location ID of the shift.

Example:

"123"

externalStoreLocationId
string | null

The external store location ID of the shift.

Example:

"123"

zoneIds
string[] | null

The zone IDs of the shift.

Example:
["123"]
externalZoneIds
string[] | null

The external zone IDs of the shift.

Example:
["123"]

Response

OK

Response for shift.

id
string
required

The ID of the shift.

name
string
required

The name of the shift.

plannedStart
string
required

The planned start timestamp of the shift.

plannedEnd
string
required

The planned end timestamp of the shift.

status
string
required

The status of the shift.

createdAt
string
required

The creation timestamp of the shift.

updatedAt
string
required

The update timestamp of the shift.

plannedBreakDuration
integer | null

The planned break duration of the shift.

shiftMetadata
object | null

The metadata of the shift.

optimizationParams
object | null

The optimization parameters of the shift. Input for creating optimization params.

storeLocationId
string | null

The store location ID of the shift.

externalStoreLocationId
string | null

The external store location ID of the shift.

zoneIds
string[] | null

The zone IDs of the shift.

externalZoneIds
string[] | null

The external zone IDs of the shift.

courierId
string | null

The courier ID of the shift.

vehicleId
string | null

The vehicle ID of the shift.