There are 2 types of rewards:
Value field of the request bodyThey both can be used with this method. Just be aware that:
Value must have the selected cashback value for the purchase. Use only if the reward is Cashback typeThe rewardId field can be obtained by calling the rewards/available endpoint
The customerId field in the body is the same used in the rewards/avaible endpoint.
OriginalKey fieldThis field allows you to create idempotency: even if you make the exactly same request twice it will redeem only once.
As distributed systems should be fault-tolerant it may result in requests being done more than one time. Not using the OriginalKey may duplicate a redeem request
Inform some string that is unique for this change.
For instance: if you are redeeming the reward Id=OPQ for customerID=ABC regarding the OrderId=123 with Value=10,our key could be OPQ-ABC-123-10
If you dont need this kind of verification you can just use some time-related string, such as 2023-01-01 23:59:00:000
It’s important to note that unlike the customers/{id}/redeem endpoint this call will not generate a coupon in BonifiQ. That is true even if the reward if configured so.
This is by design as in Point of Sale endpoints it is expected that the caller (PoS) will give the customer the necessary discounts.
ExternalCode returnOne of the most important fields returned by this method is the ExternalCode. This field represents an External identification for this redeem. This exact value must be passed on the Coupon field for the Order Add Method from this API. This will make a link between the redeem and the order.
Important: Remember to pass the ExternalCode value to the Coupon field when adding an order
Use API Basic Auth Keys
Parameters used in redeeming
The id of the customer. It can be email or document (CPF/CNPJ).
Used only for Cashback Rewards. It the Cashback value selected by the customer. You can use either Points or Value for representing the selected amount of cashback to use.
Used only for Cashback Rewards. It the Cashback represented by points selected by the customer. You can use either Points or Value for representing the selected amount of cashback to use.
This field allows you to create idempotency: even if you make the exactly same request twice it will consume the redeem only once.
As distributed systems should be fault-tolerant it may result in requests being done more than one time. Not using the OriginalKey may duplicate a redeem request
Inform some string that is unique for this change.
For instance: if you are redeeming the reward Id=OPQ for customerID=ABC regarding the OrderId=123 with Value=10,our key could be OPQ-ABC-123-10
If you dont need this kind of verification you can just use some time-related string, such as 2023-01-01 23:59:00:000
Use this field as a key-value store for fields unique to your Business Use Case
Use this field to send redeem origin. Have 4 types: LandingPage, Widget, Copilot, Checkout, API, PDV.
0, 1, 2, 3, 4, 5 A Branch is physical location or outlet of a store (loja, filial, etc). This is used to receive information of which store the purchase was made. It can be later used to create rules for points or filtering reports.
A sales person is the person responsible for the sale. It can be used for filtering reports.
Normally this endpoint generates a redeem without a coupon. Setting this property to true forces to generate a coupon in the ecommerce plataform