Last updated

Displaying discounts

Follow the recommendations outlined below to correctly display discount information for deals and rates within your application.


Upon querying availability or searching for accommodations, the response will include discount data in the products.deal object.

Use this infomation to indicate to travellers that a discount is available for a product.

Best practices

Discount percentage

  • If you display the discount_percentage ensure that the public_price is also shown, typically with a strikethrough, to highlight the original price before the discount.

  • Display discounts only to eligible travellers. For example, ensure that mobile_rate discounts are only shown to travellers using a compatible mobile device.

Localisation

  • Always respect localisation and currency formatting:
    • Geo rates are often region-specific, and currency formatting may vary based on the user's location or the property's location.
    • Always ensure that the correct currency is displayed and use proper formatting for prices.
      • For example, for prices in Euros, use the and follow the correct local conventions for number formatting and decimal places.

Example:

{
  "currency": "EUR",
  "products": [
    {
      "deal": {
        "discount_percentage": 20,
        "public_price": 150.00,
        "tags": ["limited_time_deal"]
      },
      "price": {
        "book": 120.00
      }
    }
  ]
}

Display example

For example, if a call to /accommodations/search returns the following deal information:

{
  ...
  "currency": "EUR",
  ...
  "products": [
    ...
    "id": "xxxxxxxx_x_xxxxxxxxx_x_x_x",
    "deal": {
      "discount_percentage": 45,
      "public_price": 1005.00,
      "tags": [
        "limited_time_deal"
      ]
    },
    ...
    "price": {
      "book": 553.00,
    },

You could display this on the search results page as follows:

Limited Time Deal Search

Similarly, if the same information is returned from a call to the /accommodations/availability, you can display it on the property page like this:

Limited Time Deal Availability

Dealing with "Null" deals

Sometimes, no deals will apply to a product. In such cases, the products.deal object will return null.

Make sure to handle this case in your application gracefully.

If no deal is available, you might want to display a standard price with no discount information.

Example response with no deals

{
  "currency": "EUR",
  "products": [
    {
      "id": "xxxxxxxx_x_xxxxxxxxx_x_x_x",
      "deal": null,
      "price": {
        "book": 100.00
      }
    }
  ]
}

genius-bulb Ensure your interface does not display any discount-related information when no deals are available to avoid confusion for users.


Curious to know more?