# Grouped-departures

{% hint style="info" %}
Add octo/grouped-departures to your `OCTO-Capabilities` header

Add it to both [Products](/octo/basic-workflow/products.md) and [Availability](/octo/basic-workflow/availability.md#check-availability) calls, in order for it to work
{% endhint %}

Used with List [Products](/octo/basic-workflow/products.md#list-products) , Single [Product](/octo/basic-workflow/products.md#get-product) and [Availability](/octo/basic-workflow/availability.md#check-availability) endpoints. Groups interval time slots into **Morning Departures** (before noon)**, Afternoon Departures** (noon till 6pm), **Evening Departures** (6pm till midnight).

{% tabs %}
{% tab title="Products" %}
Assigns unique `id` for different departure groups, which is used in [Availability](/octo/basic-workflow/availability.md#check-availability) request as `optionId`

#### Response

```json
"options": [
        {
            "id": "ac0ff447450a0b3102db16cfaae7edc13729bf5b",
            "internalName": "Morning Departures",
            ...
        },
        {
            "id": "5e66a4a9f8cefa58c8403540463e9715a4771c16",
            "internalName": "Afternoon Departures",
            ...
        },
        {
            "id": "10921bf8a1bffb723bb08aa67192fae681549725",
            "internalName": "Evening Departures",
            ...
        }
    ],
```

{% endtab %}

{% tab title="Availability" %}
`optionId` for particular departure group will return time slots associated with it

#### Response

Below is the response when **Afternoon Departures** `id` is passed as `optionId` in request

```json
[
    {
        "id": "2022-09-25T12:00:00-07:00",
        "localDateTimeStart": "2022-09-25T12:00:00-07:00",
        "localDateTimeEnd": "2022-09-25T14:00:00-07:00",
        ...
    },
    {
        "id": "2022-09-25T13:00:00-07:00",
        "localDateTimeStart": "2022-09-25T13:00:00-07:00",
        "localDateTimeEnd": "2022-09-25T15:00:00-07:00",
        ...
    },
    {
        "id": "2022-09-25T14:00:00-07:00",
        "localDateTimeStart": "2022-09-25T14:00:00-07:00",
        "localDateTimeEnd": "2022-09-25T16:00:00-07:00",
       ...
    },
    {
        "id": "2022-09-25T15:00:00-07:00",
        "localDateTimeStart": "2022-09-25T15:00:00-07:00",
        "localDateTimeEnd": "2022-09-25T17:00:00-07:00",
        ...
    },
    {
        "id": "2022-09-25T16:00:00-07:00",
        "localDateTimeStart": "2022-09-25T16:00:00-07:00",
        "localDateTimeEnd": "2022-09-25T18:00:00-07:00",
        ...
    },
    {
        "id": "2022-09-25T17:00:00-07:00",
        "localDateTimeStart": "2022-09-25T17:00:00-07:00",
        "localDateTimeEnd": "2022-09-25T19:00:00-07:00",
        ...
    }
]
```

{% endtab %}

{% tab title="Booking (Reserve)" %}
`optionId` used and `id` received in [Availability](#availability) request will be used in [Booking](#untitled) endpoint as payload. Further steps are same regardless of octo-capabilities header
{% endtab %}

{% tab title="Delete" %}
Assign unique `id` for different departure groups

**Response**

Below is the response when `octo/grouped-departures` is passed in the header

```json
"options": [
        {
            "id": "ac0ff447450a0b3102db16cfaae7edc13729bf5b",
            "internalName": "Morning Departures",
            ...
        },
        {
            "id": "5e66a4a9f8cefa58c8403540463e9715a4771c16",
            "internalName": "Afternoon Departures",
            ...
        },
        {
            "id": "10921bf8a1bffb723bb08aa67192fae681549725",
            "internalName": "Evening Departures",
            ...
        }
    ],
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zaui.com/octo/optional-capabilities/grouped-departures.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
