What limits can I create with validation rules?

In this section:

  1. Introduction to validation rules
  2. How to create a rule

    1. Build rules in Validation Rules dashboard section

    2. Build rules in the Campaign manager

  3. Discount applicable to particular products/SKUs

  4. Validation rules with Metadata Schema Validation

  5. Validation rules with product metadata

  6. Time limits for vouchers

Introduction ๐Ÿ‘‹

The aim of creating validation rules is to model desired buying circumstances. Rules are built with attributes and operators divided into 5 categories:

Validation rules

Validation Rules overview


Audience ๐Ÿ‘ฉ๐Ÿ‘ด

By using customer segments you can choose a target segment of your customers or exclude particular customer segments from clients allowed for redemption. While adding validation rules based on segments, you can choose to include/exclude one of the existing segments or create a new segment from scratch.

Audience validation rule

You can also use custom attributes defined previously in Metadata Schema and create unique validation rules based on their values. For example, imagine you have a gym and your customers have different memberships. Despite that Voucherify doesn't have such attribute assigned to customers by default, you can use metadata to put in into customer profiles. By adding property membership to Metadata Schema you can target a specific group of members. 

Val rule with custom segmentation based on metadata

There aren't any limits on type or amount of custom attributes. You can define your customers with properties unique for your business.

 Validation attribute Description Example
Customer segment
(is/ is not)
First property enables you to limit redemptions to specific customer segments. It can be useful if you want to take into account only new customers, or regular clients or any other segments you come up with. 
Redemption is available if a customer enters a segment "regularCustomers" and redemption is not available for customers who enter the segment "newCustomers".
Customer metadata satisfy You don't have to create a customer segment based on metadata as Voucherify can automatically target customers who meet metadata criteria Fo instance, you can state that only customers with revenue above 2000$ are eligible for discount without creating a separate customer segment beforehand


Order structure ๐Ÿ›’

 With the following rules, you can create product-specific promotions based on a cart structure and quantity/ price of items in the cart.

Order structure validation rules

๐Ÿ’กPlease note that you have to import your product catalogue to use the rules listed below. Learn more.

Validation attribute
Description
Example
Contains product 

With this attribute, a customer gets a discount on the condition that the order contains a product
  • in a particular amount - Order items quantity
  • at a particular price - Order item priceContains product
The last option ' Discount applicable to this order itemdefines if the discount is applicable to the added item ( products or SKUs). If you want to discount the product, mark the checkbox.
A customer can redeem the code if the order contains at least 3 products X in the cart.
Does not contain product You can add the products excluded from the promotion A customer can get a discount only if the cart does not contain product X.
Contains SKU SKU (Stock Keeping Unit) is an attribute that differentiates product variants. Used in a validation rule, it makes a coupon active only if the particular variant is in a cart (and optionally set the required amount in the cart). Choose SKU/SKUs which have to be in the cart, and then mark a checkbox "Discount is applicable to this SKU" to make a discount valid for the added items.  A customer can use a gift card only for black and silver iPhones and cannot use it to buy white variant (SKU) of the product
Product and order metadata satisfy Rules based on custom attributes assigned to your products and orders, e.g., series. You can add as many metadata attributes as you wish.
You can read more here.
A discount is applicable only to products which series begins from AT54.
Any order item's product metadata satisfy These rules allow you to make order eligible for a discount if any item in your customer's cart meets metadata set for the given campaign. Customer will get the discount if at least one product in his/her cart meets metadata. 
Each order item's product metadata satisfy These rules allow you to make order eligible for a discount if all items in your customer's cart meets metadata set for the given campaign. For example your customer has to purchase only products in a certain colour for his/her order to be eligible for a discount.

Order volume ๐Ÿ‘œ

Introduce cartโ€™s price-related constraints to up-sell and boost sales.

Order volume validation rule

Validation attribute Description Example
Total amount
You can define a maximum/minimum value of a customer's cart that enables them to use the code. Discount applies only if the total amount of the order is more than $50.
Items quantity 
You can select a required quantity (min/max) of products that need to be in a customer's cart.
Discount applies only if a customer bought at least 5 products at once.
Price of each item
You can set a minimum/maximum price of each product from a customer's cart.


Discount applies only if a price of every item in a cart is more than $50.
Price of any item 
This rule defines a minimum/maximum price required for at least one product from a customer's cart.
If a customer's cart contains at least one product for more than $100, the code can be redeemed.


Budget constraints ๐Ÿ’ฐ

Control promotion budget setting up safety limits which automatically deactivate your promotion Budget Constraints Val Rules

Validation attribute Description Example
Total discounted amount
It defines the overall value of discount that your customers can get by redeeming codes from a particular campaign.
The total value of applied discounts from campaign X has to be less than $10 000.
Total orders value
You can select a maximum value of all orders made within the campaign. When this limit is reached, customers cannot redeem more codes.
Value of all orders made within the Y campaign cannot be more than $20 000. 
Total number of redemptions
It's a total number of redemptions allowed per entire campaign. 

Customers can redeem codes from X campaign 3 000 times. 
Total redeemed gift amount 
It defines a total value of redeemed gift cards amongst the whole  campaign 
Customers can spend $10 000 of the balance from X gift cards campaign.
Redemptions count per customer
It defines
  • a total number of redemptions counted per customer (1)
  • a total number of promo codes that each customer can use (2)
  • a total number of redemptions counted per customer per day (3)

Customers can redeem max. 3 codes within a campaign but only once per code.

Advanced ๐Ÿ”’

Control redemption with rules based on custom fields and access policy. 

