curl --request POST \
--url https://{cluster}.voucherify.io/v1/promotions/tiers/{promotionTierId}/redemption \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"customer": {
"source_id": "annie@lemon.com",
"name": "Annie Lemon",
"email": "annie@lemon.com"
},
"order": {
"amount": 200000,
"items": [
{
"source_id": "apple534",
"product_id": "prod_anJ03RZZq74z4v",
"related_object": "product",
"quantity": 2,
"price": 50000,
"product": {
"override": true,
"name": "Apple iPhone 8",
"metadata": {
"shop": "citycenter",
"category": "electronics"
}
},
"metadata": {
"series": "2022-783CV"
}
},
{
"sku_id": "sku_0KtP4rvwEECQ2U",
"source_id": "apple534-ihd5",
"related_object": "sku",
"quantity": 1,
"price": 100000,
"sku": {
"override": true,
"sku": "Apple iPad 10 Silver 64GB",
"metadata": {
"category": "electronics"
}
}
}
]
}
}
'{
"id": "r_0ca2699201c03f121b",
"object": "redemption",
"date": "2023-03-21T05:49:00.807Z",
"customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==",
"metadata": null,
"result": "SUCCESS",
"order": {
"id": "ord_IVEF85NZCXmP4S1fGmImSTwH",
"source_id": null,
"created_at": "2023-03-21T05:49:00.772Z",
"updated_at": null,
"status": "PAID",
"amount": 200000,
"discount_amount": 80000,
"total_discount_amount": 80000,
"total_amount": 120000,
"applied_discount_amount": 80000,
"total_applied_discount_amount": 80000,
"items": [
{
"object": "order_item",
"source_id": "apple534",
"related_object": "product",
"product_id": "prod_anJ03RZZq74z4v",
"quantity": 2,
"amount": 100000,
"price": 50000,
"subtotal_amount": 100000,
"product": {
"id": "prod_0c5d6689b39320059b",
"source_id": "prod_anJ03RZZq74z4v",
"name": "Apple iPhone 8",
"metadata": {
"shop": "citycenter",
"category": "electronics"
}
},
"metadata": {
"series": "2022-783CV"
}
},
{
"object": "order_item",
"source_id": "apple534-ihd5",
"related_object": "sku",
"sku_id": "sku_0KtP4rvwEECQ2U",
"quantity": 1,
"amount": 100000,
"price": 100000,
"subtotal_amount": 100000,
"sku": {
"sku": "Apple iPad 10 Silver 64GB",
"metadata": {
"category": "electronics"
}
}
}
],
"metadata": {},
"customer": {
"id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"object": "customer"
},
"customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"referrer_id": null,
"object": "order",
"redemptions": {
"r_0ca2699201c03f121b": {
"date": "2023-03-21T05:49:00.807Z",
"related_object_type": "promotion_tier",
"related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj"
}
}
},
"channel": {
"channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d",
"channel_type": "API"
},
"customer": {
"id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"name": "Annie Lemon",
"email": "annie@lemon.com",
"source_id": "annie@lemon.com",
"metadata": {
"age": 2
},
"object": "customer"
},
"related_object_type": "promotion_tier",
"related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"voucher": null,
"promotion_tier": {
"id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"created_at": "2022-09-23T08:31:23.022Z",
"updated_at": "2023-02-01T07:47:57.324Z",
"name": "Percent Discount",
"banner": "Get 40% off",
"action": {
"discount": {
"type": "PERCENT",
"percent_off": 40,
"effect": "APPLY_TO_ORDER"
}
},
"metadata": {},
"hierarchy": 2,
"campaign": {
"id": "camp_w7BUstntAm8jbIDjfM49volj",
"start_date": "2019-08-16T00:00:00.000Z",
"expiration_date": null,
"active": true,
"object": "campaign"
},
"campaign_id": "camp_w7BUstntAm8jbIDjfM49volj",
"active": true,
"start_date": "2022-09-21T00:00:00.000Z",
"validity_day_of_week": [
1,
2,
3,
4,
5
],
"summary": {
"redemptions": {
"total_redeemed": 5
},
"orders": {
"total_amount": 616000,
"total_discount_amount": 246400
}
},
"object": "promotion_tier",
"validation_rule_assignments": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "asgm_z6MvMg2Zf2UABNWN",
"rule_id": "val_q8qUBMOh5qIQ",
"related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"related_object_type": "promotion_tier",
"object": "validation_rules_assignment"
}
],
"total": 1
},
"category_id": null,
"categories": []
}
}❗️ Deprecated
This endpoint represents the deprecated version of the API responsible for promotion tier 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 promotion, you create a redemption object passing a context.
You can retrieve a list of active promotions through the Validate Promotions endpoint. That validation method will return a list of active promotion tiers identified by thier IDs.
📘 Redemption rollback
Do you need to undo a redemption? You can do it with redemption rollback.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/promotions/tiers/{promotionTierId}/redemption \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"customer": {
"source_id": "annie@lemon.com",
"name": "Annie Lemon",
"email": "annie@lemon.com"
},
"order": {
"amount": 200000,
"items": [
{
"source_id": "apple534",
"product_id": "prod_anJ03RZZq74z4v",
"related_object": "product",
"quantity": 2,
"price": 50000,
"product": {
"override": true,
"name": "Apple iPhone 8",
"metadata": {
"shop": "citycenter",
"category": "electronics"
}
},
"metadata": {
"series": "2022-783CV"
}
},
{
"sku_id": "sku_0KtP4rvwEECQ2U",
"source_id": "apple534-ihd5",
"related_object": "sku",
"quantity": 1,
"price": 100000,
"sku": {
"override": true,
"sku": "Apple iPad 10 Silver 64GB",
"metadata": {
"category": "electronics"
}
}
}
]
}
}
'{
"id": "r_0ca2699201c03f121b",
"object": "redemption",
"date": "2023-03-21T05:49:00.807Z",
"customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==",
"metadata": null,
"result": "SUCCESS",
"order": {
"id": "ord_IVEF85NZCXmP4S1fGmImSTwH",
"source_id": null,
"created_at": "2023-03-21T05:49:00.772Z",
"updated_at": null,
"status": "PAID",
"amount": 200000,
"discount_amount": 80000,
"total_discount_amount": 80000,
"total_amount": 120000,
"applied_discount_amount": 80000,
"total_applied_discount_amount": 80000,
"items": [
{
"object": "order_item",
"source_id": "apple534",
"related_object": "product",
"product_id": "prod_anJ03RZZq74z4v",
"quantity": 2,
"amount": 100000,
"price": 50000,
"subtotal_amount": 100000,
"product": {
"id": "prod_0c5d6689b39320059b",
"source_id": "prod_anJ03RZZq74z4v",
"name": "Apple iPhone 8",
"metadata": {
"shop": "citycenter",
"category": "electronics"
}
},
"metadata": {
"series": "2022-783CV"
}
},
{
"object": "order_item",
"source_id": "apple534-ihd5",
"related_object": "sku",
"sku_id": "sku_0KtP4rvwEECQ2U",
"quantity": 1,
"amount": 100000,
"price": 100000,
"subtotal_amount": 100000,
"sku": {
"sku": "Apple iPad 10 Silver 64GB",
"metadata": {
"category": "electronics"
}
}
}
],
"metadata": {},
"customer": {
"id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"object": "customer"
},
"customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"referrer_id": null,
"object": "order",
"redemptions": {
"r_0ca2699201c03f121b": {
"date": "2023-03-21T05:49:00.807Z",
"related_object_type": "promotion_tier",
"related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj"
}
}
},
"channel": {
"channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d",
"channel_type": "API"
},
"customer": {
"id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB",
"name": "Annie Lemon",
"email": "annie@lemon.com",
"source_id": "annie@lemon.com",
"metadata": {
"age": 2
},
"object": "customer"
},
"related_object_type": "promotion_tier",
"related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"voucher": null,
"promotion_tier": {
"id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"created_at": "2022-09-23T08:31:23.022Z",
"updated_at": "2023-02-01T07:47:57.324Z",
"name": "Percent Discount",
"banner": "Get 40% off",
"action": {
"discount": {
"type": "PERCENT",
"percent_off": 40,
"effect": "APPLY_TO_ORDER"
}
},
"metadata": {},
"hierarchy": 2,
"campaign": {
"id": "camp_w7BUstntAm8jbIDjfM49volj",
"start_date": "2019-08-16T00:00:00.000Z",
"expiration_date": null,
"active": true,
"object": "campaign"
},
"campaign_id": "camp_w7BUstntAm8jbIDjfM49volj",
"active": true,
"start_date": "2022-09-21T00:00:00.000Z",
"validity_day_of_week": [
1,
2,
3,
4,
5
],
"summary": {
"redemptions": {
"total_redeemed": 5
},
"orders": {
"total_amount": 616000,
"total_discount_amount": 246400
}
},
"object": "promotion_tier",
"validation_rule_assignments": {
"object": "list",
"data_ref": "data",
"data": [
{
"id": "asgm_z6MvMg2Zf2UABNWN",
"rule_id": "val_q8qUBMOh5qIQ",
"related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W",
"related_object_type": "promotion_tier",
"object": "validation_rules_assignment"
}
],
"total": 1
},
"category_id": null,
"categories": []
}
}The access token received from the authorization server in the OAuth 2.0 flow.
ID of the promotion tier to be redeemed.
"promo_2EnAik6Jt7dKTOMkRTIgEjZH"
Provide the redemption context in the request body.
Redeem a promotion tier.
A set of key/value pairs that you can send in the request body to check against promotion tiers requiring redemption metadata validation rules to be satisfied. The validation runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the Advanced Rule Builder → Advanced → Redemption metadata satisfy or Basic Builder → Attributes match → REDEMPTION METADATA. Read more.
Returns a redemption object if the redeem operation succeeded.
This is an object representing a promotion tier redemption.
Unique redemption ID.
"r_0bc92f81a6801f9bca"
The type of the object represented by the JSON. This object stores information about the redemption.
Timestamp in ISO 8601 format indicating when the redemption occured.
"2022-10-03T12:24:58.008Z"
Unique customer ID of the redeeming customer.
"cust_i8t5Tt6eiKG5K79KQlJ0Vs64"
Hashed customer source ID.
"track_fxEMFiLowFHg=="
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.
Redemption result.
SUCCESS, FAILURE Defines the details of the order that is related to the redemption.
Show child attributes
Unique order ID, assigned by Voucherify.
"ord_OLWs41pBk7VFn6ZTyX9U6keh"
The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service.
Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.
"2022-10-06T11:40:48.705Z"
Timestamp representing the date and time when the order was updated. The value is shown in the ISO 8601 format.
"2022-10-06T11:47:20.760Z"
Order status.
CREATED, PAID, CANCELED, FULFILLED Order amount before applying any discount.
Sum of all order-level discounts applied to the order.
Sum of all order-level AND all product-specific discounts applied to the order.
total_discount_amount = discount_amount + items_discount_amount
Order amount after applying all the discounts.
total_amount = amount - total_discount_amount
This field shows the order-level discount applied.
This field sums up all order-level and all product-specific discounts applied in a particular request.
Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.
Show child attributes
The type of the object represented by JSON. This object stores information about the order_item.
A unique identifier that represents the product and is assigned by Voucherify.
"prod_5h0wc453_1"
A unique identifier that represents the SKU and is assigned by Voucherify.
"sku_prod_5h0wc453_1_1"
Quantity of the item in the cart.
Represents a total pre-discount amount of order item (price * quantity).
Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the amount.
subtotal_amount=amount-discount_amount
This object stores more information about the related product.
Show child attributes
A unique identifier that represents the product and is assigned by Voucherify.
"prod_5h0wc453_1"
A unique product identifier from your inventory system.
"illy-arabica"
Product name.
"Brewing System"
Unit price of a product. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
This object stores more information about the related SKU.
Show child attributes
A unique identifier that represents the SKU and is assigned by Voucherify.
"sku_prod_5h0wc453_1_1"
A unique SKU identifier from your inventory system.
"illy-arabica-250g"
SKU name.
Unit price of a SKU. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format.
Object containing information about the customer that is making the purchase.
Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
"cust_7iUa6ICKyU6gH40dBU25kQU1"
Unique referrer ID.
"cust_nM4jqPiaXUvQdVSA6vTRUnix"
The type of the object represented by JSON. This object stores information about the order.
Lists details related to the redemption.
Show child attributes
The property name is the unique redemption ID; i.e. r_0ba186c4824e4881e1. This object contains information about the redemption of an incentive.
Show child attributes
Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.
"2022-09-02T17:06:56.649Z"
The source of the incentive.
voucher, promotion_tier Unique ID of the related object that defines the incentive.
Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign.
Defines the details of the channel through which the redemption was issued.
Show child attributes
Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API.
"user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH"
The source of the channel for the redemption. A USER corresponds to the Voucherify Dashboard and an API corresponds to the API.
USER, API Defines the customer that is related to the redemption.
Show child attributes
The unique ID of a customer that is assigned by Voucherify.
"cust_eWgXlBBiY6THFRJwX45Iakv4"
Customer's first and last name.
Customer's email address.
The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service.
The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.
Type of object represented is customer.
Defines the related object.
promotion_tier Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier.
Contains details of the promotion tier and the parent campaign.
Show child attributes
Unique promotion tier ID.
"promo_63fYCt81Aw0h7lzyRkrGZh9p"
Timestamp representing the date and time when the promotion tier was created. The value is shown in the ISO 8601 format.
"2021-12-15T11:34:01.333Z"
Timestamp representing the date and time when the promotion tier was updated. The value is shown in the ISO 8601 format.
"2022-02-09T09:20:05.603Z"
Name of the promotion tier.
Text to be displayed to your customers on your website.
Contains details about the discount applied by the promotion tier.
Show child attributes
Contains information about discount.
Show child attributes
Defines the type of the voucher.
AMOUNT Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.
Formula used to dynamically calculate the discount.
Maximum discount amount per order.
Defines how the discount is applied to the customer's order.
APPLY_TO_ORDER, APPLY_TO_ITEMS, APPLY_TO_ITEMS_PROPORTIONALLY, APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY, APPLY_TO_ITEMS_BY_QUANTITY Flag indicating whether the discount was calculated using a formula.
The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format.
The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy.
Promotion unique ID.
Contains details about promotion tier's parent campaign.
Show child attributes
Unique campaign ID.
Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.
"2022-09-22T00:00:00.000Z"
Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
"2022-09-30T00:00:00.000Z"
Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.
Show child attributes
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour.
"PT1H"
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the start_date and expiration_date using the Disable Campaign endpoint.
true indicates an active campaignfalse indicates an inactive campaignUnique category ID that this campaign belongs to.
"cat_0b688929a2476386a6"
The type of the object represented by the campaign object. This object stores information about the campaign.
Promotion tier's parent campaign's unique ID.
A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the start_date and expiration_date.
true indicates an active promotion tierfalse indicates an inactive promotion tierActivation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is inactive before this date.
"2022-09-23T00:00:00.000Z"
Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is inactive after this date.
"2022-09-26T00:00:00.000Z"
Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.
Show child attributes
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour.
"PT1H"
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
Contains statistics about promotion tier redemptions and orders.
Show child attributes
The type of the object represented by JSON. This object stores information about the promotion tier.
Validation Rule Assignments List
Show child attributes
The type of the object represented by JSON. This object stores information about validation rule assignments.
Identifies the name of the JSON property that contains the array of validation rule assignments.
A dictionary that contains an array of validation rule assignments.
Show child attributes
Validation rule assignment ID.
"asgm_74F7QZoYbUoljwQO"
Validation rule ID.
"val_4j7DCRm2IS59"
The resource ID to which the validation rule was assigned.
"v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT"
The type of resource to which the validation rule was assigned.
voucher, campaign, earning_rule, reward_assignment, promotion_tier, distribution Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
"2022-02-17T08:18:15.085Z"
The type of the object represented by the ID.
validation_rules_assignment Total number of validation rule assignments.
Promotion tier category ID.
"cat_0c9da30e7116ba6bba"
Show child attributes
Unique category ID assigned by Voucherify.
Category name.
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
x >= 0The type of the object represented by the JSON. This object stores information about the category.
category Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
"2022-07-14T10:45:13.156Z"
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
"2022-08-16T10:52:08.094Z"
Was this page helpful?