curl --request POST \
--url https://{apiBaseUrl}/Planning/2018A/BestPrice/Rooms \
--header 'Content-Type: application/json' \
--data '
{
"beginDate": "2027-08-31",
"endDate": "2027-08-31",
"guests": {
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
},
"filter": {
"ratePlan": {
"hotelId": 1234,
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"rooms": {
"exceptions": [
3456
]
},
"rates": {
"exceptions": [
5678
]
},
"currency": "EUR",
"customerLocation": {
"geonameId": 3017382
},
"loyaltyProgram": {
"membershipLevel": 0
},
"options": [],
"maximumStay": 15
},
"behaviour": "LowestLengthOfStay",
"behaviours": [],
"impersonation": {
"hotelId": 1234,
"groupId": 9876,
"userId": 1357,
"bookingEngineId": "1XXA"
}
}
'const url = 'https://{apiBaseUrl}/Planning/2018A/BestPrice/Rooms';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
beginDate: '2027-08-31',
endDate: '2027-08-31',
guests: {adults: 2, children: [{age: 10, count: 1}], infants: 0},
filter: {
ratePlan: {hotelId: 1234, groupId: 9876, referenceRateCode: 'RACKPRI'},
rooms: {exceptions: [3456]},
rates: {exceptions: [5678]},
currency: 'EUR',
customerLocation: {geonameId: 3017382},
loyaltyProgram: {membershipLevel: 0},
options: [],
maximumStay: 15
},
behaviour: 'LowestLengthOfStay',
behaviours: [],
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/Rooms"
payload = {
"beginDate": "2027-08-31",
"endDate": "2027-08-31",
"guests": {
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
},
"filter": {
"ratePlan": {
"hotelId": 1234,
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"rooms": { "exceptions": [3456] },
"rates": { "exceptions": [5678] },
"currency": "EUR",
"customerLocation": { "geonameId": 3017382 },
"loyaltyProgram": { "membershipLevel": 0 },
"options": [],
"maximumStay": 15
},
"behaviour": "LowestLengthOfStay",
"behaviours": [],
"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/Rooms",
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([
'beginDate' => '2027-08-31',
'endDate' => '2027-08-31',
'guests' => [
'adults' => 2,
'children' => [
[
'age' => 10,
'count' => 1
]
],
'infants' => 0
],
'filter' => [
'ratePlan' => [
'hotelId' => 1234,
'groupId' => 9876,
'referenceRateCode' => 'RACKPRI'
],
'rooms' => [
'exceptions' => [
3456
]
],
'rates' => [
'exceptions' => [
5678
]
],
'currency' => 'EUR',
'customerLocation' => [
'geonameId' => 3017382
],
'loyaltyProgram' => [
'membershipLevel' => 0
],
'options' => [
],
'maximumStay' => 15
],
'behaviour' => 'LowestLengthOfStay',
'behaviours' => [
],
'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/Rooms");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"beginDate\": \"2027-08-31\",\n \"endDate\": \"2027-08-31\",\n \"guests\": {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n },\n \"filter\": {\n \"ratePlan\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n },\n \"options\": [],\n \"maximumStay\": 15\n },\n \"behaviour\": \"LowestLengthOfStay\",\n \"behaviours\": [],\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/Rooms")
.header("Content-Type", "application/json")
.body("{\n \"beginDate\": \"2027-08-31\",\n \"endDate\": \"2027-08-31\",\n \"guests\": {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n },\n \"filter\": {\n \"ratePlan\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n },\n \"options\": [],\n \"maximumStay\": 15\n },\n \"behaviour\": \"LowestLengthOfStay\",\n \"behaviours\": [],\n \"impersonation\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"userId\": 1357,\n \"bookingEngineId\": \"1XXA\"\n }\n}")
.asString();[
{
"rateId": 5678,
"roomId": 3456,
"behaviour": "LowestLengthOfStay",
"arrivalDate": "2027-08-31",
"minimumStay": 2,
"maximumStay": 15,
"availability": 3,
"currency": "EUR",
"totalPrice": 100.5,
"originalTotalPrice": 120,
"offerCodeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "Available",
"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>"
}Rooms
Best price per room type, for one hotel, over a date range
curl --request POST \
--url https://{apiBaseUrl}/Planning/2018A/BestPrice/Rooms \
--header 'Content-Type: application/json' \
--data '
{
"beginDate": "2027-08-31",
"endDate": "2027-08-31",
"guests": {
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
},
"filter": {
"ratePlan": {
"hotelId": 1234,
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"rooms": {
"exceptions": [
3456
]
},
"rates": {
"exceptions": [
5678
]
},
"currency": "EUR",
"customerLocation": {
"geonameId": 3017382
},
"loyaltyProgram": {
"membershipLevel": 0
},
"options": [],
"maximumStay": 15
},
"behaviour": "LowestLengthOfStay",
"behaviours": [],
"impersonation": {
"hotelId": 1234,
"groupId": 9876,
"userId": 1357,
"bookingEngineId": "1XXA"
}
}
'const url = 'https://{apiBaseUrl}/Planning/2018A/BestPrice/Rooms';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
beginDate: '2027-08-31',
endDate: '2027-08-31',
guests: {adults: 2, children: [{age: 10, count: 1}], infants: 0},
filter: {
ratePlan: {hotelId: 1234, groupId: 9876, referenceRateCode: 'RACKPRI'},
rooms: {exceptions: [3456]},
rates: {exceptions: [5678]},
currency: 'EUR',
customerLocation: {geonameId: 3017382},
loyaltyProgram: {membershipLevel: 0},
options: [],
maximumStay: 15
},
behaviour: 'LowestLengthOfStay',
behaviours: [],
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/Rooms"
payload = {
"beginDate": "2027-08-31",
"endDate": "2027-08-31",
"guests": {
"adults": 2,
"children": [
{
"age": 10,
"count": 1
}
],
"infants": 0
},
"filter": {
"ratePlan": {
"hotelId": 1234,
"groupId": 9876,
"referenceRateCode": "RACKPRI"
},
"rooms": { "exceptions": [3456] },
"rates": { "exceptions": [5678] },
"currency": "EUR",
"customerLocation": { "geonameId": 3017382 },
"loyaltyProgram": { "membershipLevel": 0 },
"options": [],
"maximumStay": 15
},
"behaviour": "LowestLengthOfStay",
"behaviours": [],
"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/Rooms",
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([
'beginDate' => '2027-08-31',
'endDate' => '2027-08-31',
'guests' => [
'adults' => 2,
'children' => [
[
'age' => 10,
'count' => 1
]
],
'infants' => 0
],
'filter' => [
'ratePlan' => [
'hotelId' => 1234,
'groupId' => 9876,
'referenceRateCode' => 'RACKPRI'
],
'rooms' => [
'exceptions' => [
3456
]
],
'rates' => [
'exceptions' => [
5678
]
],
'currency' => 'EUR',
'customerLocation' => [
'geonameId' => 3017382
],
'loyaltyProgram' => [
'membershipLevel' => 0
],
'options' => [
],
'maximumStay' => 15
],
'behaviour' => 'LowestLengthOfStay',
'behaviours' => [
],
'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/Rooms");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"beginDate\": \"2027-08-31\",\n \"endDate\": \"2027-08-31\",\n \"guests\": {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n },\n \"filter\": {\n \"ratePlan\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n },\n \"options\": [],\n \"maximumStay\": 15\n },\n \"behaviour\": \"LowestLengthOfStay\",\n \"behaviours\": [],\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/Rooms")
.header("Content-Type", "application/json")
.body("{\n \"beginDate\": \"2027-08-31\",\n \"endDate\": \"2027-08-31\",\n \"guests\": {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 10,\n \"count\": 1\n }\n ],\n \"infants\": 0\n },\n \"filter\": {\n \"ratePlan\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"referenceRateCode\": \"RACKPRI\"\n },\n \"rooms\": {\n \"exceptions\": [\n 3456\n ]\n },\n \"rates\": {\n \"exceptions\": [\n 5678\n ]\n },\n \"currency\": \"EUR\",\n \"customerLocation\": {\n \"geonameId\": 3017382\n },\n \"loyaltyProgram\": {\n \"membershipLevel\": 0\n },\n \"options\": [],\n \"maximumStay\": 15\n },\n \"behaviour\": \"LowestLengthOfStay\",\n \"behaviours\": [],\n \"impersonation\": {\n \"hotelId\": 1234,\n \"groupId\": 9876,\n \"userId\": 1357,\n \"bookingEngineId\": \"1XXA\"\n }\n}")
.asString();[
{
"rateId": 5678,
"roomId": 3456,
"behaviour": "LowestLengthOfStay",
"arrivalDate": "2027-08-31",
"minimumStay": 2,
"maximumStay": 15,
"availability": 3,
"currency": "EUR",
"totalPrice": 100.5,
"originalTotalPrice": 120,
"offerCodeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "Available",
"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
The period to cover (begin and end dates, both included), the single party of guests to accommodate, the rate plan, rooms and rates to look at, and the behaviours to arbitrate between restricted dates.
Request the best prices for each rate or room over a given period, for a given number of guests
Obsolete: use Behaviours instead. Cannot be combined with a non-empty Behaviours. When the date has restrictions, indicates how to behave
- LowestLengthOfStay: (default): Will prioritise the shortest length of stay, to prevent displaying dates with minimum stays when there is a flexible rate available
- CheapestStay: Will prioritise the cheapest stay, to prevent an overpriced flexible stay from being returned when longer stays are cheaper
- EarliestAvailability: Will prioritise the earliest stay
LowestLengthOfStay, CheapestStay, EarliestAvailability When the date has restrictions, indicates how to behave. Each entity is returned once per requested behaviour, with the behaviour set on each entry. Entries are returned grouped by behaviour, in this order. An empty list is treated as absent: Behaviour is then used, else LowestLengthOfStay is assumed. Duplicate values are ignored.
How to choose the best price when the date has restrictions
- LowestLengthOfStay: (default): Will prioritise the shortest length of stay, to prevent displaying dates with minimum stays when there is a flexible rate available
- CheapestStay: Will prioritise the cheapest stay, to prevent an overpriced flexible stay from being returned when longer stays are cheaper
- EarliestAvailability: Will prioritise the earliest stay
LowestLengthOfStay, CheapestStay, EarliestAvailability Response
One entry per room and requested behaviour, with the best arrival date and price found for that room under that behaviour, and the effective stay restrictions. Entries are grouped by behaviour, in the order of the request, then ordered by room id.
Behaviour this entry was computed for, among the requested behaviours
- LowestLengthOfStay: (default): Will prioritise the shortest length of stay, to prevent displaying dates with minimum stays when there is a flexible rate available
- CheapestStay: Will prioritise the cheapest stay, to prevent an overpriced flexible stay from being returned when longer stays are cheaper
- EarliestAvailability: Will prioritise the earliest stay
LowestLengthOfStay, CheapestStay, EarliestAvailability Was this page helpful?