Advanced validation rules

Validation attribute Description Example
Redemption metadata satisfy
Read more here.
Redeeming user 
With this  rule  you can manage your team and define which team members or affiliates can/ cannot invoke a coupon redemption User "Denver_department" can invoke redemptions and user "Central_department" cannot redeem codes.
Redeeming API key Count This attribute allows you to limit redemption to particular API keys.  For instance, you can limit redemptions to 3 per specific users with the same API key.
Only for customers who are holders of the card 
With this attribute, you can improve fraud detection and reduce coupon misuses. By using this rule, you ensure that voucher is redeemed by the same person that it was published for (sent). 

(Once you send a code to your customer through one of the distribution channels, publication details are visible in Voucherify). 
When you save the campaign and share the codes, a customer will be able to utilize a coupon only if its publication is assigned to his/her id.  

You can build rules and limits in the 4th stage of a campaign creation or in the 'Validation Rules' dashboard section. The flexible mechanism allows you to implement a wide range of promotion ideas.

Building a rule ๐Ÿ—๏ธ

There are two ways you can create validation rules in Voucherify dashboard:

  1. You can go to the Validation Rules section in the dashboard, create and save a set of rules, and use them later on while creating a campaign or
  2. you can create validation rules from scratch while creating a campaign in the campaign manager

๐Ÿ’ก Validation Rules section comes in handy when you need the same validation rules in your future campaigns. You can save the rules and add them to any campaign without the need to create the rules from scratch every time.

Add and save your rules - Validation Rules dashboard section

Go to the 'Validation Rules' section in the dashboard and choose the Plus to create new rules. Add a name for your new rule/set of rules 

Building validation rules

You can see 5 categories of rules to choose from:

  • In the 1st category, you can choose a customer segment who can/cannot redeem the codes. To build a rule, you need to add an operator is/is not in the first input and choose the desired customer segment from the list of segments in the 2nd input.

Audience validation rule

Rules from remaining categories are built in a similar way.

All active rules that you have confirmed are visible in the grey background below the category.

Already applied validation rules

You can SAVE each rule or set of rules and use them later while creating campaigns in the Campaign manager.


Validation rules in the Campaign Manager

  1. Firstly you need to run the Campaign Manager and choose a campaign type you'd like to create.
  2. Go through the first 3 stages of a campaign creation processValidation rules in campaign manager

In the 4th step, you can add validation rules and define what criteria customers and their orders have to match to make a valid redemption. 

How to build a rule? ๐Ÿค”

1. Add a name for your validation rule/set of rules (they will be automatically saved in 'Validation Rules' dashboard section)

2. Expand the available rules from the category you're interested in and build a restriction.

Bulding a validation rule

3. Confirm with ADD. All active rules will be visible on the grey background below each category.


Discount applicable to particular products/SKUs โš ๏ธ

Some validation rules are based on the structure of products in the cart. Sometimes you want to make a discount applicable only to particular items ( products or SKUs). This can be achieved with the checkbox ' Discount applicable to this order item'. When defining items required in the cart (Order items list > Contains product), you can define separately which of products/SKUs required in the cart will be discounted (or not) when a customer redeems a coupon.

Discount applicable to

When a customer invokes redemption, Voucherify validates voucher and allows for discounting only products with this rule applied (ticked checkbox).

If you are a developer, go here to learn more details about applicable_to validation rule.


Validation rules with Metadata - Schema Validation

๐Ÿ’ก This guide assumes you are already familiar with the Metadata - Schema Validation. If you need help on that, follow this link.

Voucherify Metadata - Schema Validation enables you to create 

  • 'text, 
  • 'flag', 
  • 'number' 
  • 'date'  
  • 'image url'
  • and 'date time' metadata attributes. 

These custom properties can relate to all Voucherify object types:

  • campaigns
  • vouchers
  • products
  • SKUs
  • redemptions
  • customers
  • publications
  • orders

You can use them to add specific campaign limits or customer segment rules. Different types of attributes allow you for creating rules based on specific numbers, dates and time frames. Let's explore some examples.


Redemption metadata with date and time โฐ

Metadata attributes assigned to redemption objects can be used to create validation rules during the 4th stage of a campaign manager.

Firstly, you need to add metadata properties to project's Metadata Schema.

In the picture, you can see one metadata attribute assigned to redemption objects: 

  • booking_time type 'date time' 
Let's use it to add validation rules in a new coupon campaign. Rules engine in the campaign manager enables you to set required values of redemption metadata to particular dates, days of the week, timeframes or numbers.

In case of attributes typed as 'date time' or 'date' you can also restrict property value to a particular day/days of the week 

We recreated a similar campaign here


Validation rules with products/SKUs metadata 

Each custom attribute that you add to product objects using API or Metadata Schema, can be used to create validation rules.

Note ๐Ÿ’ก

You don't have import your inventory to use product-specific rules in your campaigns. That means there is no need of storing products catalog in Voucherify upfront and up-to-date. If you use API to invoke codes' redemptions, then you can add products with metadata while invoking redemption (to the redemption request). You can read more in this guide.

To use Metadata - Schema Validation created for products or SKUs, you need to choose the validation rule from 'Order structure' > 'Product metadata satisfy'. Similarly to the previous case, assigned properties will be listed automatically after choosing the rule. Product metadata

You can use assigned properties to build product-specific rules

Product metadata satisfy

When you choose a required value for a property, confirm with 'Add'. The campaign redemptions will be restricted by added limits and redemption request needs to be equipped with product metadata attributes with assigned values. Otherwise, the system will reject the redemption request.