Templates

Upsert multiple templates

Create or update multiple delivery window or shift templates in a single request. Templates generate their instances on a recurring schedule. On update, a shift template's payload is merged: a field you omit keeps its stored value, and clearing one requires sending it explicitly as null. The external references are the exception, because they are resolved to internal ids only when supplied: sending externalStoreLocationId or externalZoneIds as null leaves the stored store location or zones unchanged.

post/v1/templates/upsert

Request

  • Base URL
    https://api.sandbox.usenash.com
  • Auth
    none declared

Request body

Example request

{
  "templates": [
    {
      "type": "DELIVERY_WINDOW",
      "deliveryWindowTemplatePayload": {
        "key": "value"
      },
      "shiftTemplatePayload": {
        "key": "value"
      },
      "externalId": "ext_01234567890123456789",
      "name": "Monday Delivery Window",
      "startDatetime": "2024-01-01T12:00:00",
      "endDatetime": "2024-01-01T12:00:00",
      "daysOfWeek": [
        "MONDAY",
        "TUESDAY"
      ],
      "generationFrequencyValue": 1,
      "generationFrequencyUnit": "DAY",
      "createInstancesUpToValue": 1,
      "createInstancesUpToUnit": "DAY",
      "overrideExistingInstances": true
    }
  ]
}

Response

OK

Example response

{
  "templates": [
    {
      "id": "tpl_01234567890123456789",
      "type": "DELIVERY_WINDOW",
      "startDatetime": "2024-01-01T12:00:00",
      "endDatetime": "2024-01-01T12:00:00",
      "daysOfWeek": [
        "MONDAY",
        "TUESDAY"
      ],
      "generationFrequencyValue": 1,
      "generationFrequencyUnit": "DAY",
      "createInstancesUpToValue": 1,
      "createInstancesUpToUnit": "DAY",
      "overrideExistingInstances": true
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.