Post JSON data here to get room price and availability.
See here for information about using the JSON API.
{
"authentication": {
"apiKey": "apiKeyAsSetInAccountSettings",
"propKey": "propKeyAsSetForTheProperty"
},
"roomId": 12345,
"from": "20251026",
"to": "20251124",
"incMaxStay": 0,
"incMultiplier": 0,
"incOverride": 0,
"allowInventoryNegative": 0,
"incChannelBookingLimit": 0
}
| Field | Description | Data Type | Required | Notes |
|---|---|---|---|---|
| apiKey | apiKey for account | string | required | |
| propKey | propKey for property | string | required | |
| roomId | room id for room | integer | required | |
| from | from date | date (yyyymmdd) | optional | default=today |
| to | to date | date (yyyymmdd) | optional | default=+30 days |
| incMaxStay | include maximum stay | integer | optional | default=0; 0=no, 1=yes |
| incMultiplier | include multiplier | integer | optional | default=0; 0=no, 1=yes |
| incOverride | include override status | integer | optional | default=0; 0=no, 1=yes |
| allowInventoryNegative | allow negative inventory values | integer | optional | default=0; 0=no, 1=yes |
| incChannelBookingLimit | include the maximum booking override for each channel | integer | optional | default=0; 0=no, 1=yes |
| Field | Description | Data Type | Notes |
|---|---|---|---|
| i | Inventory | integer | Number of units available |
| m | Minimum Stay | integer | Minimum stay for this date |
| mx | Maximum Stay | integer | Maximum stay for this date |
| p1 | Price row 1 | decimal | |
| p2 | Price row 2 | decimal | |
| p3 | Price row 3 | decimal | |
| p4 | Price row 4 | decimal | |
| p5 | Price row 5 | decimal | |
| p6 | Price row 6 | decimal | |
| p7 | Price row 7 | decimal | |
| p8 | Price row 8 | decimal | |
| p9 | Price row 9 | decimal | |
| p10 | Price row 10 | decimal | |
| p11 | Price row 11 | decimal | |
| p12 | Price row 12 | decimal | |
| p13 | Price row 13 | decimal | |
| p14 | Price row 14 | decimal | |
| p15 | Price row 15 | decimal | |
| p16 | Price row 16 | decimal | |
| o | Override status | integer | missing or 0=none, 1=blackout, 2=no checkin, 3=no checkout, 4=nocheckin/out, 5=exceptional period |
| x | Multiplier | integer | Percentage value of normal price; missing=auto (100%) |
<?php
/*
* The following sample uses a PHP array to construct the JSON data and php-curl to post it to the API.
* This sample will get one room with the specified parameters.
* Change the parameters to values for your account.
*/
$auth = array();
$auth['apiKey'] = 'apiKeyAsSetInAccountSettings';
$auth['propKey'] = 'propKeyAsSetForTheProperty';
$data = array();
$data['authentication'] = $auth;
$data['roomId'] = 12345;
$data['from'] = date('Ymd', strtotime('+1 day'));
$data['to'] = date('Ymd', strtotime('+30 days'));
$json = json_encode($data);
$url = "https://manage.bookingautomation.com/api/json/getRoomDates";
$ch=curl_init();
curl_setopt($ch, CURLOPT_POST, 1) ;
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($ch);
curl_close ($ch);
echo $result;
?>