Skip to main content

Safety Margin

Safety Margin plugin allows discarding options that have a commission lower than expected. Only options that have a commission over gross, equal or lower than those reported in the file will be returned.

The expected commission has to be loaded in a safety-margin file. Sequentially, the rules will be evaluated until a match is found, upon finding it, the process will be stopped and the commission will be evaluated. In the same way, if the rule is not found, the option will be validated.

The matching process uses the clientTokens field, which identify the provided by the client and it is used to filter which business rules can be applied in the request sent.

To get started with the Preference plugin, follow these simple steps:

1.Create and Upload your Safety Margin File

To get started, create your safety margin file in the correct format and then upload it to your SFTP account. We've provided a template file below ⬇️ to help you with this process. Just click on the file name, add your own rules, save it in CSV format, and then upload it to the corresponding folder in your SFTP.

sftp.xmltravelgate.com

📁HotelX
     📁HotelX_0000
         📁BusinessRules
             📄BuyerContext_sequential_safetymargin.csv

File Format Specification

  • File Name: BuyerContext_sequential_safetymargin.csv
  • Directory: HotelX/HotelX_0000/BusinessRules
  • Delimiter: Comma (,)
  • Header Row:
    • RuleId (mandatory): Rule identifier
    • ClientTokens (mandatory): Identifier provided by the client that is used to filter which business rules can be applied for the sent request
      • Separator for multiples codes in the same row: Semicolon ;
    • SupplierCodes (mandatory): Supplier codes you want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • NotSupplierCodes (mandatory): Supplier codes you don't want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • CreationDateFrom: Start creation date (yyyy-mm-dd)
    • CreationDateTo: End creation date (yyyy-mm-dd)
    • CheckInFrom: Check in from date (yyyy-mm-dd)
    • CheckInTo: Check in to date (yyyy-mm-dd)
    • HotelCodes: Hotel codes you want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • NothotelCodes: Hotel codes you don't want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • ChainsCodes: Chain codes you want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • NotChainCodes: Chain codes you don't want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • DestinationCodes: Destination codes you want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • NotDestinationCodes: Destination codes you don't want the rule to be applied to.
      • Separator for multiples codes in the same row: Semicolon ;
    • Percentage (mandatory): Commission value, decimal separator must be point .
📹Learn how to change the format of the csv file in order to edit and save it

2. Execute Safety Margin Plugin in your Query

Once you've uploaded your safety margin file, to use the plugin add the following field to the settings node of your request. Note that safety margin plugin can just be executed in search query. In order to successfully execute the safety margin plugin, you will need to create the request with the following variables.

  • step: "RESPONSE_OPTION"
  • type: "PRE_STEP"
  • name: "safety_margin"
"settings": {
"plugins": [
{
"step": "RESPONSE_OPTION",
"pluginsType": {
"type": "PRE_STEP",
"name": "safety_margin"
}
}
]
}