Identifying Discounted Products

This guide explains how to retrieve products with discounts or promotions using Content Service API. By filtering specific fields in the API response, you can easily identify and display products that have either discounts or promotional offers.

Fetching Products:

To fetch the full product catalog, use the following content API call:

curl --location 'https://content-service.tixuk.io/api/v3/products' \
--header 'x-tt-retailer: <your-retailer-id>'

Replace <your-retailer-id> with your unique identifier. This API call returns a list of products available for your platform. To identify which products have discounts or promotions, you can filter based on the following fields.


Identifying Discounts and Promotions

In the API response, each product has the following fields, that will tell if the product has a promotion:

  • hasPromotion: Indicates whether the product has an active promotion. If true, the product has a promotion.
    • promotionLabel: Provides the name of the promotion, such as "Exclusive Price". This label can be used to display the promotion to customers.
  • maxDiscountPercentage: Displays the maximum percentage of savings available for the product as an integer. If maxDiscountPercentage > 0, the product is discounted. To display this to customers, you could use the phrase Save up to [maxDiscountPercentage]%, for example, Save up to 45%.

Always use BOTH fields to identify products with promotion:

You should use both conditions together with an OR logic to identify all relevant products.

  • Sometimes, maxDiscountPercentage may be 0 even if the product is discounted. In these cases, hasPromotion: true will still indicate that a promotion is active.
  • Conversely, some products may not have a promotion (hasPromotion: false), but still have a non-zero maxDiscountPercentage. Therefore, filtering should account for both possible cases.

How to Display Discounts and Promotions:

  1. If maxDiscountPercentage is above 0 displaySave up to [maxDiscountPercentage]% .
  2. If promotionLabel exists display promotionLabel
  3. If both maxDiscountPercentage is above 0 and promotionLabel exist display both: Save up to [maxDiscountPercentage]% and promotionLabel at the same time.
  4. If fieldmaxDiscountPercentage is 0 and promotionLabel exists then display promotionLabel only