Returns a list of available rewards for a given customer and purchase.
This method returns a list of all rewards available even if they cannot be used by the given customer at the moment.
This method returns two types of rewards: Discounts (Value Discounts and Percent Discounts) or Cashback. Although not common, it is possible to have all types of rewards active at the same time.
Input parameters
CustomerIdThe id of the customer. It can be email or document (CPF/CNPJ). If a document use numbers only.PurchaseValueCurrent value of the order. Should NOT contains discounts, return codes (vales) or other promotions.DiscountValueIf there is another discount in the order (not from BonifiQ) it can be passed here. BonifiQ use this information to return only rewards that can be used with other discounts. If no discount is being used passnullor0
Main return properties
HasRewardsif this property isfalsemeans there are no rewards available. The entire reward flow must be skipped.ShouldValidateCustomeriftruethe flow must follow the Customer Validation Flow where an PIN CODE will be asked from the customer. Iffalsethe validation flow must be skippedAvailablePointsReturns the amount of points the customer currently have. This is important is Discount Rewards as the customer needs to know how many points he needes to redeem a reward.CashbackEnabledIftruemeans there is a Cashback reward in the list. The customer will be able to use it if he had enough cashbackAvailableCashbackThe amount of Cashback the customer have. It is important to note that the customer may not be able to use it entirely as there are usage rules (such as minimum purchase value).MaxCashbackForCurrentPurchaseThis is the maximum cashback the customer will be able to use in the current purchase. It maybe different fromAvailableCashbackas this property take into account usage rules.
Discounts Rewards
A discount reward offers some discount in exchange of an amount of points. The discount can be a Value (R$10,00 discount in exchange of 100 points) or Percent (15% discount in exchange of 1000 points)-
A discount reward cannot be used partially. Customer must either use all the value or don`t use at all.
It is possible (and rather common) to have multiple Discount Rewards active at same time (for instance: R30,00 for 25 points, 10% for 15 points, etc)
Important properties
Title
Represents brief user-friendly description of the reward (such as “R50,00 em cashback”)
CanUse
Despite the fact the API returns all available rewards you have to check the CanUse property to allow the customer to use this reward. The CanUse property will be true when the customer have enought points and the purchase value is within the configured minimum amount.
If the CanUse property is false you can still show the reward to the customer (in a disabled state). This is useful for him to known which rewards he can redeem in the future.
Requirements
This is an optional string detailing restrictions regarding the Reward such as: Minimum amount of purchase, percent relative to the purchase, etc. It is a user-friendly string so you can show it to the user alongside the reward name and points.
Points This is the cost in points of this reward. It is useful to the customer to know how many points will be deduct from him when this reward is redeemed.
Value For Value Discount this represents the value in cash (eg: 10.00 for a R$10,00 reward). For Percent Discount this is the percent value (eg: 10.00 for a 10% discount).
This property is useful for you to apply the discount in the customer purchase on behalf of BonifiQ.
RewardCanBeCumulative If true the customer can use this reward in conjunction with other discounts. If false the customer can only use this reward if there is no other discount in the order.
Cashback Reward
A Cashback reward also offers an value discount in exchange of points but the amount can be selected by the customer. For instance: the customer can have R5,00.
As the value can be selected, it is necessary to ask de customer for the value he wants to use and use it in redeem
A Cashback maybe not present in the reward list as it could be disabled.
Important properties
Some properties are the same of Discounts Rewards (see above). A few other are exclusive for Cashback
CashbackEnablediftruethe cashback exist and is active. However the user could not be able to use it as he may not have enough balance.AvailableCashbackTotal amount of cashback the use have.MaxCashbackForCurrentPurchaseThis is the maximum amount of cashback that can be used in the current purchase. The value may differ fromAvailableCashbackdue to purchase rules such as minimum value.IsCashbackReturnstrueif this is a cashback reward. If so, we need to ask the customer for the amount he wants to use upon redeeming
Authorizations
Use API Basic Auth Keys
Body
The id of the customer. It can be email or document (CPF/CNPJ). If a document use numbers only.
Current value of the order. Should not contains discounts or other promotions.
If there is another discount in the order (not from BonifiQ) it can be passed here. BonifiQ use this information to return only rewards that can be used with other discounts.
Optional: List of products for cashback eligibility validation. If provided, restricted products will be filtered and the cashback will be calculated based only on eligible items. If not provided, the full PurchaseValue will be used (backward compatible behavior).
Response
Customer data resolved from the informed id. Can be null when the customer is not found.
A list of all available rewards regardless if the user can redeem it or not. Even if the user doest not have enought points to redeem a reward it is still usefull for him
True if any items were restricted from cashback eligibility. Only populated when Items are provided in the request.
Total value of restricted items that cannot receive cashback. Only populated when Items are provided in the request.
Total value eligible for cashback (after filtering restricted items). Only populated when Items are provided in the request.
False if there is no available rewards to redeem. In this case the flow should proceed without showing any information to the user
If true the caller must follow the Validation flow, calling the BonifiQ API to request a token-code from customer. If false the flow can be directed to conclusion
If true the caller must validate the customer signup before considering the customer enrolled.
How many points the customer have. It is useful in scenarios without cashback where rewards are fully point-based.
Returns true if exists a cashback reward. In this case the user will need to be aware of how much Cashback is Available
Returns the total amount of cashback the user have. Will be 0 if CashbackEnable=false.
The maximum amount that can be used for the current purchase order value Cashback have some rules to use such as: in order to spend R$10,00 in cashback the total order value must be of at least R$50,00. In this scenario, the user could have a total amount of available cashback (AvailableCashback) of R$20,00 but as the rule requires at least R$50,00 of purchase he can only use R$10,00. That way even if the customer have a certain amount of Cashback BonifiQ caps this value to the maxium amount he can use for the current purchase, according to rules