Validation rules

In this section:

  1. How to begin with validation rules
  2. How to create a rule
  3. Validation attributes
    1. Basic rules
    2. Budget-based rules
    3. Product-based rules
    4. The upper value of a discount
  4. Validation rules with Metadata Schema Validator
  5. Time limits for vouchers

The aim of creating segments and products is to model desired buying circumstances. You can do it in the 4th stage of campaign creation with the validation rules engine. The flexible mechanism allows you to implement a wide range of promotion ideas.


Getting started

Let’s take a look at the example which guides you through all aspects of validation rules. To begin with, you need to:

  1. Run the Campaign Manager
  2. Go through the first 3 stages of a campaign creation

In the 4th step, define what criteria customers and their orders have to match to make a valid redemption. Rules are built based on 14 purchase attributes:

  • customer segments
  • redemptions count per customer
  • products name 
  • redemptions count per customer among the whole campaign
  • products SKU
  • upper  value of a discount
  • order volume
  • only for customer who are owners of the code
  • order products count
  •  redeeming user
  • redemptions count per customer per day
  • redemption metadata
  • price of products/SKUs on the order list
  • attributes based on a campaign budget:
    • count of redemptions among the whole campaign
    • total amount of all related orders
    • total discounted amount of all related orders
    • total redeemed gift amount

Create a rule

  1. Choose which attribute you want to limit or add your own by using redemption metadata, e.g., choose Customer segments.
  2. Select an operator to define a condition, e.g., is.
  3. Add a value to limit the redemption, e.g., select a segment Customers2017.
  4. Confirm with Add a rule.

As a result, only customers from the chosen segment (Customers2017) are allowed to make a redemption.


Validation attributes

To better understand what limits each attribute brings into the campaign, take a look at this list:

Validation attribute Description Example

BASIC VALIDATION RULES


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 can 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".
Order total amount
(is more than/ is exactly/ is less than)
By using order total amount, a redemption is possible only if the order value matches a given limit.
A customer can redeem a discount if the total order amount is more than $100.
Redemptions count per customer
(is exactly/ is less than or equal)
By using this property, you can tell Voucherify how many times a single customer can redeem his/her code.
Only  once per customer.
Redemptions count per customer per day
(is exactly/ is less than or equal)
Defines how many times a single customer can redeem their code per day.
One usage per customer per day.
Redemptions count per customer among the whole campaign
(is exactly/ is less than or equal)

In contrary to the previous one, this attribute defines the number of the redemptions count per single customer within a  campaign. 
One usage per customer among the whole campaign.
Redeeming user
(is/ is not/ starts with/ ends with/ contains)
With this  rule  you can manage your team and define which users/merchants can/ cannot invoke a coupon redemption User "Denver_department" can invoke redemptions and user "Central_department" cannot redeem codes.
Redemptions count per user 
(is exactly/ is less than or equal)


You can define how many times a particular user (with access to redeeming codes) can invoke a redemption
User "Denver_department" can invoke 100 redemptions among the whole campaign
Redemption metadata
(is/ is not/ starts with/ ends with/ contains/ is less than/ is less than or equal/ is more than/ is more than or equal)
It is meant for the cases when you'd like to include custom properties into validation process. You have a wide range of operators available to create new rules.
To use custom metadata, follow these steps:
  1. Add a name of  a property
  2. Select the operator
  3. Define the value

For example, you can launch a campaign which targets customers with a particular age, gender, locale or any other custom attribute you'll provide with the redemption request.

  • Name of  a property - Age
  • The operator - is equal
  • The value - 30
As a result, we give a discount only to customers who are 30 years old.
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. 


BUDGET-BASED VALIDATION RULES


Upper value of discount


A maximum value of discount which customer can get by redeeming a coupon; this property is set during the 2nd stage of a campaign creation You can run a "10% off campaign" and set the upper value of a discount equal to $100. It means that every customer with a code get max. $100 discount even if their order will be worth more than $1000 (orders above $1000 get less than 10% discount).
Total amount of all related orders
(is less than or equal)

