Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from 1. The values are objects containing the rule conditions.
Attributes
Description
Example
1
Defines the rule.
Attributes
Description
Example
name
Voucherify specific rule name. The list of available names is provided below.
Custom name for a metadata property associated with the condition to be satisfied. Required if the property name is any of the following:
Name
customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata
conditions
A set of key value pairs representing the condition name and value. The list of available conditions is provided below:
Condition (key)
Definition
Does not support Types
$is
A property is a predefined value.
$is_not
A property is not a predefined value.
$in
A property either one value in a predefined list of values.
$less_than
A property is less than a predefined value.
boolean
$less_than_or_equal
A property is less than or equal to a predefined value.
boolean
$more_than
A property is more than a predefined value.
boolean
$more_than_or_equal
A property is more than or equal to a predefined value.
boolean
$starts_with
A property starts with the predefined sequence of characters.
boolean, number
$ends_with
A property ends with the predefined sequence of characters.
boolean, number
$contains
A property contains the predefined sequence of characters.
boolean, number
$timeframe
boolean, number
$dow
boolean, string
$count
boolean, string
$count_more
boolean, string
$count_less
boolean, string
Attributes
Description
Example
$one_of_voucherify_conditions
Contains a set of conditions for the rule.
rules
Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from 1. The values are objects containing the rule conditions.
Attributes
Description
Example
1
Defines the nested rule.
Attributes
Description
Example
name
property
conditions
rules
logic
error
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
Attributes
Description
Example
message
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
logic
Defines the logic between the rules.
(1 and 2) and (3)
error
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.
Attributes
Description
Example
message
The error message returned from API when validation / redemption fails to meet requirements of defined rules.
applicable_to
Attributes
Description
Example
excluded
Defines which items are excluded from a discount.
Array of:
Attributes
Description
Example
object
The type of object being excluded from the rule.
Available values: product, sku, products_collection
id
Unique product ID, SKU ID, product collection ID i.e. prod_0b72b00ffed198e344z, sku_0b7d7dfb090be5c619, pc_4ndRXAsTOzwSdHcQcxf489uU.
source_id
strict
effect
Discount effect for an excluded resource.
Available values: APPLY_TO_EVERY
included
Defines which items are included in a discount.
Array of:
Attributes
Description
Example
object
The type of object being included in the rule.
Available values: product, sku, products_collection
id
Unique product ID, SKU ID, product collection ID i.e. prod_0b72b00ffed198e344z, sku_0b7d7dfb090be5c619, pc_4ndRXAsTOzwSdHcQcxf489uU.
source_id
strict
effect
Discount effect for an included resource.
Available values: APPLY_TO_EVERY, APPLY_TO_CHEAPEST, APPLY_TO_MOST_EXPENSIVE
quantity_limit
A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value.
included_all
Indicates whether all items are included in the discount.
created_at
Timestamp representing the date and time when the validation rule was created in ISO 8601 format.
2022-03-23T07:44:00.444Z
updated_at
Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.