curl --request GET \
--url https://{cluster}.voucherify.io/v1/validation-rules/{validationRuleId} \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "val_TU4de3EP4dlL",
"name": "Order is less than $40",
"rules": {
"1": {
"name": "order.amount",
"property": null,
"conditions": {
"$less_than": [
4000
]
},
"rules": {}
},
"logic": "1"
},
"applicable_to": {
"excluded": [],
"included": [],
"included_all": false
},
"created_at": "2022-08-11T16:42:13.630Z",
"type": "advanced",
"context_type": "reward_assignment.pay_with_points",
"object": "validation_rules"
}Retrieve the details of a validation rule.
curl --request GET \
--url https://{cluster}.voucherify.io/v1/validation-rules/{validationRuleId} \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "val_TU4de3EP4dlL",
"name": "Order is less than $40",
"rules": {
"1": {
"name": "order.amount",
"property": null,
"conditions": {
"$less_than": [
4000
]
},
"rules": {}
},
"logic": "1"
},
"applicable_to": {
"excluded": [],
"included": [],
"included_all": false
},
"created_at": "2022-08-11T16:42:13.630Z",
"type": "advanced",
"context_type": "reward_assignment.pay_with_points",
"object": "validation_rules"
}The access token received from the authorization server in the OAuth 2.0 flow.
A unique validation rule ID.
"val_TU4de3EP4dlL"
Returns the validation rule object.
Response body schema for GET v1/validation-rules/{validationRuleId}.
This is an object representing a request validation rule.
This is an object representing a response validation rule.
Custom, unique name for set of validation rules.
"Business Validation Rule"
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 consecutively beginning from 1. The values are objects containing the rule conditions.
Show child attributes
Defines the logic between the rules.
"(1 and 2) and (3)"
Contains the name of the validation rule.
Show child attributes
Voucherify's specific rule name. The list of available names is provided below.
| Type | Name |
|---|---|
| Customer | customer.segment customer.metadata* |
| Order | order.amount order.initial_amount order.items.count order.items.price_any order.items.price_each order.items.metadata_any order.items.metadata_each order.metadata* |
| Campaign | campaign.orders.amount_discounted campaign.orders.amount campaign.redemptions.count campaign.redemptions.count.daily campaign.redemptions.count.monthly campaign.redemptions.customers_count campaign.redemptions.customers_count.daily campaign.redemptions.customers_count.monthly |
| Redemption | redemption.gift.amount redemption.count.daily redemption.count.monthly redemption.count.per_customer redemption.count.per_customer.daily redemption.count.per_customer.monthly redemption.api_key redemption.count.per_api_key redemption.user.login redemption.count.per_user redemption.metadata redemption.reward.pay_with_points.points_used |
| Product | product.id product.price product.quantity product.discount_applicable product.metadata* product.metadata.aggregated_quantity product.metadata.aggregated_amount product.metadata.discount_applicable product.metadata.match_all |
| SKU | sku.id sku.price sku.quantity sku.discount_applicable |
| Publication | publication.redeemable_by_linked_customer |
| Custom Event | custom_event.metadata* |
| Order items | order.items.every order.items.any order.items.none order.items.cheapest order.items.most_expensive |
*Requires the property field to be defined.
Custom name for a metadata property associated with the condition to be satisfied. Required if the property name is any of the following:
customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata
A set of key value pairs representing the condition name and value. The list of available conditions is provided below:
| Condition (key) | Definition |
|---|---|
$is | A property is a predefined value. |
$is_not | A property is not a predefined value. |
$in | A property is one value of the values in a predefined list of values. |
$not_in | A property is not one of the values in a predefined list of values. |
$less_than | A property is less than a predefined value. Can be also used with datetime. |
$less_than_or_equal | A property is less than or equal to a predefined value. Can be also used with datetime. |
$more_than | A property is more than a predefined value. Can be also used with datetime. |
$more_than_or_equal | A property is more than or equal to a predefined value. Can be also used with datetime. |
$starts_with | A property starts with the predefined sequence of characters. |
$ends_with | A property ends with the predefined sequence of characters. |
$contains | A property contains the predefined sequence of characters. |
$timeframe | A property occurs within the time frame, i.e. every 1 day for 1 hour, e.g. $timeframe: ["2024-11-12T14:59:23.019Z;P1D;PT1H"] |
$timeframe_absolute | A property occurs between two dates and times, e.g. 2024-11-14T16:02:00.000Z;2024-11-28T16:02:00.000Z |
$timeframe_daily_hours | A property occurs between selected hours on selected days of the week, e.g. 18:00;20:01;2,3, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$dow | A property occurs within given days of the week, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$count | For array metadata; the property must have exactly the defined number of elements. |
$count_more | For array metadata; the property must have more elements than the defined number. |
$count_less | For array metadata; the property must have less elements than the defined number. |
$from | The property must belong to the predefined value. Related to product collections and best used together with the $is condition. |
$after | The value is after the date. |
$before | The value is before the date. |
$more_than_ago | The date is more than the defined value ago expressed in number of days, relative to today, e.g. more than 3 days ago. |
$less_than_ago | The date is less than the defined value ago expressed in number of days, relative to today, less than 3 days ago. |
is_days_ago | The date is exactly the defined value ago expressed in number of days, relative to today, e.g. exactly 3 days ago. |
$more_than_future | The date is more than the defined value in the future expressed in number of days, relative to today, e.g. more than 3 days in the future. |
$less_than_ago | The date is less than the defined value in the future expressed in number of days, relative to today, e.g. less than 3 days in the future. |
$is_days_in_future | The date is exactly the defined value in the future expressed in number of days, relative to today, e.g. exactly 3 days in the future. |
Show child attributes
1111110 <= x <= 61x >= 01x >= 01x >= 0111x >= 01x >= 01x >= 01x >= 01x >= 01x >= 0Contains 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 consecutively beginning from 1. The values are objects containing the rule conditions.
Show child attributes
Defines the logic between the rules.
"(1 and 2) and (3)"
Contains the name of the validation rule.
Show child attributes
Voucherify's specific rule name. The list of available names is provided below.
| Type | Name |
|---|---|
| Customer | customer.segment customer.metadata* |
| Order | order.amount order.initial_amount order.items.count order.items.price_any order.items.price_each order.items.metadata_any order.items.metadata_each order.metadata* |
| Campaign | campaign.orders.amount_discounted campaign.orders.amount campaign.redemptions.count campaign.redemptions.count.daily campaign.redemptions.count.monthly campaign.redemptions.customers_count campaign.redemptions.customers_count.daily campaign.redemptions.customers_count.monthly |
| Redemption | redemption.gift.amount redemption.count.daily redemption.count.monthly redemption.count.per_customer redemption.count.per_customer.daily redemption.count.per_customer.monthly redemption.api_key redemption.count.per_api_key redemption.user.login redemption.count.per_user redemption.metadata redemption.reward.pay_with_points.points_used |
| Product | product.id product.price product.quantity product.discount_applicable product.metadata* product.metadata.aggregated_quantity product.metadata.aggregated_amount product.metadata.discount_applicable product.metadata.match_all |
| SKU | sku.id sku.price sku.quantity sku.discount_applicable |
| Publication | publication.redeemable_by_linked_customer |
| Custom Event | custom_event.metadata* |
| Order items | order.items.every order.items.any order.items.none order.items.cheapest order.items.most_expensive |
*Requires the property field to be defined.
Custom name for a metadata property associated with the condition to be satisfied. Required if the property name is any of the following:
customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata
A set of key value pairs representing the condition name and value. The list of available conditions is provided below:
| Condition (key) | Definition |
|---|---|
$is | A property is a predefined value. |
$is_not | A property is not a predefined value. |
$in | A property is one value of the values in a predefined list of values. |
$not_in | A property is not one of the values in a predefined list of values. |
$less_than | A property is less than a predefined value. Can be also used with datetime. |
$less_than_or_equal | A property is less than or equal to a predefined value. Can be also used with datetime. |
$more_than | A property is more than a predefined value. Can be also used with datetime. |
$more_than_or_equal | A property is more than or equal to a predefined value. Can be also used with datetime. |
$starts_with | A property starts with the predefined sequence of characters. |
$ends_with | A property ends with the predefined sequence of characters. |
$contains | A property contains the predefined sequence of characters. |
$timeframe | A property occurs within the time frame, i.e. every 1 day for 1 hour, e.g. $timeframe: ["2024-11-12T14:59:23.019Z;P1D;PT1H"] |
$timeframe_absolute | A property occurs between two dates and times, e.g. 2024-11-14T16:02:00.000Z;2024-11-28T16:02:00.000Z |
$timeframe_daily_hours | A property occurs between selected hours on selected days of the week, e.g. 18:00;20:01;2,3, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$dow | A property occurs within given days of the week, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$count | For array metadata; the property must have exactly the defined number of elements. |
$count_more | For array metadata; the property must have more elements than the defined number. |
$count_less | For array metadata; the property must have less elements than the defined number. |
$from | The property must belong to the predefined value. Related to product collections and best used together with the $is condition. |
$after | The value is after the date. |
$before | The value is before the date. |
$more_than_ago | The date is more than the defined value ago expressed in number of days, relative to today, e.g. more than 3 days ago. |
$less_than_ago | The date is less than the defined value ago expressed in number of days, relative to today, less than 3 days ago. |
is_days_ago | The date is exactly the defined value ago expressed in number of days, relative to today, e.g. exactly 3 days ago. |
$more_than_future | The date is more than the defined value in the future expressed in number of days, relative to today, e.g. more than 3 days in the future. |
$less_than_ago | The date is less than the defined value in the future expressed in number of days, relative to today, e.g. less than 3 days in the future. |
$is_days_in_future | The date is exactly the defined value in the future expressed in number of days, relative to today, e.g. exactly 3 days in the future. |
Show child attributes
1111110 <= x <= 61x >= 01x >= 01x >= 0111x >= 01x >= 01x >= 01x >= 01x >= 01x >= 0Contains 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 consecutively beginning from 1. The values are objects containing the rule conditions.
Show child attributes
Defines the logic between the rules.
"(1 and 2) and (3)"
Contains the name of the validation rule.
Show child attributes
Voucherify's specific rule name. The list of available names is provided below.
| Type | Name |
|---|---|
| Customer | customer.segment customer.metadata* |
| Order | order.amount order.initial_amount order.items.count order.items.price_any order.items.price_each order.items.metadata_any order.items.metadata_each order.metadata* |
| Campaign | campaign.orders.amount_discounted campaign.orders.amount campaign.redemptions.count campaign.redemptions.count.daily campaign.redemptions.count.monthly campaign.redemptions.customers_count campaign.redemptions.customers_count.daily campaign.redemptions.customers_count.monthly |
| Redemption | redemption.gift.amount redemption.count.daily redemption.count.monthly redemption.count.per_customer redemption.count.per_customer.daily redemption.count.per_customer.monthly redemption.api_key redemption.count.per_api_key redemption.user.login redemption.count.per_user redemption.metadata redemption.reward.pay_with_points.points_used |
| Product | product.id product.price product.quantity product.discount_applicable product.metadata* product.metadata.aggregated_quantity product.metadata.aggregated_amount product.metadata.discount_applicable product.metadata.match_all |
| SKU | sku.id sku.price sku.quantity sku.discount_applicable |
| Publication | publication.redeemable_by_linked_customer |
| Custom Event | custom_event.metadata* |
| Order items | order.items.every order.items.any order.items.none order.items.cheapest order.items.most_expensive |
*Requires the property field to be defined.
Custom name for a metadata property associated with the condition to be satisfied. Required if the property name is any of the following:
customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata
A set of key value pairs representing the condition name and value. The list of available conditions is provided below:
| Condition (key) | Definition |
|---|---|
$is | A property is a predefined value. |
$is_not | A property is not a predefined value. |
$in | A property is one value of the values in a predefined list of values. |
$not_in | A property is not one of the values in a predefined list of values. |
$less_than | A property is less than a predefined value. Can be also used with datetime. |
$less_than_or_equal | A property is less than or equal to a predefined value. Can be also used with datetime. |
$more_than | A property is more than a predefined value. Can be also used with datetime. |
$more_than_or_equal | A property is more than or equal to a predefined value. Can be also used with datetime. |
$starts_with | A property starts with the predefined sequence of characters. |
$ends_with | A property ends with the predefined sequence of characters. |
$contains | A property contains the predefined sequence of characters. |
$timeframe | A property occurs within the time frame, i.e. every 1 day for 1 hour, e.g. $timeframe: ["2024-11-12T14:59:23.019Z;P1D;PT1H"] |
$timeframe_absolute | A property occurs between two dates and times, e.g. 2024-11-14T16:02:00.000Z;2024-11-28T16:02:00.000Z |
$timeframe_daily_hours | A property occurs between selected hours on selected days of the week, e.g. 18:00;20:01;2,3, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$dow | A property occurs within given days of the week, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$count | For array metadata; the property must have exactly the defined number of elements. |
$count_more | For array metadata; the property must have more elements than the defined number. |
$count_less | For array metadata; the property must have less elements than the defined number. |
$from | The property must belong to the predefined value. Related to product collections and best used together with the $is condition. |
$after | The value is after the date. |
$before | The value is before the date. |
$more_than_ago | The date is more than the defined value ago expressed in number of days, relative to today, e.g. more than 3 days ago. |
$less_than_ago | The date is less than the defined value ago expressed in number of days, relative to today, less than 3 days ago. |
is_days_ago | The date is exactly the defined value ago expressed in number of days, relative to today, e.g. exactly 3 days ago. |
$more_than_future | The date is more than the defined value in the future expressed in number of days, relative to today, e.g. more than 3 days in the future. |
$less_than_ago | The date is less than the defined value in the future expressed in number of days, relative to today, e.g. less than 3 days in the future. |
$is_days_in_future | The date is exactly the defined value in the future expressed in number of days, relative to today, e.g. exactly 3 days in the future. |
Show child attributes
1111110 <= x <= 61x >= 01x >= 01x >= 0111x >= 01x >= 01x >= 01x >= 01x >= 01x >= 0Contains 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 consecutively beginning from 1. The values are objects containing the rule conditions.
Show child attributes
Defines the logic between the rules.
"(1 and 2) and (3)"
Contains the name of the validation rule.
Show child attributes
Voucherify's specific rule name. The list of available names is provided below.
| Type | Name |
|---|---|
| Customer | customer.segment customer.metadata* |
| Order | order.amount order.initial_amount order.items.count order.items.price_any order.items.price_each order.items.metadata_any order.items.metadata_each order.metadata* |
| Campaign | campaign.orders.amount_discounted campaign.orders.amount campaign.redemptions.count campaign.redemptions.count.daily campaign.redemptions.count.monthly campaign.redemptions.customers_count campaign.redemptions.customers_count.daily campaign.redemptions.customers_count.monthly |
| Redemption | redemption.gift.amount redemption.count.daily redemption.count.monthly redemption.count.per_customer redemption.count.per_customer.daily redemption.count.per_customer.monthly redemption.api_key redemption.count.per_api_key redemption.user.login redemption.count.per_user redemption.metadata redemption.reward.pay_with_points.points_used |
| Product | product.id product.price product.quantity product.discount_applicable product.metadata* product.metadata.aggregated_quantity product.metadata.aggregated_amount product.metadata.discount_applicable product.metadata.match_all |
| SKU | sku.id sku.price sku.quantity sku.discount_applicable |
| Publication | publication.redeemable_by_linked_customer |
| Custom Event | custom_event.metadata* |
| Order items | order.items.every order.items.any order.items.none order.items.cheapest order.items.most_expensive |
*Requires the property field to be defined.
Custom name for a metadata property associated with the condition to be satisfied. Required if the property name is any of the following:
customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata
A set of key value pairs representing the condition name and value. The list of available conditions is provided below:
| Condition (key) | Definition |
|---|---|
$is | A property is a predefined value. |
$is_not | A property is not a predefined value. |
$in | A property is one value of the values in a predefined list of values. |
$not_in | A property is not one of the values in a predefined list of values. |
$less_than | A property is less than a predefined value. Can be also used with datetime. |
$less_than_or_equal | A property is less than or equal to a predefined value. Can be also used with datetime. |
$more_than | A property is more than a predefined value. Can be also used with datetime. |
$more_than_or_equal | A property is more than or equal to a predefined value. Can be also used with datetime. |
$starts_with | A property starts with the predefined sequence of characters. |
$ends_with | A property ends with the predefined sequence of characters. |
$contains | A property contains the predefined sequence of characters. |
$timeframe | A property occurs within the time frame, i.e. every 1 day for 1 hour, e.g. $timeframe: ["2024-11-12T14:59:23.019Z;P1D;PT1H"] |
$timeframe_absolute | A property occurs between two dates and times, e.g. 2024-11-14T16:02:00.000Z;2024-11-28T16:02:00.000Z |
$timeframe_daily_hours | A property occurs between selected hours on selected days of the week, e.g. 18:00;20:01;2,3, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$dow | A property occurs within given days of the week, where 0 equals Sunday, 1 equals Monday, 2 equals Tuesday, 3 equals Wednesday, 4 equals Thursday, 5 equals Friday, and 6 equals Saturday. |
$count | For array metadata; the property must have exactly the defined number of elements. |
$count_more | For array metadata; the property must have more elements than the defined number. |
$count_less | For array metadata; the property must have less elements than the defined number. |
$from | The property must belong to the predefined value. Related to product collections and best used together with the $is condition. |
$after | The value is after the date. |
$before | The value is before the date. |
$more_than_ago | The date is more than the defined value ago expressed in number of days, relative to today, e.g. more than 3 days ago. |
$less_than_ago | The date is less than the defined value ago expressed in number of days, relative to today, less than 3 days ago. |
is_days_ago | The date is exactly the defined value ago expressed in number of days, relative to today, e.g. exactly 3 days ago. |
$more_than_future | The date is more than the defined value in the future expressed in number of days, relative to today, e.g. more than 3 days in the future. |
$less_than_ago | The date is less than the defined value in the future expressed in number of days, relative to today, e.g. less than 3 days in the future. |
$is_days_in_future | The date is exactly the defined value in the future expressed in number of days, relative to today, e.g. exactly 3 days in the future. |
Show child attributes
1111110 <= x <= 61x >= 01x >= 01x >= 0111x >= 01x >= 01x >= 01x >= 01x >= 01x >= 0Another set of validation rules. If you need to create complex rules with more nested rules, use the validation rule builder in the dashboard.
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
Show child attributes
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
Show child attributes
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
Show child attributes
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
Show child attributes
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
Show child attributes
Defines which items are excluded from a discount.
Show child attributes
This object stores information about the resource to which the discount is applicable.
product, sku, products_collection Unique product collection, product, or SKU identifier assigned by Voucherify.
Defines how the discount is applied to the customer's order.
APPLY_TO_EVERY, APPLY_TO_CHEAPEST, APPLY_FROM_CHEAPEST, APPLY_TO_MOST_EXPENSIVE, APPLY_FROM_MOST_EXPENSIVE The source identifier from your inventory system.
Parent product's unique ID assigned by Voucherify.
Parent product's source ID from your inventory system.
New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price.
Formula used to dynamically calculate the discounted price of an item.
The maximum number of units allowed to be discounted per order line item.
The maximum number of units allowed to be discounted combined across all matched order line items.
Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600.
Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:
APPLY_TO_ITEMS (each item subtotal is discounted equally)APPLY_TO_ITEMS_BY_QUANTITY (each unit of matched products has the same discount value)Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the order object in the request. The first order line is assigned 0, the second order line is assigned 1, and so on.
Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the index corresponds to the order line sent in the order object in the request.
Show child attributes
Number assigned to the order line item in accordance with the order sent in the request.
x >= 0Numbers of units in the order line covered by the discount; e.g. 2, 5, 8 for 10 units with the setting "skip_initially": 1, "repeat": 3. The counting of units starts from 1. The maximum quantity of all handled units is 1000. If the quantity of all order items exceeds 1000, this array is not returned, but units_limit_exceeded: true. However, the discount is calculated properly for all relevant units.
Returned as true only when the sum total of quantity of all order items exceeds 1000.
Determines the recurrence of the discount, e.g. "repeat": 3 means that the discount is applied to every third item.
Determines how many items are skipped before the discount is applied.
Determines to which kinds of objects the discount is applicable. ITEM includes products and SKUs. UNIT means particular units within an order line.
ITEM, UNIT Defines which items are included in a discount.
Show child attributes
This object stores information about the resource to which the discount is applicable.
product, sku, products_collection Unique product collection, product, or SKU identifier assigned by Voucherify.
Defines how the discount is applied to the customer's order.
APPLY_TO_EVERY, APPLY_TO_CHEAPEST, APPLY_FROM_CHEAPEST, APPLY_TO_MOST_EXPENSIVE, APPLY_FROM_MOST_EXPENSIVE The source identifier from your inventory system.
Parent product's unique ID assigned by Voucherify.
Parent product's source ID from your inventory system.
New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price.
Formula used to dynamically calculate the discounted price of an item.
The maximum number of units allowed to be discounted per order line item.
The maximum number of units allowed to be discounted combined across all matched order line items.
Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600.
Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:
APPLY_TO_ITEMS (each item subtotal is discounted equally)APPLY_TO_ITEMS_BY_QUANTITY (each unit of matched products has the same discount value)Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the order object in the request. The first order line is assigned 0, the second order line is assigned 1, and so on.
Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the index corresponds to the order line sent in the order object in the request.
Show child attributes
Number assigned to the order line item in accordance with the order sent in the request.
x >= 0Numbers of units in the order line covered by the discount; e.g. 2, 5, 8 for 10 units with the setting "skip_initially": 1, "repeat": 3. The counting of units starts from 1. The maximum quantity of all handled units is 1000. If the quantity of all order items exceeds 1000, this array is not returned, but units_limit_exceeded: true. However, the discount is calculated properly for all relevant units.
Returned as true only when the sum total of quantity of all order items exceeds 1000.
Determines the recurrence of the discount, e.g. "repeat": 3 means that the discount is applied to every third item.
Determines how many items are skipped before the discount is applied.
Determines to which kinds of objects the discount is applicable. ITEM includes products and SKUs. UNIT means particular units within an order line.
ITEM, UNIT Indicates whether all items are included in the discount.
Type of validation rule.
expression, basic, advanced, complex Validation rule context type.
| Context Type | Definition |
|---|---|
| earning_rule.order.paid | |
| earning_rule.custom_event | |
| earning_rule.customer.segment.entered | |
| campaign.discount_coupons | |
| campaign.discount_coupons.discount.apply_to_order | |
| campaign.discount_coupons.discount.apply_to_items | |
| campaign.discount_coupons.discount.apply_to_items_proportionally | |
| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |
| campaign.discount_coupons.discount.fixed.apply_to_items | |
| campaign.gift_vouchers | |
| campaign.gift_vouchers.gift.apply_to_order | |
| campaign.gift_vouchers.gift.apply_to_items | |
| campaign.referral_program | |
| campaign.referral_program.discount.apply_to_order | |
| campaign.referral_program.discount.apply_to_items | |
| campaign.referral_program.discount.apply_to_items_proportionally | |
| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |
| campaign.referral_program.discount.fixed.apply_to_items | |
| campaign.promotion | |
| campaign.promotion.discount.apply_to_order | |
| campaign.promotion.discount.apply_to_items | |
| campaign.promotion.discount.apply_to_items_proportionally | |
| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |
| campaign.promotion.discount.fixed.apply_to_items | |
| campaign.loyalty_program | |
| voucher.discount_voucher | |
| voucher.discount_voucher.discount.apply_to_order | |
| voucher.discount_voucher.discount.apply_to_items | |
| voucher.discount_voucher.discount.apply_to_items_proportionally | |
| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |
| voucher.discount_voucher.discount.fixed.apply_to_items | |
| voucher.gift_voucher | |
| voucher.gift_voucher.gift.apply_to_order | |
| voucher.gift_voucher.gift.apply_to_items | |
| voucher.loyalty_card | |
| distribution.custom_event | |
| reward_assignment.pay_with_points | |
| global |
earning_rule.order.paid, earning_rule.custom_event, earning_rule.customer.segment.entered, earning_rule.customer.tier.joined, earning_rule.customer.tier.left, earning_rule.customer.tier.upgraded, earning_rule.customer.tier.downgraded, earning_rule.customer.tier.prolonged, campaign.discount_coupons, campaign.discount_coupons.discount.apply_to_order, campaign.discount_coupons.discount.apply_to_items, campaign.discount_coupons.discount.apply_to_items_proportionally, campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity, campaign.discount_coupons.discount.apply_to_items_by_quantity, campaign.discount_coupons.discount.fixed.apply_to_items, campaign.discount_coupons.discount.percent.apply_to_items, campaign.gift_vouchers, campaign.gift_vouchers.gift.apply_to_order, campaign.gift_vouchers.gift.apply_to_items, campaign.referral_program, campaign.referral_program.discount.apply_to_order, campaign.referral_program.discount.apply_to_items, campaign.referral_program.discount.apply_to_items_proportionally, campaign.referral_program.discount.apply_to_items_proportionally_by_quantity, campaign.referral_program.discount.apply_to_items_by_quantity, campaign.referral_program.discount.fixed.apply_to_items, campaign.referral_program.discount.percent.apply_to_items, campaign.promotion, campaign.promotion.discount.apply_to_order, campaign.promotion.discount.apply_to_items, campaign.promotion.discount.apply_to_items_proportionally, campaign.promotion.discount.apply_to_items_proportionally_by_quantity, campaign.promotion.discount.apply_to_items_by_quantity, campaign.promotion.discount.fixed.apply_to_items, campaign.promotion.discount.percent.apply_to_items, campaign.loyalty_program, voucher.discount_voucher, voucher.discount_voucher.discount.apply_to_order, voucher.discount_voucher.discount.apply_to_items, voucher.discount_voucher.discount.apply_to_items_proportionally, voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity, voucher.discount_voucher.discount.apply_to_items_by_quantity, voucher.discount_voucher.discount.fixed.apply_to_items, voucher.discount_voucher.discount.percent.apply_to_items, voucher.gift_voucher, voucher.gift_voucher.gift.apply_to_order, voucher.gift_voucher.gift.apply_to_items, voucher.loyalty_card, distribution.custom_event, distribution.order.paid, distribution.order.created, distribution.order.canceled, distribution.order.updated, reward_assignment.pay_with_points, global Unique validation rule ID.
"val_eR1c41hu0vUU"
Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.
"2022-03-23T07:44:00.444Z"
The type of the object represented by JSON. This object stores information about the validation rule.
Contains all the definitions for the bundle rules. It is a set of key value pairs representing the rules and logic between them. The keys are numbered consecutively beginning from 1. The values are objects containing the rule conditions.
While updating with the PUT method, you can pass "bundle_rules": null to delete the configuration; in the response, an empty object is then returned.
Show child attributes
Defines how many bundles can be identified in the order and the maximum multiplier of the discount per identified bundle. For example, if the order meets 3 bundles, but limit: 2, the discount will be multiplied by 2.
1 <= x <= 100Contains the name of the bundle rule.
Show child attributes
Voucherify's specific bundle rule name. Currently, it is only order.items.any.
order.items.any Defines the conditions of the bundle rule. The order items in the customer's cart must meet the conditions. Because the rule concerns order items, the only permissible condition is $is.
Show child attributes
1Show child attributes
Unique identifier of the product, SKU, or collection assigned by Voucherify.
Type of the order item. It can be a product_or_sku or products_collection
product_or_sku, products_collection Object used in the bundle rule. It can be a products_collection, product, or sku.
products_collection, product, sku Show child attributes
Defines the logic between the sub-rules.
"1"
Contains the name of the validation sub-rule.
Show child attributes
Voucherify's specific sub-rule name. Currently, it is only order.items.aggregated_quantity.
order.items.aggregated_quantity Defines the conditions of the bundle rule. The quantity of order items in the customer's cart must meet the conditions.
Show child attributes
1The quantity of units in the customer's order must be equal or higher than the defined number.
x >= 1An empty object.
CURRENTLY UNSUPPORTED. Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
Show child attributes
The error message returned from API when validation / redemption fails to meet requirements of defined rule.
Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.
"2022-04-26T08:35:54.960Z"
The number of instances the validation rule has been assigned to different types of redeemables.
Was this page helpful?