# CancelReservation

The CancelReservation API cancels a hotel reservation made through the CreateReservation API. It requires the original ReservationId and ConfirmationNumber received at booking.

***

#### 🔗 Endpoint

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

***

#### 🧾 Headers

| Header    | Type   | Required | Description                   |
| --------- | ------ | -------- | ----------------------------- |
| ApiKey    | string | Yes      | API key shared by RateGain    |
| ApiSecret | string | Yes      | API secret shared by RateGain |

***

#### 📤 Request Field Details

| Field          | Type   | Required | Description                                      |
| -------------- | ------ | -------- | ------------------------------------------------ |
| confirmationId | string | Yes      | Confirmation code returned in CreateReservation  |
| reservationid  | string | Yes      | Internal system ID returned in CreateReservation |

***

#### 📦 Request

***

#### 📥 Response

***

#### 📘 Response Descriptions

| Field       | Type    | Value | Description                                                                  |
| ----------- | ------- | ----- | ---------------------------------------------------------------------------- |
| status      | boolean | true  | Indicates the API request was processed successfully.                        |
| statusCode  | number  | 200   | HTTP status code. 200 means OK / success.                                    |
| description | string  | null  | Optional message or description from the API. Not provided in this response. |

***

#### 📦 Body Object

| Field              | Type   | Value               | Description                                                 |
| ------------------ | ------ | ------------------- | ----------------------------------------------------------- |
| cancellationNumber | string | "KZ2VZSPYXUO6ZV"    | Unique reference ID for the cancellation.                   |
| confirmationNumber | string | "O1HJB58MTUMJLV"    | Original booking confirmation number.                       |
| hotelComments      | string | null                | Any remarks or notes from the hotel. Not provided.          |
| inDate             | string | "2025-07-24"        | Check-in date (YYYY-MM-DD).                                 |
| outDate            | string | "2025-07-25"        | Check-out date (YYYY-MM-DD).                                |
| propertyCode       | string | null                | Internal identifier for the hotel property. Not provided.   |
| token              | string | null                | Token for further authorization. Not used in this response. |
| status             | string | "CANCELLED"         | Current status of the reservation.                          |
| hotelName          | string | "Las Brisas Ixtapa" | Name of the hotel.                                          |
| roomType           | string | "TWIN DELUXE"       | Type of room that was reserved.                             |
| totalAmount        | string | "98.54"             | Total cost of the reservation.                              |
| currency           | string | "EUR"               | Currency in which the amount is expressed.                  |
| numberOfRooms      | number | 1                   | Number of rooms booked.                                     |
| numberOfAdults     | number | 2                   | Number of adults for the booking.                           |
| numberOfChildren   | number | 1                   | Number of children for the booking.                         |

***

#### 👤 Guest Object

| Field     | Type    | Value  | Description                                    |
| --------- | ------- | ------ | ---------------------------------------------- |
| firstName | string  | "John" | First name of the guest.                       |
| lastName  | string  | "Doe"  | Last name of the guest.                        |
| primary   | boolean | false  | Indicates if the guest is the primary contact. |
| email     | string  | null   | Email address of the guest. Not provided.      |
| phone     | string  | null   | Phone number of the guest. Not provided.       |

***

<br>


---

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