This guide provides information on the hotel median/mean rate policy used in the Spotnana platform. The policy replaces a fixed price cap for hotel bookings with a dynamic maximum in-policy amount that adjusts automatically to the traveler's destination and travel dates.
The calculation and policy are applied as follows:
- An administrator uses a rule in the company policy to set the parameters that control which hotels are comparable (e.g., 3-5-star hotels within a 20-mile radius of the search location).
- When a traveler searches for hotels, the platform calculates either the median or mean nightly rate (depending on how you configured the system) across the comparable hotels in the search results.
- A buffer (a percentage or a fixed amount) is applied on top of the calculated rate. Any hotel rate above the resulting amount is marked as Out of Policy.
As an administrator, you can configure the rule when creating a company policy or updating a company policy. The rule is defined in the hotelPolicyRules > hotelMedianRateNightly > hotelMedianRateProps object. The following fields define which hotel characteristics are used to calculate the rate:
| Fields | Description |
|---|---|
searchRadius | The radius around the search location within which a hotel is considered comparable. The object contains the length and unit (e.g., MILE, KM) fields. |
ratingRange | The star rating range for hotels that will be considered comparable. The object contains the min and max fields (e.g., a minimum of 3 and a maximum of 5 includes only 3-star to 5-star hotels in the calculation). |
prepaidQualifier | Defines how prepaid rates are treated in the calculation. The available values are: - INCLUDE_PREPAID: Includes both prepaid and pay-at-property rates for calculation.- EXCLUDE_PREPAID: Excludes prepaid rates and includes only pay-at-property rates for calculation.- PREPAID_ONLY: Includes only prepaid rates for calculation. |
refundableOnly | Defines whether non-refundable rates are considered in the calculation. When set to true, only refundable rates are included in the calculation. When it's false both refundable and non-refundable rates will be included in the rate calculation. The default value is false. |
statisticalMethod | The statistical method used to calculate the recommended maximum hotel rate. The available values are MEDIAN and MEAN. The default value is MEDIAN. For definitions of these terms, see choosing a statistical method. |
hideRateStatistics | When set to true, the calculated rate statistics are not returned in the hotel search and hotel details API responses. The policy is still enforced in the background. When set to false, the metadata > rateStatistics object is returned in the response. The default value is false.Note: Whether the hideRateStatistics is set to true or false, the rate calculation is not shown in the user interface for the traveler. They will only see an Out of Policy tag on property listings that don't satisfy the rate calculation. |
Here's a sample request for the update a company policy API containing the rule configuration:
// ... payload truncated for focus
{
"hotelPolicyRules": {
"hotelMedianRateNightly": {
"hotelMedianRateProps": {
"searchRadius": {
"length": 20,
"unit": "MILE"
},
"ratingRange": {
"min": 3,
"max": 5
},
"prepaidQualifier": "INCLUDE_PREPAID",
"refundableOnly": false,
"statisticalMethod": "MEDIAN",
"hideRateStatistics": false
}
}
}
}In the example above, the median nightly rate is calculated using the rates of 3-star to 5-star hotels located within 20 miles of the traveler's search location. Prepaid rates are included in the calculation. Because refundableOnly is set to false, non-refundable rates are also included.
The statisticalMethod field in the update a company policy API determines how the reference rate is calculated from the comparable hotels:
| Fields | Description |
|---|---|
MEDIAN | The middle value when all comparable rates are sorted from lowest to highest. This means, the value at which half of the comparable rates are higher and half are lower. For example, assume a hotel search returns five comparable hotels with nightly rates of USD 200, USD 220, USD 250, USD 300, and USD 950. The median rate is USD 250 (the middle value). Note: When the search returns an even number of comparable hotels, the median is calculated as the average of the two middle values. |
MEAN | The average of all comparable rates. Every rate contributes to this value, so a few unusually expensive or low-cost properties can shift this value significantly. For example, assume a hotel search returns five comparable hotels with nightly rates of USD 200, USD 220, USD 250, USD 300, and USD 950. The mean rate is USD 384 (i.e., a total of all rates divided by 5). |
Set the statisticalMethod field to MEDIAN when you want the policy to reflect what a typical hotel costs in the search area, unaffected by a small number of premium or budget properties. Use MEAN when you want every rate in the search to influence the policy budget.
The calculated rate on its own doesn't limit what a traveler can book. To enforce a maximum price, you must add a rule of type MAX_HOTEL_BOOKING_PRICE to the rules > ruleType array in the update policy API. This rule defines the buffer applied on top of the calculated rate using the following fields in the maxHotelBookingPriceProps object:
| Fields | Description |
|---|---|
difference | The buffer applied to the calculated rate. This can be set to a percentage (e.g., 15%) or a fixed amount (e.g., USD 100) by using the percentage or money field respectively. |
type | Defines how the buffer is applied. Use MORE_THAN_MEDIAN to allow bookings above the calculated rate by the buffer amount, or LESS_THAN_MEDIAN to restrict bookings to a value below the calculated rate. |
isTaxIncluded | Defines if the comparison uses the total rate including taxes and fees (true) or the base rate (false). The default value is true. See the tax inclusion section for more information on how taxes affect policy budgets. |
Here's a sample request containing the buffer rule in the update a company policy API:
// ... payload truncated for focus
{
"rules": [
{
"ruleType": "MAX_HOTEL_BOOKING_PRICE",
"policyValue": {
"universalProps": {
"maxHotelBookingPriceProps": {
"difference": {
"percentage": 15
},
"type": "MORE_THAN_MEDIAN",
"isTaxIncluded": true
}
}
}
}
]
}In the example above, assume the calculated median rate for a search is USD 850. With a buffer of 15% above the median, the maximum in-policy amount is USD 977.50. A room with a total rate of USD 950 would be displayed as In Policy, while a room with a total rate of USD 1000 would be displayed as Out of Policy.
If you want to understand why a specific hotel rate is in-policy or out-of-policy, view the rate statistics calculated for the search. The get hotel search results endpoint returns the calculated values in the metadata > rateStatistics object. The get hotel details endpoint returns them in the rateStatistics object.
Here's a sample response from the get hotel search results endpoint containing the rate statistics:
// ... payload truncated for focus
{
"metadata": {
"rateStatistics": {
"median": {
"total": {
"amount": 850.00,
"currencyCode": "USD"
},
"base": {
"amount": 772.50,
"currencyCode": "USD"
}
},
"mean": {
"total": {
"amount": 872.40,
"currencyCode": "USD"
},
"base": {
"amount": 794.10,
"currencyCode": "USD"
}
},
"sampleSize": 42,
"policyType": "SET_BY_ADMIN",
"statisticalMethod": "MEDIAN"
}
}
}In the example above, the rate statistics are structured as follows:
- The
medianandmeanobjects contain the calculated nightly rates, each with atotal(including taxes and fees) and abase(excluding taxes and fees) amount. The value used for policy evaluation depends on how thestatisticalMethodandisTaxIncludedsettings are configured in the applicable policy. - The
sampleSizefield indicates the number of hotels used in the calculation. In this example, 42 comparable hotels were found within the configured search radius and rating range. - The
policyTypefield indicates how the calculation parameters were determined. The valueSET_BY_ADMINmeans the parameters configured in the company policy were used, whileDEFAULTmeans the platform's default parameters were used because the applicable policy doesn't define them. - The
statisticalMethodfield indicates whether the median or the mean value is used as the reference rate for the policy evaluation.
The rateStatistics object is optional. It's omitted from the response when the policy hides the statistics using the hideRateStatistics field (see configuring the policy), or when the search doesn't return enough comparable hotels for the calculation.
For every hotel rate returned in the search results, the platform compares the rate against the maximum in-policy amount (the calculated rate plus the buffer). The comparison uses the total rate when isTaxIncluded is set to true and the base rate when it's set to false.
When a rate exceeds the maximum in-policy amount, the violation is returned in the policyInfo > ruleResultInfos > violationInfos array. The violation contains the predicate MAX_HOTEL_BOOKING_PRICE_INCLUDING_TAX, or MAX_HOTEL_BOOKING_PRICE_EXCLUDING_TAX when isTaxIncluded is set to false. The expectedValue field contains the maximum in-policy amount. The actualValue field contains the actual rate of the room being evaluated.
Here's a sample response from the get hotel details endpoint containing a violation:
// ... payload truncated for focus
{
"policyInfo": {
"ruleResultInfos": [
{
"violationInfos": [
{
"predicate": "MAX_HOTEL_BOOKING_PRICE_INCLUDING_TAX",
"expectedValue": {
"money": {
"amount": 977.50,
"currencyCode": "USD"
}
},
"actualValue": {
"money": {
"amount": 1000.00,
"currencyCode": "USD"
}
}
}
]
}
]
}
}In the example above, the maximum in-policy amount was calculated as USD 977.50 (a median rate of USD 850 plus a 15% buffer). The room's rate of USD 1000 exceeds that amount, so the room will be marked as Out of Policy.
The rate statistics reflect the search that was performed. They are calculated per search and are not returned as part of the booking details after the booking is created. To review the values that a booking was evaluated against, read the rateStatistics object at search time or from the get hotel details response before the booking is created.
By default, the rate statistics are calculated using all the comparable hotels returned in the search results (see Configuring the policy). However, if you want the calculated rate to only include the rates of company preferred properties then you can limit the calculation to preferred properties only.
The properties which are designated as preferred are selected by the company or the TMC and can be updated in the platform using the update company vendors API.
When updating the company policy, use the hotelPolicyRules > hotelMedianRateNightly > hotelMedianRateProps > preferredPropertiesRateStatsLimit object to set the policy rate calculation to only use company-preferred properties.
To enable the preferredPropertiesRateStatsLimit object, you must set the following 2 fields:
| Fields | Description |
|---|---|
limitCalculationToPreferredProperties | When set to true, the rate value is calculated using only the preferred properties among the comparable hotels, provided the minimum number of properties defined in the minimumPreferredPropertiesRequired field is met. The default value is false. |
minimumPreferredPropertiesRequired | The minimum number of preferred properties that must be present among the comparable hotels for the preferred only restriction to apply. When limitCalculationToPreferredProperties is set to true, the value must be greater than 0. Otherwise, the request to create or update the company policy will return a validation error. |
The calculation then works as follows:
- If the number of preferred properties among the comparable hotels is greater than or equal to
minimumPreferredPropertiesRequired, the rate statistics are calculated using only the preferred properties. - If the number of preferred properties is less than
minimumPreferredPropertiesRequired, the calculation uses all the comparable hotels.
This limit only changes the set of hotels used in the calculation. The type of statistical method (median or mean) you've chosen will still apply here.
Here's a sample request for the update a company policy API containing the limit configuration:
{
"hotelPolicyRules": {
"hotelMedianRateNightly": {
"hotelMedianRateProps": {
"searchRadius": {
"length": 20,
"unit": "MILE"
},
"ratingRange": {
"min": 3,
"max": 5
},
"statisticalMethod": "MEDIAN",
"preferredPropertiesRateStatsLimit": {
"limitCalculationToPreferredProperties": true,
"minimumPreferredPropertiesRequired": 3
}
}
}
}
}With the above policy configuration in place, assume a hotel search returns 12 comparable hotels, and 4 of them are preferred properties with nightly rates of USD 210, USD 230, USD 250, and USD 290. Because 4 preferred properties meet the configured minimum of 3, the median rate is calculated as USD 240 (the average of the two middle rates, USD 230 and USD 250). In the hotel search API, the metadata > rateStatistics > sampleSize field will return the value 4.
However, if the same search returned only 2 preferred properties, the calculation would fall back to all 12 comparable hotels as it doesn't meet the requirement of the "minimumPreferredPropertiesRequired": 3 setting. In that case the sampleSize field will return the value 12.