The future of incentives is agent ready. See what we're building.
curl --request GET \
--url https://{cluster}.voucherify.io/v1/validation-rules/{validationRuleId} \
--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 '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"
}Documentation Index
Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
Use this file to discover all available pages before exploring further.
A unique validation rule ID.
"val_TU4de3EP4dlL"
Returns the validation rule object.
Response body schema for GET v1/validation-rules/{validationRuleId}.
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
Show child attributes
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
Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.
Show child attributes
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?