Method to retrieve and manage parentage modifiers for derived rates
Some rates may be configured such that their price is not set directly, but rather be derived from another rate (aka the parent rate) based on some modifier values. Such rates are also called child rates.
You can tell if a rate is child by the parent
field of the
Rates Listing or
Rate Info API response. Α parent
value
greater than 0, indicates that the rate is a child rate and the rate ID of it's parent is returned here.
The rate parentage API methods are currently in limited beta. Please contact us first if you want to use them.
The rate parentage API methods only support JSON response format. To get a response in JSON make sure you are also sending the Accept: application/json header.
To list all parentage periods, use GET http verb.
/rate/{property_code}/{unit_type}/{rate_id}/parentage
NAME | TYPE | RANGE / SET | REQUIRED | DEFAULT | EXAMPLE | NOTES |
---|---|---|---|---|---|---|
modifiers | boolean | NO | false | &modifiers=true | The default value is false |
{ "method": "https://rest.reserve-online.com/rate/{property_code}/{unit_type}/{rate_id}/parentage", "http_method": "GET", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [ { "type": "URL", "name": "modifiers", "value": false } ], "data": { "periods": [ { "period_id": INTEGER, // Period id "from": ISO 8601, // Start of date range inclusive. This field will not be included for the default period (period_id=0) "to": ISO 8601, // End of date range. This field will not be included for the default period (period_id=0) "modifiers": [ // Modifiers will be included conditionally when the request parameter `modifiers=true` { "adults": INTEGER, // Number of adults "children": INTEGER, // Number of children "percent": DECIMAL, // Percentile change on the parent rate. Positive numbers increase the price and negative decrease it. "amount": MONEY // The absolute change on the parent rate. Positive numbers increase the price and negative decrease it. } ] } ] } }
{ "method": "http://rest.reserve-online.com/rate/DEMO/FML/12345/parentage", "http_method": "GET", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [ { "type": "URL", "name": "modifiers", "value": false } ], "data": { "periods": [ { "period_id": 0, "modifiers": [ { "adults": 1, "children": 0, "percent": 20, "amount": 0 }, { "adults": 2, "children": 0, "percent": 20, "amount": 0 } ] }, { "period_id": 1, "from": "2023-12-18", "to": "2023-12-18", "modifiers": [ { "adults": 1, "children": 0, "percent": 20, "amount": 5 }, { "adults": 2, "children": 0, "percent": 20, "amount": 10 } ] } ] } }
To create a new parentage override period, use POST http verb. The request payload must contain the from/to dates and modifiers
Request body must be in valid JSON format.
Send header Content-Type: application/json
Update is made only if the entire request body is successfully parsed and validated.
The rate must already be defined as derived/child through the WebHotelier extranet. You can not create the default period, i.e. make a rate child if it isn't already.
Overlapping periods are not allowed. If any date of the period overlaps an existing one, an error is returned and the update is not applied.
The modifiers array must contain all possible pax combinations supported for the room type the rate belongs to. If not all pax combinatios are provided or any invalid ones are included, an error is returned and the update is not applied.
To get the list of pax combinations, use the
Rates Feed API for this specific rate
(/manage/rates/{rate_id}
).
A modifiers.percent
positive value of 20 means that a 20% increase will be applied to the parent rate
price.
For example:
"percent": -15
, the final price would be ((100-15)/100)*80=68 EUR.
The amount
modifier is applied after the percent
calculation.
Using the above example:
modifiers.amount
value of 5, the final price would be 96+5=101 EUR, or
68+5=73 EUR for the negative percentage case.
amount
value is negative, it will be subtracted from the parent rate price. /rate/{property_code}/{unit_type}/{rate_id}/parentage
The request payload should have the following structure:
{ "from": ISO 8601, // Start of date range inclusive "to": ISO 8601, // End of date range "modifiers": [ { "adults": INTEGER, // Number of adults "children": INTEGER, // Number of children "percent": DECIMAL, // Percentile change on the parent rate. Use positive numbers to increase and negative to decrease "amount": MONEY // The absolute change on the parent rate. Use positive numbers to increase and negative to decrease } ] }
{ "from": "2023-12-18", "to": "2023-12-18", "modifiers": [ { "adults": 1, "children": 0, "percent": 20, "amount": 0 }, { "adults": 2, "children": 0, "percent": 15, "amount": 10 } ] }
{ "method": "https://rest.reserve-online.com/rate/{property_code}/{unit_type}/{rate_id}/parentage", "http_method": "POST", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [], "data": { "period_id": INTEGER, // Period id "from": ISO 8601, // Start of date range inclusive "to": ISO 8601, // End of date range "modifiers": [ { "adults": INTEGER, // Number of adults "children": INTEGER, // Number of children "percent": DECIMAL, // Percentile change on the parent rate. Positive numbers increase the price and negative decrease it. "amount": MONEY // The absolute change on the parent rate. Positive numbers increase the price and negative decrease it. } ] } }
{ "method": "http://rest.reserve-online.com/rate/DEMO/FML/12345/parentage", "http_method": "POST", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [], "data": { "period_id": 0, "from": "2023-12-18", "to": "2023-12-18", "modifiers": [ { "adults": 1, "children": 0, "percent": 20, "amount": 0 }, { "adults": 2, "children": 0, "percent": 15, "amount": 10 } ] } }
To get a specific parentage period and its details, use GET http verb with the appropriate period_id value:
/rate/{property_code}/{unit_type}/{rate_id}/parentage/{period_id}
{ "method": "https://rest.reserve-online.com/rate/{property_code}/{unit_type}/{rate_id}/parentage/{period_id}", "http_method": "GET", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [], "data": { "period_id": INTEGER, // Period id "from": ISO 8601, // Start of date range inclusive. This field will not be included for the default period (period_id=0) "to": ISO 8601, // End of date range. This field will not be included for the default period (period_id=0) "modifiers": [ { "adults": INTEGER, // Number of adults "children": INTEGER, // Number of children "percent": DECIMAL, // Percentile change on the parent rate. Positive numbers increase the price and negative decrease it. "amount": MONEY // The absolute change on the parent rate. Positive numbers increase the price and negative decrease it. } ] } }
{ "method": "http://rest.reserve-online.com/rate/DEMO/FML/12345/parentage/0", "http_method": "GET", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [], "data": { "period_id": 0, "modifiers": [ { "adults": 1, "children": 0, "percent": 20, "amount": 0 }, { "adults": 2, "children": 0, "percent": 15, "amount": 10 } ] } }
To update a Rate Parentage Period, use PUT http verb with the appropriate period_id value. The request payload must contain the from/to dates and modifiers
All requirements and guidelines of the POST method apply to the PUT method as well.
/rate/{property_code}/{unit_type}/{rate_id}/parentage/{period_id}
The request payload should have the following structure:
{ "from": ISO 8601, // Start of date range inclusive. This field should not be included for the default period with period_id=0 "to": ISO 8601, // End of date range. This field should not be included for the default period with period_id=0 "modifiers": [ { "adults": INTEGER, // Number of adults "children": INTEGER, // Number of children "percent": DECIMAL, // Percentile change on the parent rate. Use positive numbers to increase and negative to decrease "amount": MONEY // The absolute change on the parent rate. Use positive numbers to increase and negative to decrease } ] }
{ "period_id": 1, "from": "2024-01-10", "to": "2024-01-31", "modifiers": [ { "adults": 1, "children": 0, "percent": 10, "amount": 0 }, { "adults": 2, "children": 0, "percent": 10, "amount": 5 } ] }
{ "method": "https://rest.reserve-online.com/rate/{property_code}/{unit_type}/{rate_id}/parentage/{period_id}", "http_method": "PUT", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [], "data": { "period_id": INTEGER, // Period id "from": ISO 8601, // Start of date range inclusive. This field must not be sent for the default period (period_id=0) "to": ISO 8601, // End of date range. This field must not be sent for the default period (period_id=0) "modifiers": [ { "adults": INTEGER, // Number of adults "children": INTEGER, // Number of children "percent": DECIMAL, // Percentile change on the parent rate. Use positive numbers to increase and negative to decrease "amount": MONEY // The absolute change on the parent rate. Use positive numbers to increase and negative to decrease } ] } }
{ "method": "http://rest.reserve-online.com/rate/DEMO/FML/12345/parentage/0", "http_method": "PUT", "http_code": 200, "error_code": "OK", "error_msg": "", "params": [], "data": { "period_id": 0, "modifiers": [ { "adults": 1, "children": 0, "percent": 20, "amount": 0 }, { "adults": 2, "children": 0, "percent": 15, "amount": 10 } ] } }
To delete a Rate Parentage Period, use DELETE http verb with the appropriate period_id value.
You are not allowed to delete the default period (period_id=0).
/rate/{property_code}/{unit_type}/{rate_id}/parentage/{period_id}
{ "method": "http://rest.reserve-online.com/rate/DEMO/FML/12345/parentage/1", "http_method": "DELETE", "http_code": 200, "error_code": "OK", "error_msg": "" }