Retrieve the best available price across multiple hotels for a specific arrival date, length of stay and guest configuration.
curl --request POST \
--url https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays \
--header 'Content-Type: application/json' \
--data '
{
"arrivalDate": "2027-08-31",
"nightCount": 3,
"guests": [
{
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
}
],
"filter": {
"ratePlan": {
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"hotels": {
"exceptions": [
1234
]
},
"rooms": {
"exceptions": [
3456
]
},
"rates": {
"exceptions": [
5678
]
},
"currency": "EUR",
"options": [],
"customerLocation": {
"geonameId": 3017382
},
"loyaltyProgram": {
"membershipLevel": 0
}
},
"impersonation": {
"hotelId": 1234,
"groupId": 9876,
"userId": 1357,
"bookingEngineId": "1XXA"
}
}
'const url = 'https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
arrivalDate: '2027-08-31',
nightCount: 3,
guests: [{adults: 2, children: [{age: 10, count: 1}], infants: 0}],
filter: {
ratePlan: {groupId: 9876, referenceRateCode: 'RACKPRI'},
hotels: {exceptions: [1234]},
rooms: {exceptions: [3456]},
rates: {exceptions: [5678]},
currency: 'EUR',
options: [],
customerLocation: {geonameId: 3017382},
loyaltyProgram: {membershipLevel: 0}
},
impersonation: {hotelId: 1234, groupId: 9876, userId: 1357, bookingEngineId: '1XXA'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays"
payload = {
"arrivalDate": "2027-08-31",
"nightCount": 3,
"guests": [
{
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
}
],
"filter": {
"ratePlan": {
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"hotels": { "exceptions": [1234] },
"rooms": { "exceptions": [3456] },
"rates": { "exceptions": [5678] },
"currency": "EUR",
"options": [],
"customerLocation": { "geonameId": 3017382 },
"loyaltyProgram": { "membershipLevel": 0 }
},
"impersonation": {
"hotelId": 1234,
"groupId": 9876,
"userId": 1357,
"bookingEngineId": "1XXA"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'arrivalDate' => '2027-08-31',
'nightCount' => 3,
'guests' => [
[
'adults' => 2,
'children' => [
[
'age' => 10,
'count' => 1
]
],
'infants' => 0
]
],
'filter' => [
'ratePlan' => [
'groupId' => 9876,
'referenceRateCode' => 'RACKPRI'
],
'hotels' => [
'exceptions' => [
1234
]
],
'rooms' => [
'exceptions' => [
3456
]
],
'rates' => [
'exceptions' => [
5678
]
],
'currency' => 'EUR',
'options' => [
],
'customerLocation' => [
'geonameId' => 3017382
],
'loyaltyProgram' => [
'membershipLevel' => 0
]
],
'impersonation' => [
'hotelId' => 1234,
'groupId' => 9876,
'userId' => 1357,
'bookingEngineId' => '1XXA'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"arrivalDate\": \"2027-08-31\",\n \"nightCount\": 3,\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n }\n ],\n \"filter\": {\n \"ratePlan\": {\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"hotels\": {\n \"exceptions\": [\n 1234\n ]\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"options\": [],\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n }\n },\n \"impersonation\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"userId\": 1357,\n \"bookingEngineId\": \"1XXA\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays")
.header("Content-Type", "application/json")
.body("{\n \"arrivalDate\": \"2027-08-31\",\n \"nightCount\": 3,\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n }\n ],\n \"filter\": {\n \"ratePlan\": {\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"hotels\": {\n \"exceptions\": [\n 1234\n ]\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"options\": [],\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n }\n },\n \"impersonation\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"userId\": 1357,\n \"bookingEngineId\": \"1XXA\"\n }\n}")
.asString();[
{
"hotelId": 1234,
"rateId": 5678,
"roomId": 3456,
"minimumStay": 2,
"maximumStay": 15,
"availability": 3,
"totalPrice": 100.5,
"originalTotalPrice": 120,
"offerCodeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "Available",
"guests": {
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
},
"unavailabilityReasons": [
"None"
],
"additionalTaxes": 5.5,
"additionalFees": 2,
"includedTaxes": 9.15,
"includedFees": 1.5
}
]{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Reference
Hotels (Stays)
Best price for a specific stay, across multiple hotels
POST
/
Planning
/
2018A
/
BestPrice
/
Hotels
/
Stays
Retrieve the best available price across multiple hotels for a specific arrival date, length of stay and guest configuration.
curl --request POST \
--url https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays \
--header 'Content-Type: application/json' \
--data '
{
"arrivalDate": "2027-08-31",
"nightCount": 3,
"guests": [
{
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
}
],
"filter": {
"ratePlan": {
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"hotels": {
"exceptions": [
1234
]
},
"rooms": {
"exceptions": [
3456
]
},
"rates": {
"exceptions": [
5678
]
},
"currency": "EUR",
"options": [],
"customerLocation": {
"geonameId": 3017382
},
"loyaltyProgram": {
"membershipLevel": 0
}
},
"impersonation": {
"hotelId": 1234,
"groupId": 9876,
"userId": 1357,
"bookingEngineId": "1XXA"
}
}
'const url = 'https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
arrivalDate: '2027-08-31',
nightCount: 3,
guests: [{adults: 2, children: [{age: 10, count: 1}], infants: 0}],
filter: {
ratePlan: {groupId: 9876, referenceRateCode: 'RACKPRI'},
hotels: {exceptions: [1234]},
rooms: {exceptions: [3456]},
rates: {exceptions: [5678]},
currency: 'EUR',
options: [],
customerLocation: {geonameId: 3017382},
loyaltyProgram: {membershipLevel: 0}
},
impersonation: {hotelId: 1234, groupId: 9876, userId: 1357, bookingEngineId: '1XXA'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays"
payload = {
"arrivalDate": "2027-08-31",
"nightCount": 3,
"guests": [
{
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
}
],
"filter": {
"ratePlan": {
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"hotels": { "exceptions": [1234] },
"rooms": { "exceptions": [3456] },
"rates": { "exceptions": [5678] },
"currency": "EUR",
"options": [],
"customerLocation": { "geonameId": 3017382 },
"loyaltyProgram": { "membershipLevel": 0 }
},
"impersonation": {
"hotelId": 1234,
"groupId": 9876,
"userId": 1357,
"bookingEngineId": "1XXA"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'arrivalDate' => '2027-08-31',
'nightCount' => 3,
'guests' => [
[
'adults' => 2,
'children' => [
[
'age' => 10,
'count' => 1
]
],
'infants' => 0
]
],
'filter' => [
'ratePlan' => [
'groupId' => 9876,
'referenceRateCode' => 'RACKPRI'
],
'hotels' => [
'exceptions' => [
1234
]
],
'rooms' => [
'exceptions' => [
3456
]
],
'rates' => [
'exceptions' => [
5678
]
],
'currency' => 'EUR',
'options' => [
],
'customerLocation' => [
'geonameId' => 3017382
],
'loyaltyProgram' => [
'membershipLevel' => 0
]
],
'impersonation' => [
'hotelId' => 1234,
'groupId' => 9876,
'userId' => 1357,
'bookingEngineId' => '1XXA'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"arrivalDate\": \"2027-08-31\",\n \"nightCount\": 3,\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n }\n ],\n \"filter\": {\n \"ratePlan\": {\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"hotels\": {\n \"exceptions\": [\n 1234\n ]\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"options\": [],\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n }\n },\n \"impersonation\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"userId\": 1357,\n \"bookingEngineId\": \"1XXA\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/Planning/2018A/BestPrice/Hotels/Stays")
.header("Content-Type", "application/json")
.body("{\n \"arrivalDate\": \"2027-08-31\",\n \"nightCount\": 3,\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n }\n ],\n \"filter\": {\n \"ratePlan\": {\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"hotels\": {\n \"exceptions\": [\n 1234\n ]\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"options\": [],\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n }\n },\n \"impersonation\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"userId\": 1357,\n \"bookingEngineId\": \"1XXA\"\n }\n}")
.asString();[
{
"hotelId": 1234,
"rateId": 5678,
"roomId": 3456,
"minimumStay": 2,
"maximumStay": 15,
"availability": 3,
"totalPrice": 100.5,
"originalTotalPrice": 120,
"offerCodeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "Available",
"guests": {
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
},
"unavailabilityReasons": [
"None"
],
"additionalTaxes": 5.5,
"additionalFees": 2,
"includedTaxes": 9.15,
"includedFees": 1.5
}
]{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Body
application/json
The stay to price (arrival date and number of nights), the parties of guests to accommodate, and the hotels, rooms and rates of the rate plan to look at.
Request the best prices for a given stay, for a given number of guests, over multiple hotels
Response
One entry per hotel and party of guests, with the best price found for the whole stay, its availability and, when the stay is not available, the reasons.
list of reasons why the stay is not available
Why the entity is not available. Returned together with the availability status.
- None: No unavailability reason applies, the entity is available
- MinStay: Minimum stay constraint is not met
- MaxStay: Maximum stay constraint is not met
- Other: Entity is not available for another reason
- GuestsDoNotFitInRoom: Entity is not available for this number of guests
Available options:
None, MinStay, MaxStay, Other, GuestsDoNotFitInRoom Was this page helpful?