# PreCheckReservation

The `PreCheckReservation` API is a **rate validation and availability check** endpoint used before finalizing a hotel reservation. It acts as a **pre-booking verification step** to ensure that the selected room, rate, and inventory are still available and valid at the moment of confirmation.

It helps prevent booking failures due to:

• Expired or changed rates

• Room availability mismatches

• Incorrect pricing information submitted by the client

***

#### **Purpose**

* Validate real-time availability for the selected room (`RoomSelectionKey`)
* Ensure the submitted rate matches the actual supplier rate
* Retrieve updated pricing and cancellation policies
* Generate a `preBookReservationId` for use in the final booking via the `CreateReservation` API

***

#### **When to Use**

* Immediately before calling `CreateReservation`
* As a **mandatory step** in the booking workflow
* To avoid booking errors such as:
  * **Rate Mismatch**
  * **Room Not Available**
  * **Policy Changes**

***

#### **Endpoint**

```
POST [SD-Domain]/api/SmartDistribution/PreCheckReservation
```

***

#### **Headers**

| Header Name  | Value / Example  | Required | Description                      |
| ------------ | ---------------- | -------- | -------------------------------- |
| Content-Type | application/json | Yes      | Content type of the request body |
| ApiKey       | Test3HVW63CF9HQU | Yes      | API key provided by RateGain     |
| ApiSecret    | TEStMYBYJ9CU     | Yes      | API secret provided by RateGain  |

***

#### Request Payload

<table data-header-hidden><thead><tr><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><p>{</p><p>    "BookReservation": {</p><p>        "InDate": "2025-07-24",</p><p>        "OutDate": "2025-07-25",</p><p>        "EchoToken": "Ech0001",</p><p>        "PropertyId": "ChIJeXrzAF12NIQRzC1Cl0_AFsM",</p><p>        "RoomSelection": [</p><p>            {</p><p>                "RoomTypeCode": "TWN.DX",</p><p>                "RoomSelectionKey": "20250724|20250725|W|71|6855|DBL.CB-KG|ID_B2B_88|BB|B2BUSXX|1~2~1|8|N@07~~206f0~2053365280~N~~~NOR~~7D76EF8695A5458175325916176905AADE00010001000105206f0"</p><p>            }</p><p>        ]</p><p>    }</p><p>}</p></td></tr></tbody></table>

***

#### Request Field Details

**`BookReservation`**

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">InDate</td><td valign="top">string (yyyy-MM-dd)</td><td valign="top">Check-in date.</td></tr><tr><td valign="top">OutDate</td><td valign="top">string (yyyy-MM-dd)</td><td valign="top">Check-out date. Must be later than InDate.</td></tr><tr><td valign="top">EchoToken</td><td valign="top">string</td><td valign="top">Unique identifier for tracking/logging the request.</td></tr><tr><td valign="top">PropertyId</td><td valign="top">string</td><td valign="top">Unique ID of the property.internal hotel ID.</td></tr><tr><td valign="top">RoomSelection</td><td valign="top">List&#x3C;RoomSelection></td><td valign="top">Array of room selections for booking.</td></tr></tbody></table>

&#x20;

&#x20;

&#x20;**Nested Object: RoomSelection**

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">RoomTypeCode</td><td valign="top">string</td><td valign="top">Code representing the type of room (e.g., TWN.DX for Twin Deluxe).</td></tr><tr><td valign="top">RoomSelectionKey</td><td valign="top">string</td><td valign="top">Encoded string that contains rate, room, and pricing selection metadata.</td></tr></tbody></table>

&#x20;

#### Successful Response (Rate Check Passed)

