> 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 dynamically by asking a question.

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

```
GET https://developer.rategain.com/our-products/smart-distribution/book-and-cancel-reservation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
