Get room availability
After selecting a hotel from search results, fetch its available rooms and rates. Then prebook the chosen rate to validate pricing before confirming.
POST /api/Hotel/rooms
Returns available room types, rates, and pricing for a specific hotel within a search session.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
search_id |
string | Yes | The searchId from your hotel search |
checkin |
datetime | Yes | Check-in date (ISO 8601) |
checkout |
datetime | Yes | Check-out date (ISO 8601) |
currency |
string | Yes | 3-letter currency code |
client_nationality |
string | Yes | 2-letter nationality code |
user_id |
int64 | Yes | Your TravelExe user ID |
stacked |
boolean | Yes | true to stack multiple room rates together, false for individual rates |
rooms |
RoomRequest[] | Yes | Room configuration |
RoomRequest object
| Field | Type | Description |
|---|---|---|
adults |
string | Number of adults in this room |
children_ages |
array | Ages of children (empty array if none) |
Example request
POST /api/Hotel/rooms
X-Api-Key: your_api_key
Content-Type: application/json
{
"search_id": "srch_7f3a2b19e4",
"checkin": "2026-08-01T00:00:00",
"checkout": "2026-08-05T00:00:00",
"currency": "USD",
"client_nationality": "IN",
"user_id": 1001,
"stacked": false,
"rooms": [
{ "adults": "2", "children_ages": [] }
]
}
Example response
{
"hotelId": 12345,
"hotelName": "Grand Hyatt Dubai",
"rooms": [
{
"rateKey": "RATE_a7b3c1d9e2f4",
"roomType": "Deluxe King Room",
"boardType": "Bed & Breakfast",
"boardCode": "BB",
"maxOccupancy": 3,
"totalPrice": {
"amount": 280.00,
"currency": "USD"
},
"pricePerNight": 70.00,
"cancellationPolicy": {
"type": "free_cancellation",
"freeCancellationDeadline": "2026-07-28T23:59:00",
"description": "Free cancellation until 28 Jul 2026"
},
"amenities": ["King bed", "City view", "Free WiFi", "Mini bar"]
},
{
"rateKey": "RATE_x9y8z7w6v5",
"roomType": "Superior Twin Room",
"boardType": "Room Only",
"boardCode": "RO",
"maxOccupancy": 2,
"totalPrice": {
"amount": 240.00,
"currency": "USD"
},
"pricePerNight": 60.00,
"cancellationPolicy": {
"type": "non_refundable",
"description": "Non-refundable"
},
"amenities": ["Twin beds", "Garden view", "Free WiFi"]
}
]
}
rateKey values are time-sensitive. Prebook immediately after the guest selects a room — do not store rate keys or delay the prebook step.
POST /api/Hotel/prebook
Validates the selected rate with the supplier in real time and confirms the final price. Always call prebook before book.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
rate_key |
string | Yes | The rate key from the rooms response |
currency |
string | Yes | 3-letter currency code |
client_nationality |
string | Yes | 2-letter nationality code |
user_id |
int64 | Yes | Your TravelExe user ID |
rooms |
PrebookRoomRequest[] | Yes | Room pax details |
PrebookRoomRequest object
| Field | Type | Description |
|---|---|---|
adults |
integer | Number of adults |
children_ages |
integer[] | Ages of children |
Example request
POST /api/Hotel/prebook
X-Api-Key: your_api_key
Content-Type: application/json
{
"rate_key": "RATE_a7b3c1d9e2f4",
"currency": "USD",
"client_nationality": "IN",
"user_id": 1001,
"rooms": [
{ "adults": 2, "children_ages": [] }
]
}
Example response
{
"status": "confirmed",
"rateKey": "RATE_a7b3c1d9e2f4",
"priceConfirmed": true,
"totalPrice": {
"amount": 280.00,
"currency": "USD"
},
"priceChanged": false,
"cancellationPolicy": {
"type": "free_cancellation",
"freeCancellationDeadline": "2026-07-28T23:59:00"
}
}
If the price has changed since the rooms fetch, priceChanged will be true and the new price will be reflected in totalPrice. Always show the updated price to the guest before proceeding to book.
Get cancellation policy
Retrieve the cancellation policy for a booking by its reference number:
`GET /api/Hotel/GetCancellationPolicy?foreRefNo=
| Parameter | Type | Required | Description |
|---|---|---|---|
foreRefNo |
string | Yes | The supplier reference number for the booking |
Code samples
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Api-Key", "your_api_key");
// Get rooms
var roomsResponse = await client.PostAsJsonAsync(
"https://api.travelexe.com/api/Hotel/rooms",
new {
search_id = "srch_7f3a2b19e4",
checkin = "2026-08-01T00:00:00",
checkout = "2026-08-05T00:00:00",
currency = "USD",
client_nationality = "IN",
user_id = 1001,
stacked = false,
rooms = new[] { new { adults = "2", children_ages = new int[]{} } }
});
var rooms = await roomsResponse.Content.ReadFromJsonAsync<RoomsResult>();
// Prebook selected rate
var prebookResponse = await client.PostAsJsonAsync(
"https://api.travelexe.com/api/Hotel/prebook",
new {
rate_key = rooms.Rooms[0].RateKey,
currency = "USD",
client_nationality = "IN",
user_id = 1001,
rooms = new[] { new { adults = 2, children_ages = new int[]{} } }
});
var prebook = await prebookResponse.Content.ReadFromJsonAsync<PrebookResult>();
const headers = {
'X-Api-Key': 'your_api_key',
'Content-Type': 'application/json'
};
const { rooms } = await fetch('https://api.travelexe.com/api/Hotel/rooms', {
method: 'POST', headers,
body: JSON.stringify({
search_id: 'srch_7f3a2b19e4',
checkin: '2026-08-01T00:00:00',
checkout: '2026-08-05T00:00:00',
currency: 'USD', client_nationality: 'IN',
user_id: 1001, stacked: false,
rooms: [{ adults: '2', children_ages: [] }]
})
}).then(r => r.json());
const prebook = await fetch('https://api.travelexe.com/api/Hotel/prebook', {
method: 'POST', headers,
body: JSON.stringify({
rate_key: rooms[0].rateKey,
currency: 'USD', client_nationality: 'IN',
user_id: 1001,
rooms: [{ adults: 2, children_ages: [] }]
})
}).then(r => r.json());
import requests
headers = {'X-Api-Key': 'your_api_key'}
rooms = requests.post('https://api.travelexe.com/api/Hotel/rooms', headers=headers, json={
'search_id': 'srch_7f3a2b19e4',
'checkin': '2026-08-01T00:00:00',
'checkout': '2026-08-05T00:00:00',
'currency': 'USD', 'client_nationality': 'IN',
'user_id': 1001, 'stacked': False,
'rooms': [{'adults': '2', 'children_ages': []}]
}).json()
prebook = requests.post('https://api.travelexe.com/api/Hotel/prebook', headers=headers, json={
'rate_key': rooms['rooms'][0]['rateKey'],
'currency': 'USD', 'client_nationality': 'IN',
'user_id': 1001,
'rooms': [{'adults': 2, 'children_ages': []}]
}).json()