# CommitReservation

The **CommitReservation API** is the final step in the hotel booking flow. After a successful CommitReservation, this API is used to finalize and commit the reservation to the supplier's system and generate a booking confirmation with reference numbers.

***

#### **Endpoint**

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

***

#### **Headers**

| **Header Name** | **Value**        | **Required** | **Description**                     |
| --------------- | ---------------- | ------------ | ----------------------------------- |
| ApiKey          | RGKEY3CF9HQU     | Yes          | API key provided by RateGain        |
| ApiSecret       | SECRETLCYJ9CU    | Yes          | API secret provided by RateGain     |
| Content-Type    | application/json | Yes          | Specifies the media type of request |

***

### 📤 Request Payload (JSON)

```json
{
  "BookReservation": {
    "ResStatus": 1,
    "InDate": "2025-07-24",
    "OutDate": "2025-07-25",
    "EchoToken": "Ech011113",
    "PropertyId": "ChIJle4pnY-RNIQRtRJd8z5dUPM",
    "BookingRate": 98.548,
    "RoomSelection": [
      {
        "RoomTypeCode": "TWN.DX",
        "NumberOfRooms": 1,
        "RoomSelectionKey": "20250724|20250725|W|71|6855|TWN.DX|ID_B2B_88|RO|B2BUSXX|121|8|N@0723a59~-407433045~N~~~NORB1D4F201F3414D9175326262227905AADE0001000100010523a59",
        "NumberOfAdults": 2,
        "Guest": [
          {
            "FirstName": "John",
            "LastName": "Doe",
            "Primary": true,
            "Remarks": "Late check-in",
            "ServiceRequest": "Extra pillows",
            "Email": "john.doe@example.com",
            "Phone": "1234567890",
            "Line1": "123 Street",
            "City": "New York",
            "StateCode": "NY",
            "CountryCode": "US",
            "PostalCode": "10001"
          },
          {
            "FirstName": "james",
            "LastName": "nik",
            "Primary": false,
            "Remarks": "Late check-in",
            "ServiceRequest": "Extra pillows",
            "Email": "john.doe@example.com",
            "Phone": "1234567890",
            "Line1": "123 Street",
            "City": "New York",
            "StateCode": "NY",
            "CountryCode": "US",
            "PostalCode": "10001"
          }
        ],
        "Children": [
          {
            "type": "Child",
            "age": 2
          }
        ]
      }
    ],
    "CreditCard": {
      "ExpirationDate": "2026-12",
      "IssuedName": "John Doe",
      "Number": "4111111111111111",
      "TypeIdentifier": "VISA"
    }
  }
}
```

### **BookReservation – Request Fields**

| Field             | Type    | Description                                                            |
| ----------------- | ------- | ---------------------------------------------------------------------- |
| **ResStatus**     | int     | Reservation status (1 = Confirmed, 9 = Pending).                       |
| **InDate**        | string  | Check-in date in `YYYY-MM-DD` format.                                  |
| **OutDate**       | string  | Check-out date in `YYYY-MM-DD` format.                                 |
| **EchoToken**     | string  | Unique identifier for request tracking.                                |
| **PropertyId**    | string  | Unique property identifier.                                            |
| **BookingRate**   | decimal | Final rate confirmed for booking (totalNet in `get preCheckResponse`). |
| **RoomSelection** | array   | List of selected room objects.                                         |

***

#### **Room Selection Information**

| Field                | Type   | Description                                                       |
| -------------------- | ------ | ----------------------------------------------------------------- |
| **RoomTypeCode**     | string | Room type identifier.                                             |
| **NumberOfRooms**    | int    | Number of rooms to book.                                          |
| **RoomSelectionKey** | string | Unique selection key used in availability.                        |
| **NumberOfAdults**   | int    | Number of adults in this room.                                    |
| **Guest**            | array  | Guest details. First guest with `Primary=true` is the lead guest. |
| **Children**         | array  | Children info with age.                                           |

***

#### **Guest Details – Guest**

| Field              | Type   | Description                                     |
| ------------------ | ------ | ----------------------------------------------- |
| **FirstName**      | string | Guest's first name.                             |
| **LastName**       | string | Guest's last name.                              |
| **Primary**        | bool   | Indicates if this guest is the primary contact. |
| **Remarks**        | string | Remarks or special instructions.                |
| **ServiceRequest** | string | Guest preferences or services requested.        |
| **Email**          | string | Contact email.                                  |
| **Phone**          | string | Contact number.                                 |
| **Line1**          | string | Address line.                                   |
| **City**           | string | City name.                                      |
| **StateCode**      | string | State code (e.g., NY).                          |
| **CountryCode**    | string | Country code (e.g., US).                        |
| **PostalCode**     | string | Postal/ZIP code.                                |

***

#### **Children (Nested Array)**

| Field    | Type   | Description        |
| -------- | ------ | ------------------ |
| **type** | string | Usually `"Child"`. |
| **age**  | int    | Age of the child.  |

