How to customize my products with metadata and SKUs?

Useful links: 

In this section:

  1. Map your products
  2. Use schema validation
  3. Set validation rules

In this tutorial, we'll show you how to use product metadata to offer customized, product-specific coupon deals 🛒

The Product Manager helps you create coupon campaigns active only if a shopper's cart includes one of the selected products (e.g., iPhone X) or its variant (iPhone X 32GB), see the tutorial. But what if you want to create a discount for a product family, brand, category or any other element they have in common? This can be achieved with product metadata. Let's learn how to do it ⬇️

Map your products 📌

The first step is to create a schema that maps your product catalog's structure. The schema enforces data integrity of your products, take a look at this example. 

Imagine your products follow such a structure: 

Category > Manufacturer > Series > Products > SKU 

For example:

Category: Smartphones
Manufacturer: Samsung
Line: Galaxy S
Product: Galaxy S8
SKU: Galaxy S8 64GB

Create metadata attributes 🙌

What is metadata?

Metadata enables you to add custom data to Voucherify, which you can later use for building validation rules and reporting/ tracking.  

Every object type like:

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

can have some attributes that are not built-in by default but you need them to customize your promo campaigns. For example, you can add custom attributes to your customers, and segment them accordingly to attributes unique for your business model. Moreover, metadata added to redemption object enables you to create limits for redemptions which are not possible with built-in validation rules. 

For example, taxi companies very often offer promo codes for rides booked at particular hours, redemption metadata enables them to create redemption rules based on the  time when the ride happens (redemption) and time when it was booked (custom metadata attribute). 

Here is a video tutorial about creating custom redemption time based on metadata attributes:

There are plenty of use cases for metadata and each of them is unique. They give you extreme flexibility and freedom in creating rules and limits for promotions and segmentation of your customers. 

Let's take a look at Metadata Schema and learn how to create metadata attributes for products ⬇️


How to add product metadata with Schema? 🤔

With the Metadata Schema Validation, you can reflect custom products' properties for your inventory. In effect, every product will get a set of custom fields (each one for a corresponding level) which you can fill in if you decide to add/import your catalog to Voucherify. The product and SKU are built-in objects in Voucherify, so according to our use case from the 1st paragraph you need to create custom fields  for:  category, manufacturer, and line. Here's how to do it:

Open your Project Settings and the Metadata Schema section. Then, switch to Product object.

Metadata Schema Validator

Now, you can add custom attributes, there is no limit on the number of added properties. Moreover, you can also define a type of each property and add restrictions (optional values for a property; read on to find out more). Types of properties are:

  • string (text)
  • number
  • flag
  • date
  • date time
  • image URL

Defining metadata

Note that you can additionally define custom restrictions for the fields 🔒

Product Metadata

Click Save to confirm. From now on, all products you want to add (from the dashboard) or import to Voucherify have to match the schema (unless you check the optional box). Otherwise, an error will be shown ⚠️

💡 The schema is configured per project.

Read a step-by-step guide on Metadata-Schema Validation

Create validation rules with product metadata🙌

To build validation rules with Metadata-Schema Validation, you need to:

  • open Validation Rules section or start creating a new campaign and add rules in the 3rd stage of the Campaign Manager,
  • choose the validation rule from 'Order structure' > 'Product metadata satisfy' and add the required value for a chosen metadata property.

💡 Note that you don't have to import your inventory to create validation rules based on product metadata. Voucherify enables you to add products with metadata while creating the API redemption request. 

Order Structure

You can create additional restrictions for items with the chosen attribute. 

  • Quantity of matched items  how many products with added metadata property need to be in the customer's cart (for example two items from smartphones category).
  • Subtotal of matched items – the required value of items with added metadata in the customer's cart (for example, the value of products from the smartphones category needs to be more than $500).
  • All order items must match – all items in the customer's cart need to meet the metadata criteria. 
  • Discount applicable to related products – set if the discount applies to items with added metadata property (for example, all products with metadata 'category' and its value 'smartphones' are discounted when a code is redeemed).

Product Metadata Satisfy

Assigned limits will be listed below the category automatically after choosing the rule (in a grey box), you can remove them anytime with the cross. Note that you can mix multiple validation rules to get the desired promotion outcome; you can limit this discount by excluding the Galaxy S8 64GB variant for example.

That's it! 🎉

From now on, when a customer tries to redeem the coupon, Voucherify will automatically check if their cart matches your product criteria (along with other validation rules you've defined). 

Also, visit our Voucherify Cookbook to learn how to launch a promo campaign based on SKUs.

You can also watch our video tutorial on working with Products and SKUs in Voucherify:



🖥️ (Hint for developers) When it comes to the Voucherify API integration, there's no need to introduce any changes to your code. A standard redemption request with items identified by  product_id (either Voucherify generated or your internal id) is just fine.

Here is an example of a payload:

{
   ...
   "order":{
      "amount":20050,
      "items":[
         {
            "product_id":"my_inventory_23f4nsdfdy2",
            "quantity":"2"
         },
         {
            "sku_id":"sku_0KtP4rvwEECQ2U",
            "quantity":"1"
         }
      ]
   }
   ...
}

Still need help? Contact Us Contact Us