Validation Rule
All of:
- Validation Rule Base
Validation Rule
Attributes Description id
string
Unique validation rule ID.
Example: val_eR1c41hu0vUU
created_at
string
Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.
Example: 2022-03-23T07:44:00.444Z
updated_at
string
Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.
Example: 2022-04-26T08:35:54.960Z
assignments_count
integer
The number of instances the validation rule has been assigned to different types of redeemables.
object
string
The type of the object represented by JSON. This object stores information about the validation rule.
Validation Rule Base
Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name | Custom, unique name for set of validation rules. Example: Business Validation Rule | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rules | See: Validation Rule Rules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bundle_rules | See: Validation Rule Bundle Rules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
error | Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
applicable_to |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | Type of validation rule. Available values:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
context_type | Validation rule context type.
Available values:
|
Validation Rule Rules
Attributes | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
logic | Defines the logic between the rules. Example: (1 and 2) and (3) | ||||||||||||||||||||||||||||||||||||
[propertyName] | Contains the name of the validation rule.
|
Validation Rule Bundle Rules
Attributes | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
limit | 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
| ||||||||||||||||||||||||||
[propertyName] | Contains the name of the bundle rule.
|
Applicable To
Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
object | This object stores information about the resource to which the discount is applicable. Available values:
| ||||||||
id | Unique product collection, product, or SKU identifier assigned by Voucherify. | ||||||||
source_id | The source identifier from your inventory system. | ||||||||
product_id | Parent product’s unique ID assigned by Voucherify. | ||||||||
product_source_id | Parent product’s source ID from your inventory system. | ||||||||
price | 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. | ||||||||
price_formula | Formula used to dynamically calculate the discounted price of an item. | ||||||||
effect | Defines how the discount is applied to the customer’s order. Applicable To Effect | ||||||||
quantity_limit | The maximum number of units allowed to be discounted per order line item. | ||||||||
aggregated_quantity_limit | The maximum number of units allowed to be discounted combined across all matched order line items. | ||||||||
amount_limit | 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. | ||||||||
aggregated_amount_limit | 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:
| ||||||||
order_item_indices | 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_item_units | 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
| ||||||||
repeat | Determines the recurrence of the discount, e.g.
| ||||||||
skip_initially | Determines how many items are skipped before the discount is applied. | ||||||||
target | Determines to which kinds of objects the discount is applicable.
Available values:
|
Validation Rule Conditions
Attributes | Description |
---|---|
$is | See: Any |
$is_not | See: Any |
$in | See: Any |
$not_in | See: Any |
$less_than | See: Any |
$less_than_or_equal | See: Any |
$more_than | See: Any |
$more_than_or_equal | See: Any |
$starts_with | See: Any String |
$ends_with | See: Any String |
$contains | See: Any String |
$timeframe | See: Any String |
$timeframe_absolute | See: Any String |
$timeframe_daily_hours | See: Any String |
$dow | |
$count | See: Any Number |
$count_more | See: Any Number |
$count_less | See: Any Number |
$not_differ | See: Any |
$not_intersect | See: Any |
$from | See: Any |
$after | See: Any Date and Date-Time |
$before | See: Any Date and Date-Time |
$more_than_ago | See: Any Number |
$less_than_ago | See: Any Number |
$is_days_ago | See: Any Number |
$more_than_future | See: Any Number |
$less_than_future | See: Any Number |
$is_days_in_future | See: Any Number |
Validation Rule Rules
Attributes | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
logic | Defines the logic between the rules. Example: (1 and 2) and (3) | ||||||||||||||||||||||||||||||||||||
[propertyName] | Contains the name of the validation rule.
|
Applicable To Effect
Available values:
APPLY_TO_EVERY
,
APPLY_TO_CHEAPEST
,
APPLY_FROM_CHEAPEST
,
APPLY_TO_MOST_EXPENSIVE
,
APPLY_FROM_MOST_EXPENSIVE
Any
Array any of:
- string
- string
- string
- number
- object
Any
Array any of:
- string
- string
- string
- number
- object
Any String
Any Number
Any Date and Date-Time
Array any of:
- string
- string
Validation Rule Rules
Attributes | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
logic | Defines the logic between the rules. Example: (1 and 2) and (3) | ||||||||||||||||||||||||||||||||||||
[propertyName] | Contains the name of the validation rule.
|
Validation Rule Rules
Attributes | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
logic | Defines the logic between the rules. Example: (1 and 2) and (3) | ||||||||||||||||||||||||||||||||||||
[propertyName] | Contains the name of the validation rule.
|