Skip to main content

Ruleset properties

A ruleset defines a collection of pricing rules that apply to a selection of products. For more information about rulesets and their components, refer to the Rulesets and Rules concept page.

Properties

Rulesets support the following properties. An asterisk (*) indicates that the property is required.

PropertyTypeDescriptionDefault
id*integerA unique identifier for the ruleset, generated by Price Rules.n/a
internal_namestring (255)An internal name of the ruleset. Intended to be used by Bold internally.When the ruleset is created by an external app, internal_name is set to that app’s name for the ruleset.
external_idstring (128)An external unique identifier of the ruleset intended to be used by the merchant/partner. Can be any string that is unique for the application ID submitted in the request URL.When the ruleset is created by an external app, the external_id is set to that app’s identifier for the ruleset.
public_namestring (255)A public name to display promotional messages for this ruleset.""
created_atdate(UTC)The date and time when the ruleset was created.n/a
updated_atdate(UTC)The date and time when the ruleset was last updated.n/a
start_datedate (UTC)The date and time when the ruleset should take effect.none
expiry_datedate (UTC)The date and time after which the ruleset is no longer in effect.none
activebooleanIndicates whether the ruleset is enabled. Setting active to false disables the ruleset.true
priorityintegerThe priority of the ruleset. Price Rules evaluates rulesets in priority order, starting with the lowest value and ascending.none
product_selection*objectDefines the set of product items to which the ruleset applies. For details, see the Product selection reference in this guide. Learn how product selection works.n/a
rules*arrayAn array of conditions and actions based upon which a discount is calculated and applied. (For details, see the Rule properties reference in this guide. Learn how rules work.n/a

Rule properties

Rules are the basic unit of price adjustment in a ruleset. Each rule is tested against each selected product item in the customer’s cart. When a rule’s conditions are satisfied, Price Rules applies the rule’s pricing actions to the product items.

Price Rules supports the following rule properties. An asterisk (*) indicates the property is required.

PropertyTypeDescriptionDefault
id*integerA unique rule id, created by Price Rules for each rule automatically.n/a
external_idstringAn external unique identifier of a rule. This can be used by the merchant/partner as a unique identifier for the specific rule condition/action.n/a
type*string enumerationThe type of rule. Influences the order in which Price Rules resolves the rule. For details, see the Rule Type and Layers section. Learn more about how rule types work.n/a
conditions*arrayA list of conditions that define criteria for applying a rule to the product selection. For details, see the Conditions reference. Empty arrays ([]) are valid. Learn more about how conditions work.none
actions*arrayA list of pricing actions to take when a rule’s conditions are satisfied. For details, see the Actions reference. Empty arrays ([]) are not valid. Learn more about how actions work.none
priorityintegerThe priority of a rule relative to other rules within the same layer. For a tutorial, see Prioritization and stacking.none
stack_orderintegerDetermines the order in which rules are resolved stackable layers. For details, see the Rule types reference in this guide. For a tutorial, see Prioritization and stacking.none

Rule types and associated layers

Each rule has a type, which influences the order in which Price Rules resolves the rule. Rule types map to layers, ranging from layer 0 (the base price) to layer 3. The Price Rules engine resolves rules starting at layer 0 and works “up” the stack to layer 3.

The layer associated with a rule type can support priority, stack_order, or both properties. Layer 0 and layer 2 apply the rule that yields the best price for the customer and do not support stack_order. For a tutorial, refer to Prioritization and stacking.

Price Rules supports the following rule types:

TypeLayerPriorityStack orderBest price
BASE_PRICE0
DISCOUNTABLE_ADDITION1
DISCOUNT2
STACKABLE_DISCOUNT3
ADDITION3
ROUNDING3