***

#### **Payment Details – CreditCard**

| Field              | Type   | Required | Description                                                                 |
| ------------------ | ------ | -------- | --------------------------------------------------------------------------- |
| **ExpirationDate** | string | Yes      | Format: `YYYY-MM` (e.g., 2026-12).                                          |
| **IssuedName**     | string | Yes      | Name on the card.                                                           |
| **Number**         | string | Yes      | Credit card number (test card numbers may be allowed in test environments). |
| **TypeIdentifier** | string | Yes      | Card type (e.g., VISA, MASTERCARD).                                         |

#### Sample Response (Success)

<table data-header-hidden><thead><tr><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><p>{</p><p>    "body": {</p><p>        "preCheakResponse": null,</p><p>        "booking": {</p><p>            "confirmationNumber": "O1HJB58MTUMJLV",</p><p>            "echotoken": "Ech011113",</p><p>            "creationDate": "2025-07-23",</p><p>            "status": "CONFIRMED",</p><p>            "modificationPolicies": {</p><p>                "cancellation": true,</p><p>                "modification": false</p><p>            },</p><p>            "holder": {</p><p>                "name": "JOHN",</p><p>                "surname": "DOE"</p><p>            },</p><p>            "hotel": {</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": "TWN.DX",</p><p>                        "name": "TWIN DELUXE",</p><p>                        "status": "CONFIRMED",</p><p>                        "paxes": [</p><p>                            {</p><p>                                "roomId": 1,</p><p>                                "type": "AD",</p><p>                                "name": "james",</p><p>                                "surname": "nik",</p><p>                                "age": 0</p><p>                            },</p><p>                            {</p><p>                                "roomId": 1,</p><p>                                "type": "AD",</p><p>                                "name": null,</p><p>                                "surname": null,</p><p>                                "age": 0</p><p>                            },</p><p>                            {</p><p>                                "roomId": 1,</p><p>                                "type": "CH",</p><p>                                "name": null,</p><p>                                "surname": null,</p><p>                                "age": 8</p><p>                            }</p><p>                        ],</p><p>                        "rates": [</p><p>                            {</p><p>                                "rateKey": null,</p><p>                                "RateCode": "NOR",</p><p>                                "rateType": null,</p><p>                                "allotment": 0,</p><p>                                "rateCommentsId": null,</p><p>                                "rateComments": "Car park YES (with additional debit notes). Check-in hour 16:00 - 09:00.",</p><p>                                "paymentType": "AT_WEB",</p><p>                                "packaging": false,</p><p>                                "boardCode": "RO",</p><p>                                "boardName": "ROOM ONLY",</p><p>                                "cancellationPolicies": [</p><p>                                    {</p><p>                                        "amount": "98.54",</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>                "paymentDataRequired": false,</p><p>                "modificationPolicies": null</p><p>            },</p><p>            "remark": null,</p><p>            "totalNet": 98.54,</p><p>            "currency": "EUR",</p><p>            "reservationId": "02afb037-6f3b-4ce3-aebd-c2cc3d3dba14"</p><p>        }</p><p>    },</p><p>    "status": true,</p><p>    "description": null,</p><p>    "statusCode": 200</p><p>}</p><p> </p></td></tr></tbody></table>

#### Response Field Explanation

<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 if booking was successful (true)</td></tr><tr><td valign="top">description</td><td valign="top">String</td><td valign="top">Any additional information or error message (nullable)</td></tr><tr><td valign="top">statusCode</td><td valign="top">Int</td><td valign="top">HTTP status code, e.g., 200 for success</td></tr><tr><td valign="top">body</td><td valign="top">Object</td><td valign="top">Contains booking and/or pre-check result</td></tr></tbody></table>

&#x20;

#### Boody.Booking Field Explanation

<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">confirmationNumber</td><td valign="top">String</td><td valign="top">Unique booking reference number</td></tr><tr><td valign="top">echotoken</td><td valign="top">String</td><td valign="top">Request echo token for traceability</td></tr><tr><td valign="top">creationDate</td><td valign="top">String</td><td valign="top">Date of booking creation (yyyy-MM-dd)</td></tr><tr><td valign="top">status</td><td valign="top">String</td><td valign="top">Booking status, e.g., CONFIRMED</td></tr><tr><td valign="top">modificationPolicies</td><td valign="top">Object</td><td valign="top">Policies regarding booking changes</td></tr><tr><td valign="top">holder</td><td valign="top">Object</td><td valign="top">Lead guest / booking holder</td></tr><tr><td valign="top">hotel</td><td valign="top">Object</td><td valign="top">Hotel and room booking details</td></tr><tr><td valign="top">remark</td><td valign="top">String</td><td valign="top">Any additional notes or comments</td></tr><tr><td valign="top">totalNet</td><td valign="top">Decimal</td><td valign="top">Total price for the booking</td></tr><tr><td valign="top">currency</td><td valign="top">String</td><td valign="top">ISO currency code (EUR, USD, etc.)</td></tr><tr><td valign="top">reservationId</td><td valign="top">String</td><td valign="top">Internal reservation ID for backend tracking</td></tr></tbody></table>

&#x20;

#### Hotel Field Explanation

<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</td></tr><tr><td valign="top">checkOut</td><td valign="top">String</td><td valign="top">Check-out date</td></tr><tr><td valign="top">code</td><td valign="top">Int</td><td valign="top">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">Full description (5 STARS)</td></tr><tr><td valign="top">destinationCode</td><td valign="top">String</td><td valign="top">Location/destination code</td></tr><tr><td valign="top">destinationName</td><td valign="top">String</td><td valign="top">Destination full name</td></tr><tr><td valign="top">zoneCode</td><td valign="top">Int</td><td valign="top">Zone ID</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">Array</td><td valign="top">List of booked rooms</td></tr><tr><td valign="top">paymentDataRequired</td><td valign="top">Bool</td><td valign="top">Indicates if payment info is required</td></tr><tr><td valign="top">modificationPolicies</td><td valign="top">Object/Null</td><td valign="top">Duplicate of top-level policy if needed</td></tr></tbody></table>

&#x20;

&#x20;

#### Rooms Field Explanation

&#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">RoomCode</td><td valign="top">String</td><td valign="top">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">Booking status (CONFIRMED)</td></tr><tr><td valign="top">paxes</td><td valign="top">Array</td><td valign="top">List of guests</td></tr><tr><td valign="top">rates</td><td valign="top">Array</td><td valign="top">Price details for room</td></tr></tbody></table>

#### Paxes Field

&#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">roomId</td><td valign="top">Int</td><td valign="top">Room ID</td></tr><tr><td valign="top">type</td><td valign="top">String</td><td valign="top">Guest type: AD = Adult, CH = Child</td></tr><tr><td valign="top">name</td><td valign="top">String/Null</td><td valign="top">Guest's first name</td></tr><tr><td valign="top">surname</td><td valign="top">String/Null</td><td valign="top">Guest's last name</td></tr><tr><td valign="top">age</td><td valign="top">Int</td><td valign="top">Age (0 if not provided)</td></tr></tbody></table>

&#x20;

#### Rates Field

&#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">rateKey</td><td valign="top">String</td><td valign="top">Rate identifier</td></tr><tr><td valign="top">RateCode</td><td valign="top">String</td><td valign="top">Rate code (e.g., NOR)</td></tr><tr><td valign="top">rateType</td><td valign="top">String</td><td valign="top">Type of rate (BOOKABLE, etc.)</td></tr><tr><td valign="top">allotment</td><td valign="top">Int</td><td valign="top">Number of rooms allotted</td></tr><tr><td valign="top">rateCommentsId</td><td valign="top">String/Null</td><td valign="top">Internal comment ID</td></tr><tr><td valign="top">rateComments</td><td valign="top">String</td><td valign="top">Human-readable comment (check-in info, parking, etc.)</td></tr><tr><td valign="top">paymentType</td><td valign="top">String</td><td valign="top">Payment mode (AT_WEB)</td></tr><tr><td valign="top">packaging</td><td valign="top">Bool</td><td valign="top">If room 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., RO)</td></tr><tr><td valign="top">boardName</td><td valign="top">String</td><td valign="top">Meal plan name (e.g., ROOM ONLY)</td></tr><tr><td valign="top">cancellationPolicies</td><td valign="top">Array</td><td valign="top">List of cancellation rules</td></tr><tr><td valign="top">taxes</td><td valign="top">Object</td><td valign="top">Tax breakdown if applicable()</td></tr><tr><td valign="top">rooms</td><td valign="top">Int</td><td valign="top">Total rooms booked</td></tr><tr><td valign="top">adults</td><td valign="top">Int</td><td valign="top">Total adult guests</td></tr><tr><td valign="top">children</td><td valign="top">Int</td><td valign="top">Total child guests</td></tr><tr><td valign="top">offers</td><td valign="top">Object</td><td valign="top">Offer/discount details</td></tr></tbody></table>

&#x20;

#### CancellationPolicies Field

<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">amount</td><td valign="top">String</td><td valign="top">Amount to be charged on cancellation</td></tr><tr><td valign="top">from</td><td valign="top">String</td><td valign="top">Date/time from when cancellation fee applies (ISO 8601 with timezone)</td></tr></tbody></table>

&#x20;

#### Notes

·       Always **call** `PreCheckReservation` **before** `CreateReservation` to avoid issues like rate mismatch or unavailability.

·       Ensure `RoomRate` value matches exactly what was confirmed in pre-check.

·       Real credit card values should not be used in test environments.

&#x20;

&#x20;


---

# 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/commitreservation.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.
