Redeem Stackable Discounts (client-side) (Beta)

Use this method to redeem up to 5 redeemables in the single API request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.

Response schema

All promo codes and tiers provided in the redeemables array are redeemed during the request and returned in the API response. As a result, there are child redemptions related to redemptions of each redeemable and parent_redemption that presents to the final effect of redeeming all redeemables and stores the list of child redemptions.

Response

Description

redemptions array of objects

redemptions array lists all child redemptions that were executed during the request. Each child redemption returns Redemption object with detailed information on how each discount/code was applied to the order.

parent_redemption object

parent_redemption represents the final effect of all child redemptions executed during the request.

order object

order object presents details of the order provided in the request after all discounts are applied. You can read more about returned order properties in the table below.

How API returns calculated discounts and order amounts in the response

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 order amount before applying any discount

total_amount

total_amount = amount - total_discount_amount

This field shows order amount after applying all the discounts

discount_amount

discount_amount = previous_discount_amonut + 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 id

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 id

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

📘

Rollbacks

You can't roll back a child redemption. When you call rollback on stacked redemption, all child redemptions will be rolled back. You need to refer to a parent_redemption_id in your rollback request.

Parameters

Language
Click Try It! to start a request and see the response here!