Metadata examples
Metadata examples
- Customer:
loyalty_tier: gold,lifetime_value: 1200 - Order:
cart_value: 85,contains_subscription: true - Product:
category: skincare,margin_band: high - Campaign:
customer_group: A,objective: repurchase
How metadata works
You can attach metadata to the following Voucherify resources.Supported resources in metadata
Supported resources in metadata
- Voucher
- Campaign
- Customer
- Product
- Redemption
- Publication
- Order
- Order line item
- Loyalty tier
- Promotion tier
- Earning rule
- Reward
Nested metadata example
Nested metadata example
Payment and add nested properties such as:payment_methodwith a string type,payment_channelwith a string type,payment_taxwith a number type,payment_deferredwith a flag type.
Payment nested metadata can be then added, for example, to the Product resource as an Object type metadata definition.Metadata types
You can define metadata using the following data types:- String: Supports properties – min./max./exact length, is equal to any of.
- Number: Supports properties – less/greater than (or equal), is equal to any of, is not equal to.
- Flag: Boolean values (true or false). In the API, this type is called
boolean(see Metadata Schema Object). - Date and Date time: Complies with ISO 8601 (for example,
2020-03-11T09:00:00.000Z). - Image URL: Represents an image URL.
- Object: Uses nested metadata, which groups several custom attributes under one object.
- Geopoint (enterprise feature, on demand): Represents location. Stores coordinates as latitude, longitude, for example “37.786971, -122.399677”. Only available for customers and products.
Define new metadata schema
Open new metadata form
Define metadata details
- optional
- required
- single (one value)
- multiple (an array of values)
Select the metadata type
- String
- Number
- Date
- Datetime
- Flag
- Image URL
- Object (nested metadata)
- Geopoint (enterprise feature)
Properties (optional)
Save the definition
Define nested metadata schema
Nested metadata are used as Object type attribute and they are used to group other metadata fields under one key. Go to Project settings > Metadata schema to Create nested schema.Name the nested metadata schema object
Define metadata for the nested metadata object
Finish the nested metadata
Unknown metadata
You can find the Unknown metadata tab in the detailed view of every resource. Unknown metadata is custom data sent to Voucherify without a definition in the Metadata schema. Unknown metadata:- Are always treated as a string.
- Have limited filtering and validation compared to defined metadata. You have to type their key and value in the Unknown metadata filter.
- Are usually created through API requests, CDP imports, or manual entry of undefined properties.
Maintenance
Once you’ve added metadata definitions to schemas, you can manage them in the detailed view of a given resource. Go to Project settings > Metadata schema and select a given resource to open its detailed view.Metadata validation modes
Metadata can be validated by Voucherify as follows:- Allow any metadata (default): Accepts undefined fields, but Voucherify still validates defined fields against the schema. For example, Voucherify rejects metadata that has a different type, disallowed values, or properties that don’t meet the defined schema.
- Allow only defined metadata: Rejects requests if they contain undefined metadata fields or metadata doesn’t meet its definition.
Manage metadata schemas
In the metadata schema, you can:- Edit: Change metadata definition. However, you can’t change its Type.
- Remove: Move the definition to the Removed definitions tab.
- Restore: Return a removed definition to the active schema under Definitions tab.
-
Purge: Permanently remove the definition from the Removed definitions list and from all existing resources (for example removes the “VIP” flag from all customers). This is an asynchronous process that may take time to complete.
Metadata purge is not available for:
- Earning rule
- Publication
- Redemption
- Reward
- Clear schema: Completely delete the schema and its Definitions, Unknown definitions, and Removed definitions. However, this action does not Purge the metadata from relevant resources. If you want to also remove metadata from associated resources, first Purge then Clear schema.
Copy schema from another project
You can copy metadata schema definitions from another project into your current project. Go to Project settings > Metadata schema.Copy schema from project
Select definitions
Use metadata in Voucherify
When you add metadata to your resources, like campaign or customer, you can either:- Use an existing metadata schema. This is a schema that’s defined in Project settings.
- Add unknown property: Metadata that isn’t defined and won’t be added to the schema. It will be listed as an Unknown definition with a string type.
- Add to schema: Define new metadata schema. Once saved, the metadata is added to the Definitions of a given resource.
- Undefined: The metadata is not added to the resource.
- Null: The metadata is added to the resource, but its value is empty (set to
null). - Value: Add value that meets the schema definition – its type and other properties.
Related features
Experiment with other features to improve your incentive optimization. You can use metadata with many different resources. Check some basic use scenarios below to get inspired.Metadata in customers
Metadata in customers
Metadata in products
Metadata in products
Metadata in validation rules
Metadata in validation rules

