# Cancel Booking

## zapiBookings\_CancelBooking

<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. |
| zapiAccountId<mark style="color:red;">\*</mark> | integer | Generated by the supplier system.                                               |
| bookingNumber<mark style="color:red;">\*</mark> | integer | Confirmation number assigned once booking is confirmed.                         |
| 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>zapiBookings_CancelBooking</methodName>
        <bookingNumber>40240</bookingNumber>
        <bookingBalance>
            <hasOutstandingBalance>true</hasOutstandingBalance>
            <balance>105</balance>
            <balanceFormated>$105.00</balanceFormated>
        </bookingBalance>
        <methodErrorCode>0</methodErrorCode>
        <methodErrorMessage>
            <![CDATA[Booking has been cancelled]]>
        </methodErrorMessage>
    </methodResponse>
</response>
```

{% endtab %}
{% endtabs %}

If you attempt to balance the booking transactions, then you must submit the appropriate transactions on the booking to reconcile it.

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

```xml
<request>
	<zapiToken></zapiToken>
	<zapiAccountId></zapiAccountId>
	<zapiUserId></zapiUserId>
	<zapiMethod>
		<methodName>zapiBookings_CancelBooking</methodName>
		<bookingNumber></bookingNumber>
	</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>zapiBookings_CancelBooking</methodName>
		<methodErrorCode>0</methodErrorCode>
		<methodErrorMessage></methodErrorMessage>
		<bookingNumber></bookingNumber>
		<bookingBalance>
			<hasOutstandingBalance></hasOutstandingBalance>
			<balance></balance>
			<balanceFormated></balanceFormated>
		</bookingBalance>
	</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/cancel-booking.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.
