Redeem Stackable Discounts
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 up to and including the specific discount being calculated for the stacked redemption. |
| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |
| total_discount_amount | total_discount_amount = discount_amount + items_discount_amount | This field sums up all order-level and all product-specific discounts |
| applied_discount_amount | N/A | This field shows the 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 |
API keys with a Merchant role can't use this endpoint.
📘 Rollbacks
You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your rollback request.
📘 Also available on client-side
This method is also accessible through public keys which you can use in client-side apps: mobile and web browser apps. Go to the dedicated endpoint to learn more.
Request
- Base URLhttps://api.voucherify.io
- URLhttps://api.voucherify.io/v1/redemptions
- Auth
- API key in header X-App-Id and API key in header X-App-Token
- or OAuth 2Implicit: https://api.voucherify.io/v1/oauth/tokenScopes: api, redemptions
Request body
Example request
{
"redeemables": [
{
"reward": {
"id": "rew_EPx1hCTpqzF0HW1z9NKckZH4"
}
}
]
}Response
Depending on your project settings: all redeemables must be valid or just one must be valid to result as valid redemption. Read more in the Stacking Rule Documentation.
Changes
No recorded changes to this operation across all 1 revision of this API.