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.
Property | Type | Description | Default |
---|---|---|---|
id * | integer | A unique identifier for the ruleset, generated by Price Rules. | n/a |
internal_name | string (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_id | string (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_name | string (255) | A public name to display promotional messages for this ruleset. | "" |
created_at | date(UTC) | The date and time when the ruleset was created. | n/a |
updated_at | date(UTC) | The date and time when the ruleset was last updated. | n/a |
start_date | date (UTC) | The date and time when the ruleset should take effect. | none |
expiry_date | date (UTC) | The date and time after which the ruleset is no longer in effect. | none |
active | boolean | Indicates whether the ruleset is enabled. Setting active to false disables the ruleset. | true |
priority | integer | The priority of the ruleset. Price Rules evaluates rulesets in priority order, starting with the lowest value and ascending. | none |
product_selection * | object | Defines 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 * | array | An 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.
Property | Type | Description | Default |
---|---|---|---|
id * | integer | A unique rule id, created by Price Rules for each rule automatically. | n/a |
external_id | string | An 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 enumeration | The 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 * | array | A 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 * | array | A 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 |
priority | integer | The priority of a rule relative to other rules within the same layer. For a tutorial, see Prioritization and stacking. | none |
stack_order | integer | Determines 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:
Type | Layer | Priority | Stack order | Best price |
---|---|---|---|---|
BASE_PRICE | 0 | ✅ | ❌ | ✅ |
DISCOUNTABLE_ADDITION | 1 | ✅ | ✅ | ❌ |
DISCOUNT | 2 | ❌ | ❌ | ✅ |
STACKABLE_DISCOUNT | 3 | ✅ | ✅ | ❌ |
ADDITION | 3 | ✅ | ✅ | ❌ |
ROUNDING | 3 | ✅ | ✅ | ❌ |