Unit discount overview
To set up a unit discount via the dashboard, you need to provide the following information: Unit value defines the number of free items attached to the code. Unit type is a product offered for free chosen from your Product Inventory.Please note that this type of discount is based on the Product inventory added to the Products section in your dashboard. If you haven’t synced your products yet, please follow this guide first.
- Add new order items – results in adding items to the cart in number defined by unit value. For example, if the code gives one free t-shirt, then no matter if a customer has the t-shirt already in the cart or not, a free t-shirt will always be added to the order and discounted.
- Add missing order items to match total discount units count – the second option adds items to the cart only if a customer has fewer free items than offered to the code. For example, let’s assume that the code gives one free t-shirt: – If a customer doesn’t have the t-shirt already in the cart, then a free t-shirt will be added to the order. – If a customer already has this item in their cart, then the number of t-shirts already matches the units count. As a result, after applying the code, a discount will be applied to the item which is already in the cart and no items will be added.
- Add multiple item types - the third option gives multiple types of free item(s) to customers. Free item units are always added to the customer’s cart based on either the Add missing items or Add new order items effects.
Create a unique codes campaign with unit discount
Firstly, we need to create campaigns of unique codes, each code will have the value of one t-shirt.There are many attributes and details you can customize while creating a campaign (start and expiration date, validation rules, and many more). If you’re not familiar with all the options, please visit this guide first.
- Create Campaign with discount effect “Add new order items”
- Create Campaign with discount effect “Add missing order items” to match total discount units count
- Create Campaign with discount effect “Add multiple order items” with different discount effects for each item type.
Publish voucher to a customer
Let’s publish one of the unique codes from each of the campaigns to a customer.Validate and redeem unit discount codes
Now, let’s create an exemplary order to test different discount effects. Before redemption, you should invoke validate method for published vouchers to check if a customer and their cart match the promotion criteria.Redemption of the code with discount effect ADD_NEW_ITEMS
In the response body, you can see that despite that one t-shirt is already in the cart, one additional t-shirt was added to the customer order and discounted.
Redemption of the code with discount effect ADD_MISSING_ITEMS
Now, let’s use the same order while redeeming a discount code with the same value and a different discount effect.
Redemption of the code with discount effect ADD_MANY_ITEMS
Finally, let’s redeem a discount code for multiple free item types.