Points2Currency - Coupon
In order to use the points2currency coupon there are some minor additions needed to support the usage.
Keep existing logic for existing coupons, but treat the new coupon differently on the add transaction call.
There is a new coupon. "type":"PointBased" (NB : This type will be changed to "PointsToCurrency" )
When doing
GET {{RootURL}}/api/v2.0/stores/{{StoreId}}/members/{{MemberId}}/coupons/
from the POS - Diller API will respond, and calculate dynamically the current available currency for the member to redeem in the POS on the purchase in "discount_value"
If "discount_value":"935" - You can deduct 935 (your currency) from the purchase.
When sending the transaction you insert the coupon, and the redeemed value on the transaction payload on header level like this :
Diller will then make sure to deduct available points, and add new points when applicable.
If the total of the purchase is below the available discount_value : Discount the total purchase, and send the redeemed_value in the transaction to Diller. The member will keep the remaining points.