<table data-header-hidden><thead><tr><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><p>{</p><p>    "body": {</p><p>        "PreCheckResponse": {</p><p>            "checkIn": "2025-07-24",</p><p>            "checkOut": "2025-07-25",</p><p>            "code": 6855,</p><p>            "name": "Las Brisas Ixtapa",</p><p>            "categoryCode": "5EST",</p><p>            "categoryName": "5 STARS",</p><p>            "destinationCode": "IXT",</p><p>            "destinationName": "Ixtapa - Zihuatanejo",</p><p>            "zoneCode": 10,</p><p>            "zoneName": "Ixtapa",</p><p>            "latitude": "17.64815200000000000000",</p><p>            "longitude": "-101.59624500000000000000",</p><p>            "rooms": [</p><p>                {</p><p>                    "RoomCode": "DBL.CB-KG",</p><p>                    "name": "DOUBLE CLUB KING BED",</p><p>                    "status": null,</p><p>                    "id": 0,</p><p>                    "supplierReference": null,</p><p>                    "paxes": null,</p><p>                    "rates": [</p><p>                        {</p><p>                            "rateKey": "20250724|20250725|W|71|6855|DBL.CB-KG|ID_B2B_88|BB|B2BUSXX|1~2~1|8|N@07~~206f0~2053365280~N~~~NOR~~7D76EF8695A5458175325916176905AADE00010001000105206f0",</p><p>                            "RateCode": "NOR",</p><p>                            "rateType": "BOOKABLE",</p><p>                            "TotalPrice": "264.07",</p><p>                            "allotment": 3,</p><p>                            "rateCommentsId": null,</p><p>                            "rateComments": ".  Check-in hour 16:00-09:00.Car park YES (With additional debit notes).",</p><p>                            "paymentType": "AT_WEB",</p><p>                            "packaging": false,</p><p>                            "boardCode": "BB",</p><p>                            "boardName": "BED AND BREAKFAST",</p><p>                            "cancellationPolicies": [</p><p>                                {</p><p>                                    "amount": "264.07",</p><p>                                    "from": "2025-07-22T23:59:00-06:00"</p><p>                                }</p><p>                            ],</p><p>                            "taxes": null,</p><p>                            "rooms": 1,</p><p>                            "adults": 2,</p><p>                            "children": 1,</p><p>                            "offers": null</p><p>                        }</p><p>                    ]</p><p>                }</p><p>            ],</p><p>            "minRate": null,</p><p>            "maxRate": null,</p><p>            "currency": "EUR",</p><p>            "totalNet": "264.07",</p><p>            "paymentDataRequired": false,</p><p>            "modificationPolicies": {</p><p>                "cancellation": true,</p><p>                "modification": false</p><p>            }</p><p>        },</p><p>        "booking": null</p><p>    },</p><p>    "status": true,</p><p>    "description": null,</p><p>    "statusCode": 200</p><p>}</p><pre><code> 
</code></pre></td></tr></tbody></table>

#### Response Field Details

&#x20;

#### Top-Level Response

<table data-header-hidden><thead><tr><th valign="top">Field</th><th valign="top">Type</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top">status</td><td valign="top">boolean</td><td valign="top">Indicates whether the response was successful (true or false)</td></tr><tr><td valign="top">statusCode</td><td valign="top">integer</td><td valign="top">HTTP status code (e.g., 200 for success)</td></tr><tr><td valign="top">description</td><td valign="top">string/null</td><td valign="top">Error/response details if applicable (usually null)</td></tr><tr><td valign="top">body</td><td valign="top">array</td><td valign="top">List of available hotel results</td></tr><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"> </td></tr></tbody></table>

&#x20;

`body.`PreCheckResponse

**High-level structure describing pre-booking data.**

&#x20;

#### &#x20;PreCheckResponse

<table data-header-hidden><thead><tr><th valign="top">Field</th><th valign="top">Type</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top">checkIn</td><td valign="top">string</td><td valign="top">Check-in date (yyyy-MM-dd).</td></tr><tr><td valign="top">checkOut</td><td valign="top">string</td><td valign="top">Check-out date (yyyy-MM-dd).</td></tr><tr><td valign="top">code</td><td valign="top">int</td><td valign="top">Internal hotel code.</td></tr><tr><td valign="top">name</td><td valign="top">string</td><td valign="top">Hotel name.</td></tr><tr><td valign="top">categoryCode</td><td valign="top">string</td><td valign="top">Category code (e.g., 5EST).</td></tr><tr><td valign="top">categoryName</td><td valign="top">string</td><td valign="top">Category name (e.g., 5 STARS).</td></tr><tr><td valign="top">destinationCode</td><td valign="top">string</td><td valign="top">Destination code.</td></tr><tr><td valign="top">destinationName</td><td valign="top">string</td><td valign="top">Destination name.</td></tr><tr><td valign="top">zoneCode</td><td valign="top">int</td><td valign="top">Zone code.</td></tr><tr><td valign="top">zoneName</td><td valign="top">string</td><td valign="top">Zone name.</td></tr><tr><td valign="top">latitude</td><td valign="top">string</td><td valign="top">Hotel latitude.</td></tr><tr><td valign="top">longitude</td><td valign="top">string</td><td valign="top">Hotel longitude.</td></tr><tr><td valign="top">rooms</td><td valign="top">List&#x3C;Room></td><td valign="top">Room details.</td></tr><tr><td valign="top">currency</td><td valign="top">string</td><td valign="top">Currency (e.g., EUR).</td></tr><tr><td valign="top">totalNet</td><td valign="top">string</td><td valign="top">Total net price.</td></tr><tr><td valign="top">paymentDataRequired</td><td valign="top">bool</td><td valign="top">Whether payment data is required.</td></tr><tr><td valign="top">modificationPolicies</td><td valign="top">object</td><td valign="top">Policies about cancellation and modification.</td></tr></tbody></table>

