Preference
The Preference Plugin is a more advanced and configurable version of the Cheapest Price Plugin. While the Cheapest Price Plugin selects the lowest-priced option/s based on defined criteria, the Preference Plugin allows you to prioritize certain options over others, even if they are not the absolute cheapest.
This is particularly useful when using Hotel-X in multi mode, where multiple suppliers may offer different prices for the same hotel, board, or room type. With the Preference Plugin, you can set preference rules that influence how results are ranked and selected.
For example, you might want to:
- Prioritize a specific supplier for certain hotels, even if their price is up to X% higher.
- Give preference to a supplier during specific dates or destinations.
- Customize selection rules based on your business strategy.
By leveraging the Preference Plugin, you gain greater control over how options are selected, allowing you to fine-tune your results based on your own supplier relationships, pricing strategy, and business goals.
Preference Plugin Workflow
-
Gets the rules stored in database which will establish which options will be added or discarded based on several factors as % of tolerance of the price, hotel codes, supplier, etc.
-
Go over each option returned by the suppliers and if it matches any of the rules recovered from database, their price will be recalculated by multiplying it by the tolerance factor set in the rule. For example, if the factor is 10%, the new price will be 90% of the original price. This recalculation of the price is only used for aggregation purposes—the final response will always return the original prices.
-
Sorts the options in price order (from cheap to expensive) by the recalculated price.
-
Take the first 'n' options (4 by default, configurable with the
optionsPerKeyparameter). That is, this will involve selecting the n cheapest options once the prices have been recalculated, taking the preference rules into account. -
There is only one exception to this, which is when a rule states that competitors must be filtered out. Thus, if any of the options meet such a rule, for that group of options, the option that filters out competitors will be the only one returned.
Can I have an example on how a preference rule would work?
Primary Key used: hotel, room, board
Options per key: 2
Preference Rule Loaded: Tolerance Percentage = 1% for all supplier "SUP1" hotels. The 'filterCompetitors' option is enabled.
Scenario:
- Supplier SUP1 offers 126€ for Hotel Santo Domingo (Double Room, All Inclusive).
- Supplier SUP2 offers 125€ for Hotel Santo Domingo (Double Room, All Inclusive).
By default, SUP2 wins because it has the lowest price. However, with the preference rule applied:
- We first group all options with the same aggregation primary key (hotel: Hotel Santo Domingo, room: Double Room, board: All Inclusive).
- Since there is a preference rule for SUP1 hotels, we recalculate the price and internally save it like:
Formula:
Option price * (100 - tolerance%) / 100
126€ * (100 - 1) / 100 = 124.74€
- Since 124.74€ is lower than 125€ and 'filterCompetitors' is enabled, the SUP2 option is discarded, making SUP1 the only returned option.
If 'filterCompetitors' were disabled, SUP1 would be added to the group, and both options would be returned in the results (as 'optionsPerKey' = 2).
To get started with the Preference plugin, follow these simple steps:
1. Create your Preference Rules on our Travelgate website
Your searches will apply the Preference rules you create on our Travelgate website, under the Plugins → Preference section.
In this section, you can:
- View all your existing rules.
- Create new ones.
- Edit or delete existing rules.
- Configure a Tiebreaker — a priority list of suppliers that determines which one to keep in case multiple options are equally ranked after applying your rules.

Creating or editing a rule is done through a simple 3-step form in the Preference App section of the Plugins page. Each step defines how and when your rule will be applied.
Step 1. Rule Name
Give your rule a clear and identifiable name. This name will help you easily recognize it later when managing or prioritizing your rules.

Step 2. Rule Configuration
This step defines both the conditions under which your preference will apply and the preference behavior itself.
2.1. Target Criteria
Specify the conditions that must be met for this preference rule to apply. Here, you can define:
- Supplier(s): The supplier(s) to which the preference should apply.
- Hotel Filters (optional): You can narrow down the rule to specific hotel codes or even to hotels within a certain country.
- Date Filters (optional): Define booking or check-in date ranges for which this preference should be valid.
- Rate Filters (optional): Apply the preference only to certain rate conditions (e.g., non-refundable, package, etc.).
These filters allow you to create very specific preference behaviors based on your business strategy.

2.2. Preference Settings
Define how your preference should affect the supplier’s competitiveness:
-
Percentage: This value determines the adjustment applied when comparing suppliers under the defined criteria.
- A positive percentage gives an advantage to options that meet this rule’s conditions — they will be considered more competitive.
- A negative percentage makes those options less competitive compared to others.
-
Filter Competitors: When set to
true, if at least one option in the group matches this rule’s conditions, that option will automatically be selected, and all others will be discarded.

Step 3. Review and Create the Rule
Before saving, review all your configurations. Once confirmed, click Create Rule. You can edit or delete the rule at any time, or even assign it a higher priority than other existing rules.
Additionally, you can access logs to track which user created or modified each rule and when the change occurred.

2. Execute Preference Plugin in your Query
Once you've uploaded your preference rules in the website, to use the plugin add the following field to the settings node of your request. Note that preference plugin can just be executed in search query. In order to successfully execute the preference plugin, you will need to create the request with the following variables:
step: "RESPONSE"type: "PRE_STEP"name: "preference"parameters:-
primaryKey: Criteria used to aggregate, separated by commas. For example: "hotel, supplier, board". Possible values are:- hotel
- supplier
- board
- binding
- cancelPolicy
- currency
- market
- payment
- promotion
- rateRules
- refundable
- room
- supplement
- surcharges
- ratePlan
- status
-
optionsPerKey: Limits the number of options per aggregation group, this being defined by the previous primakyKey parameter. Value: Integer. By default it is 4. -
internalCurrencyConversion: Enables internal currency conversion for aggregation. Value:trueorfalse. By default, aggregation considers the currency, meaning that only options sharing the same currency are grouped together. If you receive responses from multiple suppliers using different currencies but want to internally compare them, you can enable this option. When set totrue, Travelgate will apply an internal currency conversion (updated every day) to allow aggregation and comparison of options within the sameprimaryKeygroup, even if they have different currencies. This conversion is only used for aggregation purposes—the final response will always return prices in their original currency.
-
primaryKey is a mandatory parameter in order to activate the plugin. optionsPerKey and internalCurrencyConversion are optional and complementary of the first.
"settings": {
"plugins": [
{
"step": "RESPONSE",
"pluginsType": {
"type": "PRE_STEP",
"name": "preference",
"parameters" : [
{
"key" : "primaryKey",
"value" : "hotel,board,room"
},
{
"key" : "optionsPerKey",
"value" : "2"
},
{
"key" : "internalCurrencyConversion",
"value" : "true"
}
]
}
}
]
}
Special Aggregation Key: eqRates
There is a special value for the aggregation key "eqRates" that will combine the rateRules and ratePlans of an option and group all of the options, based on the file uploaded in the SFTP with the name:
📁HotelX
📁HotelX_0000
📁BusinessRules
📄SupplierContext_rateplanraterule.csv
With this uploaded CSV file, all the options with the ratePlan code "NOREEMBOLSABLE" and no rateRules will be compared with each other. Similarly, all the options without a ratePlan code or without a mapped ratePlan and with rateRules set to "NON_REFUNDABLE" will also be compared with each other.