❗️ Deprecated
This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new Stackable Discounts API introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To redeem a voucher, you create a redemption object. It increments the redemption counter and updates the history of the voucher.
In the table below, you can see the logic the API follows to calculate discounts and amounts:
| Field | Calculation | Description |
|---|---|---|
| amount | N/A | This field shows the order amount before applying any discount |
| total_amount | total_amount = amount - total_discount_amount | This field shows the order amount after applying all the discounts |
| discount_amount | discount_amount = previous_discount_amount + applied_discount_amount | This field sums up all order-level discounts applied to a patricular order |
| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts applied to this order |
| total_discount_amount | total_discount_amount = discount_amount + items_discount_amount | This field sums up all order-level and all product-specific discounts applied to this order |
| applied_discount_amount | N/A | This field shows order-level discount applied in a particular request |
| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |
| total_applied_discount_amount | total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount | This field sums up all order-level and all product-specific discounts applied in a particular request |