&#x20;

#### `Rooms Array object`

&#x20;

<table data-header-hidden><thead><tr><th valign="top">Field</th><th valign="top">Type</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top">RoomCode</td><td valign="top">string</td><td valign="top">Internal room code.</td></tr><tr><td valign="top">name</td><td valign="top">string</td><td valign="top">Room name.</td></tr><tr><td valign="top">status</td><td valign="top">string</td><td valign="top">Room availability status</td></tr><tr><td valign="top">rates</td><td valign="top">List&#x3C;Rate></td><td valign="top">List of rate plans for the room.</td></tr></tbody></table>

&#x20;

#### `Rates Array object`

<table data-header-hidden><thead><tr><th valign="top">Field</th><th valign="top">Type</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top">rateKey</td><td valign="top">string</td><td valign="top">Unique encoded identifier for the rate.</td></tr><tr><td valign="top">RateCode</td><td valign="top">string</td><td valign="top">Internal rate code.</td></tr><tr><td valign="top">rateType</td><td valign="top">string</td><td valign="top">Type of rate (e.g., BOOKABLE).</td></tr><tr><td valign="top">TotalPrice</td><td valign="top">string</td><td valign="top">Total price for this rate.</td></tr><tr><td valign="top">allotment</td><td valign="top">int</td><td valign="top">Number of available rooms.</td></tr><tr><td valign="top">rateComments</td><td valign="top">string</td><td valign="top">Notes about the rate or facilities.</td></tr><tr><td valign="top">paymentType</td><td valign="top">string</td><td valign="top">Payment type (AT_WEB = pay at web).</td></tr><tr><td valign="top">packaging</td><td valign="top">bool</td><td valign="top">Indicates if the rate is part of a package.</td></tr><tr><td valign="top">boardCode</td><td valign="top">string</td><td valign="top">Meal plan code (e.g., BB).</td></tr><tr><td valign="top">boardName</td><td valign="top">string</td><td valign="top">Meal plan description (e.g., BED AND BREAKFAST).</td></tr><tr><td valign="top">cancellationPolicies</td><td valign="top">List&#x3C;Policy></td><td valign="top">Cancellation policy details.</td></tr><tr><td valign="top">taxes</td><td valign="top">object</td><td valign="top">Taxes applicable (not provided in this example).</td></tr><tr><td valign="top">rooms</td><td valign="top">int</td><td valign="top">Number of rooms booked.</td></tr><tr><td valign="top">adults</td><td valign="top">int</td><td valign="top">Number of adults.</td></tr><tr><td valign="top">children</td><td valign="top">int</td><td valign="top">Number of children.</td></tr></tbody></table>

&#x20;

Represents the room being quoted for booking.

#### `cancelPolicy`

&#x20;

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Field</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">amount</td><td valign="top">string</td><td valign="top">Cancellation charge.</td></tr><tr><td valign="top">from</td><td valign="top">datetime</td><td valign="top">Deadline time before which cancellation is free.</td></tr></tbody></table>

&#x20;

#### &#x20;`modificationPolicies`

&#x20;

<table data-header-hidden><thead><tr><th valign="top">Field</th><th valign="top">Type</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top">cancellation</td><td valign="top">bool</td><td valign="top">Indicates whether the booking can be cancelled.</td></tr><tr><td valign="top">modification</td><td valign="top">bool</td><td valign="top">Indicates whether the booking can be modified (e.g., change dates, guests).</td></tr></tbody></table>

&#x20;

#### Use Cases

·       **Before Creating Reservation**, use this API to:

o   Validate rate is current

o   Retrieve fresh cancellation policy


---

# 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://developer.rategain.com/our-products/smart-distribution/developer-guide/precheckreservation.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.