With this property, you can limit the available amount of all orders done with codes from a particular  campaign
Total discounted amount of all related orders
(is less than or equal)
It allows you for defining the overall value of discount that your customers can get by redeeming codes from a particular campaign 

Total redeemed gift amount
(is less than or equal)
It defines a total value of redeemed gift cards amongst the whole  campaign

Redemptions count among the whole campaign
(is less than or equal)
This property defines how many redemptions can be made amongst the whole campaign

PRODUCT-BASED VALIDATION RULES

Allows for launching product-specific coupon deals that can reinforce your up- and cross-selling tactics. 

Order products count
(is more than/ is exactly/ is less than)
With this attribute, a customer gets a discount on the condition that the order contains a predefined amount of product.  A customer can redeem the code if the order contains at least 3 products
Order item list (by product)
(contains/does not contain/ contains less than or equal/contains more than or equal)
Choose a product/products which have to be on the card (you can optionally set the required amount of the product) and then mark a checkbox "Discount is applicable to this product" to make a discount valid for the added items. Without marking the checkbox, the redemption is available only when the product is in the cart, but it won't be discounted (see the  section below to learn more).
Order item list (by SKU)
(contains/does not contain/ contains less than or equal/contains more than or equal)
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. Without marking the checkbox, the redemption is available only when the product with particular SKU is in the cart, but it won't be discounted (see  the  section below to learn more).
Order item list, product metadata
Rules based on custom attributes assigned to your products, e.g., series.
Note: You can add as many metadata attributes as you wish.
A discount is applicable only to products which series begins from AT54.

Validation attributes based on a product price

With the following rules, you can build restrictions based on prices of products required in the cart. You can use a price of one product/SKU or define required prices for all items in the cart.

Order item list, product price
You can define a required price for the item/items from a customer's cart. Discount applies only if a price of product X is more than $50.
Order item list (SKU price)
You can select a required price for the variants of product/products from a customer's cart.
Discount applies only if a price of variant A of product X is more than $50.
Price of each order 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 cart costs more than $50.
Price of any order 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.
Discount applicable to particular products/SKUs


You can define separately which of products/SKUs required in the cart will be discounted (or not) when a customer redeems a coupon. See the details below.

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 ' applicable only to' property. When defining Order items list validation rule, you can define separately which of products/SKUs required in the cart will be discounted (or not) when a customer redeems a coupon.

1. Firstly, add a product's name/SKU to the required order items list

2. In the next step, tick the checkbox "Discount is applicable to this product/SKU", to make a discount valid for this item or leave it unchecked if you don't want to change its price during the coupon redemption. Confirm with ADD A RULE. 

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


Validation rules with Metadata Schema Validator

This guide assumes you are already familiar with the Metadata Schema Validator. If you need help on that, follow  this link.

Voucherify Metadata Schema Validator enables you to create 

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

These custom properties can relate to all Voucherify object types:

  • campaigns
  • vouchers
  • products
  • SKUs
  • redemptions
  • customers

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 two metadata attributes assigned to redemption objects: 

  • order_created type 'date' and 
  • delivery_time type 'date time'. 
Let's use them 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.
According to the set rule, redemptions will be valid only if a customer chooses a delivery time between 1 pm and 5 pm (4h) within the time of a campaign duration (14.06-20.06). 
In case of attributes typed as 'date time' or 'date' you can also restrict property value to particular day/days of the week
To utilize coupon code, the redemption request needs to be equipped with required values of redemption metadata attributes.

Products/SKUs metadata 

To use Metadata Schema created for products or SKUs, you need to use validation rule 'Order item list, product metadata'. Similarly to the previous case, assigned properties will be listed automatically after choosing the rule. Rules are built during the 4th stage of a campaign manager

When you choose a required value for a property, confirm with 'Add a rule'. 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.

Customer metadata

Schema created for customer objects allows you to create a custom segmentation of your audience. We've described the workflow step by step in  this guide and a short video tutorial


Video tutorial