> 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/book-api/book-reservation.md). Agents can also search and read this documentation through its [MCP server](https://developer.rategain.com/~gitbook/mcp).

# Book Reservation

The **BookReservation** transaction is used to create a new booking. The minimum required information typically includes:

| Property, room type and rate plan codes                                |
| ---------------------------------------------------------------------- |
| Arrival and departure dates                                            |
| Number of guests and rooms                                             |
| Guarantee method (this normally means sending the credit card details) |
| Primary guest’s name and contact details                               |
| Special requests or comments (optional)                                |

#### Request Message <a href="#bookreservation-requestmessage" id="bookreservation-requestmessage"></a>

The following is an example booking request **without** session control (Passive participation):

```xml
<HotelML xmlns="http://www.xpegs.com/v2001Q3/HotelML">
<Head>
<Process DataPath="/HotelML/Form/BookReservation" Function="TI_BookReservationV1_1" Token="1307101856910"/>
<Route Destination="00" Source="01"/>
</Head>
<Form>
<BookReservation CurrencyCode="EUR" GuaranteeMethod="CreditCard" GuaranteeType="Guarantee" InDate="2011-07-01" OutDate="2011-07-04" PropertyCode="GT;042934" RatePlanCode="RAC" RoomRate="134.00" RoomTypeCode="A06">
<CreditCard ExpirationDate="2012-05" IssuedName="John Doe" Number="4321432143214327" TypeIdentifier="VI"/>
<Guest FirstName="John" LastName="Doe" NumberOfAdults="2" NumberOfRooms="1" Primary="true" Remarks="VIP
guest" ServiceRequest="Quiet room on high floor please">
<Email Address="john.doe@pegs.com"/>
<Phone Number="0123456789"/>
<PostalAddress City="Brentford" CountryCode="GB" Line1="2 Kew Bridge Road" PostalCode="TW8 0JF" />
</Guest>
</BookReservation>
</Form>
</HotelML>
```

#### Response Message <a href="#bookreservation-responsemessage" id="bookreservation-responsemessage"></a>

The response then includes the confirmation number:

```xml
<HotelML xmlns="http://www.xpegs.com/v2001Q3/HotelML">
<Head>
<Route Destination="01" Source="00">
<Operation Action="Create" App="TIDispatcher" AppVer="1.12.40.2.8.1" DataPath="/HotelML" StartTime="2011-06-
03T12:01:24.015+00:00" Success="true" TotalProcessTime="497"/>
</Route>
</Head>
<Reservation BookedRate="134.00" ConfirmationNumber="312919307911" CurrencyCode="EUR" HotelComments="VIP GUEST" HotelRoomType="A06RAC" InDate="2011-07-01" NumberOfPersons="2" OutDate="2011-07-04" PropertyCode="GT;042934"
RateGuaranteed="true" RatePlanCode="RAC" RoomTypeCode="A06" Token="1307101856910">
<CancelPolicy Description="CANCEL BY 1400 20110630 LOCAL PROPERTY TIME"/>
<GuaranteePolicy Description="CREDIT CARD GTD"/>
<Guest FirstName="John" LastName="Doe" NumberOfAdults="2" NumberOfRooms="1" Primary="true" Remarks="VIP guest" ServiceRequest="Quiet room on hig floor please">
<Email Address="john.doe@pegs.com"/>
<Phone Number="0123456789"/>
<PostalAddress City="Brentford" CountryCode="GB" Line1="2 Kew Bridge Road" PostalCode="TW8 0JF" StateCode="-
Select-"/>
</Guest>
</Reservation>
</HotelML>
```


---

# 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/book-api/book-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.
