# Update Delivery Zone Slots

Intervals can be manipulated as follows:
* **Creation**
: This happens when only the
`start`
,
`end`
, and
`slots`
 fields are passed, which results in a new interval being created.
* **Update**
: If the
`id`
, along with
`start`
,
`end`
, and
`slots`
 fields are provided, the existing interval will be updated.
* **Deletion**
: The interval will be deleted when only the
`id`
 field is passed.

Endpoint: PATCH /api/webhooks/delivery-zones/{delivery_zone_id}/   
Version: 1.0
Security: key

## Security:

  - `key` (unknown)
    apiKey in query key

## Path parameters:

  - `delivery_zone_id` (string, required)

## Query parameters:

  - `delivery_intervals_from` (string)
    If set, returns a list of slots starting from this date. Only current and future dates are allowed. Example: `"2022-11-28"`

  - `delivery_intervals_to` (string)
    If set, returns a list of slots up to this date. Only current and future dates are allowed. Example: `"2022-11-28"`

## Request fields (application/json):

  - `id` (string)

  - `merchant` (string)

  - `name` (string)
    Example: Delivery zone 11

  - `post_code_templates` (object)

  - `post_code_templates.ranges` (array)
    List of postcode ranges.

  - `post_code_templates.ranges.id` (integer)
    Example: 1

  - `post_code_templates.ranges.value` (object)

  - `post_code_templates.ranges.value.lower` (integer)
    Lower bound of postcode range.
    Example: 1000

  - `post_code_templates.ranges.value.upper` (integer)
    Upper bound of postcode range.
    Example: 1999

  - `post_code_templates.texts` (array)
    List of postcode templates in text format.

  - `post_code_templates.texts.id` (integer)
    Unique identifier for the text template.
    Example: 1

  - `post_code_templates.texts.value` (string)
    Postcode template.
    Example: 80-1##

  - `slots_per_period_intervals` (object)
    Object containing availability details per date.

  - `slots_per_period_intervals.2022-11-28` (object)

  - `slots_per_period_intervals.2022-11-28.occupied_slots` (integer)
    Example: 7

  - `slots_per_period_intervals.2022-11-28.slots` (integer)
    Total available slots.
    Example: 10

  - `slots_per_period_intervals.2022-11-28.availability` (boolean)
    Indicates whether slots are available.
    Example: true

  - `slots_per_period_intervals.2022-11-28.message` (string | null)
    Example: null

  - `slots_per_period_intervals.2022-11-28.intervals` (array)
    List of available time intervals.

  - `slots_per_period_intervals.2022-11-28.intervals.id` (string)
    Unique identifier for the interval.
    Example: KDM2MCwgNTQwKQ

  - `slots_per_period_intervals.2022-11-28.intervals.start` (string)
    Start time of the interval.
    Example: 06:00

  - `slots_per_period_intervals.2022-11-28.intervals.end` (string)
    End time of the interval.
    Example: 09:00

  - `slots_per_period_intervals.2022-11-28.intervals.occupied_slots` (integer)
    Example: 0

  - `slots_per_period_intervals.2022-11-28.intervals.slots` (integer)
    Total available slots within the interval.
    Example: 30

## Request examples:

  - `Request Example` (unknown)

## Response 200:

  - `200` (unknown)
    200

## Response 200 fields (application/json):

  - `id` (integer)
    Example: 123

  - `merchant` (integer)
    Example: 1

  - `name` (string)
    Example: Delivery zone 11

  - `post_code_templates` (object)

  - `post_code_templates.ranges` (array)
    List of postcode ranges.

  - `post_code_templates.ranges.id` (integer)
    Example: 1

  - `post_code_templates.ranges.value` (object)

  - `post_code_templates.ranges.value.lower` (integer)
    Lower bound of postcode range.
    Example: 1000

  - `post_code_templates.ranges.value.upper` (integer)
    Upper bound of postcode range.
    Example: 1999

  - `post_code_templates.texts` (array)
    List of postcode templates in text format.

  - `post_code_templates.texts.id` (integer)
    Unique identifier for the text template.
    Example: 1

  - `post_code_templates.texts.value` (string)
    Postcode template.
    Example: 80-1##

  - `slots_per_period_intervals` (object)
    Object containing availability details per date.

  - `slots_per_period_intervals.2022-11-28` (object)

  - `slots_per_period_intervals.2022-11-28.occupied_slots` (integer)
    Example: 7

  - `slots_per_period_intervals.2022-11-28.slots` (integer)
    Total available slots.
    Example: 10

  - `slots_per_period_intervals.2022-11-28.availability` (boolean)
    Indicates whether slots are available.
    Example: true

  - `slots_per_period_intervals.2022-11-28.message` (string | null)
    Example: null

  - `slots_per_period_intervals.2022-11-28.intervals` (array)
    List of available time intervals.

  - `slots_per_period_intervals.2022-11-28.intervals.id` (string)
    Unique identifier for the interval.
    Example: KDM2MCwgNTQwKQ

  - `slots_per_period_intervals.2022-11-28.intervals.start` (string)
    Start time of the interval.
    Example: 06:00

  - `slots_per_period_intervals.2022-11-28.intervals.end` (string)
    End time of the interval.
    Example: 09:00

  - `slots_per_period_intervals.2022-11-28.intervals.occupied_slots` (integer)
    Example: 0

  - `slots_per_period_intervals.2022-11-28.intervals.slots` (integer)
    Total available slots within the interval.
    Example: 30

## Response 200 examples:

  - `Result` (unknown)

