# Batch Availability

## zapiBatchAvailability

<mark style="color:blue;">`GET`</mark> `https://{yourdomainname}.zaui.net/zapi/`

#### Request Body

| Name                                                | Type    | Description                                                                                                                                                  |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| zapiToken<mark style="color:red;">\*</mark>         | integer | Token that must be used for a reseller to communicate with the supplier system.                                                                              |
| activityEndDate<mark style="color:red;">\*</mark>   | integer | The last date to check for availability. End date must be greater than or equal to the start date. Format: YYYY:MM:DD.                                       |
| activityStartDate<mark style="color:red;">\*</mark> | integer | The first date to check for availability.  If the start date is less then the current system date, it will be reset to the current date. Format: YYYY:MM:DD. |
| zapiAccountId<mark style="color:red;">\*</mark>     | integer | Generated by the supplier system.                                                                                                                            |
| activityId<mark style="color:red;">\*</mark>        | integer | ID of the activity.                                                                                                                                          |
| methodName<mark style="color:red;">\*</mark>        | string  | The method being called.                                                                                                                                     |
| zapiUserId<mark style="color:red;">\*</mark>        | integer | Generated by the supplier system when a new contact is created.                                                                                              |

{% tabs %}
{% tab title="200: OK " %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<response>
    <zapiVersion>2.1</zapiVersion>
    <error>0</error>
    <message>OK</message>
    <methodResponse>
        <methodName>zapiBatchAvailability</methodName>
        <activities>
            <activity>
                <activityName>
                    <![CDATA[Canyon Icewalk ]]>
                </activityName>
                <activityId>80</activityId>
                <batchAvailability>
                    <dates>
                        <date>
                            <activityDate>2021-12-01</activityDate>
                            <availability>
                                <activityTime>
                                    <activityTimeStart>13:00:00</activityTimeStart>
                                    <activityTimeCancelled>false</activityTimeCancelled>
                                    <activityTimeAvailable>true</activityTimeAvailable>
                                    <activityTimeCancelledOnlineOnly>false</activityTimeCancelledOnlineOnly>
                                    <activityTimeAvailableMessage>Available</activityTimeAvailableMessage>
                                    <inventoryCheckCode>0</inventoryCheckCode>
                                    <inventoryCheckMessage/>
                                    <activityTimeSpotsRemaining>0</activityTimeSpotsRemaining>
                                    <numberOnStandby>0</numberOnStandby>
                                    <isStandbyAvailable>false</isStandbyAvailable>
                                    <status>SOLD_OUT</status>
                                    <fixedDepartureOptions/>
                                </activityTime>
                            </availability>
                        </date>
                        <date>
                            <activityDate>2021-12-02</activityDate>
                            <availability>
                                <activityTime>
                                    <activityTimeStart>13:00:00</activityTimeStart>
                                    <activityTimeCancelled>false</activityTimeCancelled>
                                    <activityTimeAvailable>true</activityTimeAvailable>
                                    <activityTimeCancelledOnlineOnly>false</activityTimeCancelledOnlineOnly>
                                    <activityTimeAvailableMessage>Available</activityTimeAvailableMessage>
                                    <inventoryCheckCode>0</inventoryCheckCode>
                                    <inventoryCheckMessage/>
                                    <activityTimeSpotsRemaining>0</activityTimeSpotsRemaining>
                                    <numberOnStandby>0</numberOnStandby>
                                    <isStandbyAvailable>false</isStandbyAvailable>
                                    <status>SOLD_OUT</status>
                                    <fixedDepartureOptions/>
                                </activityTime>
                            </availability>
                        </date>
                        <date>
                            <activityDate>2021-12-03</activityDate>
                            <availability>
                                <activityTime>
                                    <activityTimeStart>13:00:00</activityTimeStart>
                                    <activityTimeCancelled>false</activityTimeCancelled>
                                    <activityTimeAvailable>true</activityTimeAvailable>
                                    <activityTimeCancelledOnlineOnly>false</activityTimeCancelledOnlineOnly>
                                    <activityTimeAvailableMessage>Available</activityTimeAvailableMessage>
                                    <inventoryCheckCode>0</inventoryCheckCode>
                                    <inventoryCheckMessage/>
                                    <activityTimeSpotsRemaining>0</activityTimeSpotsRemaining>
                                    <numberOnStandby>0</numberOnStandby>
                                    <isStandbyAvailable>false</isStandbyAvailable>
                                    <status>SOLD_OUT</status>
                                    <fixedDepartureOptions/>
                                </activityTime>
                            </availability>
                        </date>
                        <date>
                            <activityDate>2021-12-04</activityDate>
                            <availability>
                                <activityTime>
                                    <activityTimeStart>13:00:00</activityTimeStart>
                                    <activityTimeCancelled>false</activityTimeCancelled>
                                    <activityTimeAvailable>true</activityTimeAvailable>
                                    <activityTimeCancelledOnlineOnly>false</activityTimeCancelledOnlineOnly>
                                    <activityTimeAvailableMessage>Available</activityTimeAvailableMessage>
                                    <inventoryCheckCode>0</inventoryCheckCode>
                                    <inventoryCheckMessage/>
                                    <activityTimeSpotsRemaining>0</activityTimeSpotsRemaining>
                                    <numberOnStandby>0</numberOnStandby>
                                    <isStandbyAvailable>false</isStandbyAvailable>
                                    <status>SOLD_OUT</status>
                                    <fixedDepartureOptions/>
                                </activityTime>
                            </availability>
                        </date>
                        <date>
                            <activityDate>2021-12-05</activityDate>
                            <availability>
                                <activityTime>
                                    <activityTimeStart>13:00:00</activityTimeStart>
                                    <activityTimeCancelled>false</activityTimeCancelled>
                                    <activityTimeAvailable>true</activityTimeAvailable>
                                    <activityTimeCancelledOnlineOnly>false</activityTimeCancelledOnlineOnly>
                                    <activityTimeAvailableMessage>Available</activityTimeAvailableMessage>
                                    <inventoryCheckCode>0</inventoryCheckCode>
                                    <inventoryCheckMessage/>
                                    <activityTimeSpotsRemaining>0</activityTimeSpotsRemaining>
                                    <numberOnStandby>0</numberOnStandby>
                                    <isStandbyAvailable>false</isStandbyAvailable>
                                    <status>SOLD_OUT</status>
                                    <fixedDepartureOptions/>
                                </activityTime>
                            </availability>
                        </date>
                    </dates>
                </batchAvailability>
            </activity>
        </activities>
    </methodResponse>
</response>
```

{% endtab %}
{% endtabs %}

This callback does have the following restrictions:

* Dates must be greater than or equal to the current system date.&#x20;
* The difference in start to end date can not exceed 31 days.&#x20;
* The end date can not exceed 31 days from the current date.&#x20;

{% tabs %}
{% tab title="Request" %}

```xml
<request>
	<zapiToken></zapiToken>
	<zapiAccountId></zapiAccountId>
	<zapiUserId></zapiUserId>
	<zapiMethod>
		<methodName>zapiBatchAvailability</methodName>
		<activityId></activityId>
		<activityStartDate></activityStartDate>
		<activityEndDate></activityEndDate>
	</zapiMethod>
</request>
```

{% endtab %}

{% tab title="Response" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<response>
    <zapiVersion>2.1</zapiVersion>
    <error>0</error>
    <message>OK</message>
    <methodResponse>
        <methodName>zapiBatchAvailability</methodName>
        <activities>
            <activity>
                <activityName></activityName>
                <activityId></activityId>
                <batchAvailability>
                    <dates>
                        <date>
                            <activityDate></activityDate>
                            <availability>
                                <activityTime>
                                    <activityTimeStart></activityTimeStart>
                                    <activityTimeCancelled></activityTimeCancelled>
                                    <activityTimeAvailable></activityTimeAvailable>
                                    <activityTimeCancelledOnlineOnly></activityTimeCancelledOnlineOnly>
                                    <activityTimeAvailableMessage></activityTimeAvailableMessage>
                                    <inventoryCheckCode></inventoryCheckCode>
                                    <inventoryCheckMessage/>
                                    <activityTimeSpotsRemaining></activityTimeSpotsRemaining>
                                    <numberOnStandby></numberOnStandby>
                                    <isStandbyAvailable></isStandbyAvailable>
                                    <status></status>
                                    <fixedDepartureOptions/>
                                </activityTime>
                            </availability>
                        </date>
                        <date>
                            <activityDate></activityDate>
                            <availability>
                                <activityTime>
                                    <activityTimeStart></activityTimeStart>
                                    <activityTimeCancelled></activityTimeCancelled>
                                    <activityTimeAvailable></activityTimeAvailable>
                                    <activityTimeCancelledOnlineOnly></activityTimeCancelledOnlineOnly>
                                    <activityTimeAvailableMessage></activityTimeAvailableMessage>
                                    <inventoryCheckCode></inventoryCheckCode>
                                    <inventoryCheckMessage/>
                                    <activityTimeSpotsRemaining></activityTimeSpotsRemaining>
                                    <numberOnStandby></numberOnStandby>
                                    <isStandbyAvailable></isStandbyAvailable>
                                    <status></status>
                                    <fixedDepartureOptions/>
                                </activityTime>
                            </availability>
                    </dates>
                </batchAvailability>
            </activity>
        </activities>
    </methodResponse>
</response>
```

{% 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/zapi/zapi-calls/booking/batch-availability.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.
