> For the complete documentation index, see [llms.txt](https://developer.rategain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.rategain.com/ultradirect/ultradirect-transaction-samples-and-usage/cancellation.md).

# Cancellation

This request is used to request the cancellation of a confirmed booking. All chains support this.

#### **Example cancel request:** <a href="#cancellation-examplecancelrequest" id="cancellation-examplecancelrequest"></a>

```xml
<HotelML xmlns="
http://www.xpegs.com/v2001Q3/HotelML
">
<Head>
<Process DataPath="/HotelML/Form/CancelReservation" Function="TI_CancelReservationV1_1" Token="1259157162622"/>
<Route Destination="00" Source="XX"/>
</Head>
<Form>
<CancelReservation ConfirmationNumber="3365389728" InDate="2013-12-10" OutDate="2013-12-12" PropertyCode="XX;04988">
<Guest FirstName="RateGain" LastName="Test"/>
</CancelReservation>
</Form>
</HotelML>
```

#### Example Cancel response: <a href="#cancellation-examplecancelresponse" id="cancellation-examplecancelresponse"></a>

```xml
<HotelML xmlns="
http://www.xpegs.com/v2001Q3/HotelML
">
<Head>
<Route Destination="XX" Source="00">
<Operation Action="Create" App="TIDispatcher" AppVer="1.12.40.2.8.1" DataPath="/HotelML" StartTime="2009- 11-25T13:52:42.718+00:00" Success="true" TotalProcessTime="512"/>
</Route>
</Head>
<Reservation CancellationNumber="1809822537" ConfirmationNumber="3365389728" HotelComments="RESERVATION CANCELED- XXWELCOMES FUTURE BUSINESS" InDate="2013-10" OutDate="2013-12-12" PropertyCode="HL;04988" Token="1259157162622">
<Guest FirstName="RateGain" LastName="Test"/>
</Reservation>
</HotelML>
```

* A successful Cancel response will contain a CancellationNumber="1809822537".
* In the case of a reservation for multiple rooms made through a single transaction (i.e., the confirmation number covers multiple rooms), the cancellation request cancels ALL rooms under that confirmation number, and the cancellation number applies to ALL rooms.
* Where multiple rooms exist under a single confirmation number and the desire is to cancel one room only, the options are to use “Modify Reservation” or to cancel the original reservation and re-book the remaining rooms.
* It is not possible to cancel a reservation booked through a distributor with a different SGA code.
* When using the optional attribute Title in the booking request, this will need to be passed in the cancel request or the cancel will fail.
* Demand Partners need to store the confirmation number, property id, the guest name, and stay dates internally as this is not retrievable through RateGain and is required to modify or cancel.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.rategain.com/ultradirect/ultradirect-transaction-samples-and-usage/cancellation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
