> 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/our-products/smart-distribution/book-and-cancel-reservation.md).

# Book and Cancel Reservation

**Overview**

The purpose of this document is to provide detailed descriptions of the transactions and functionality in the RateGain pull connectivity model. The primary component of this model is **UltraDirect**, and the API outlined in this documentation is part of the **XML UltraDirect** system. This includes:

* **Message Formats**: A detailed description of all fields (XML elements and attributes) used in request and response messages. This is especially useful for developers, complementing the XML message definitions provided in the HotelML XML Schema Definition (XSD) files.
* **Request and Response Examples**: Samples of each request and response message showcasing the key functionality.
* **Process/Transaction Flows**: Illustrations of typical processes and transaction flows.

Below is a summary of the **UltraDirect Book** and **Cancel Reservation** transactions:

| Booking Request | Makes a new hotel reservation in real time       |
| --------------- | ------------------------------------------------ |
| Cancel Booking  | Cancel an existing (confirmed) hotel reservation |


---

# 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/our-products/smart-distribution/book-and-cancel-reservation.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.
