Rule editor
Business rules are created and edited in the Backoffice. Each rule type has its own page in the Admin sidebar (Shipping costs, Carriers, Payment methods, Incentives, Transaction costs). This page explains the key concepts you will encounter in the rule editor.
Creating a rule
To create a new rule:
- Navigate to the relevant rule type page in the Admin section of the Backoffice sidebar (for example Shipping costs or Incentives)
- Click Add rule
- Give the rule a name using the pencil icon in the top left
- Add subrules to define conditions and actions
Rule structure
Each rule in the editor has:
- A rule name (editable with the pencil icon)
- A hit policy toggle in the top right corner: first or all
- An Add subrule button to add new rows to the decision table
- A Save button
Subrules
Each subrule is a row in the decision table. It has a name, a set of conditions and a set of actions. Subrules are evaluated from top to bottom.
You can reorder subrules by dragging the handle on the left side. The order matters when the hit policy is set to first because the engine stops at the first matching subrule.
Conditions (IF)
The IF section defines when the subrule matches. Each condition consists of:
- An Item dropdown that selects which field to evaluate (for example "Order subtotal" or "Order delivery address country")
- A Condition dropdown that selects the comparison operator (for example "equals", "greater than" or "contains")
- A Value field for the comparison value
You can add multiple conditions to a single subrule using the "Add condition" button. When a subrule has multiple conditions, an and/or toggle controls how they combine:
- And means all conditions must be true for the subrule to match
- Or means any one condition being true is enough
Leaving a condition empty matches any value.
Actions (THEN)
The THEN section defines what happens when the conditions match. The available action fields vary by rule type:
- Shipping costs produces an action (set shipping costs) and a price
- Carriers produces an action (set carrier to selectable) and a carrier ID
- Payment methods produces an action (set payment method to selectable) and a payment method ID
- Incentives has the widest range of actions (see below)
- Transaction costs produces an action (set transaction costs) and a cost value
For the full output schema per rule type, see Rule types.
Hit policy
The hit policy determines how the engine handles multiple matching subrules. It is shown as a first / all toggle in the top right corner of the rule editor.
| Policy | Behavior |
|---|---|
| First | Stops at the first subrule that matches (top to bottom). Only that subrule's outputs are returned |
| All | Evaluates all subrules. Every matching subrule's outputs are collected and returned |
Use first when subrules are mutually exclusive or prioritized. For example, shipping cost rules typically use first because only one shipping cost should apply.
Use all when multiple results should stack. For example, carrier and payment method rules typically use all because multiple options should be available for the customer to choose from.
Incentive actions
Incentive rules support the following actions:
| Action | Description |
|---|---|
| Add product to bonus items | Adds a product to the order as a bonus item (for example a free sample) |
| Give discount to order item | Applies a discount to specific order items that match the conditions |
| Give discount to order total | Applies a discount to the order total |
| Add valuepoints to order | Awards value points to the order |
| Set shipping costs | Sets shipping costs on the order. Useful for applying shipping discounts through incentive rules that are triggered explicitly in the Sales Hub |
| Set transaction costs | Sets transaction costs on the order. Same as shipping costs, useful for explicit incentive-based overrides |
The last two actions (set shipping costs and set transaction costs) overlap with the dedicated shipping cost and transaction cost rule types. The difference is that dedicated rules are evaluated automatically on every change, while incentive rules with these actions are only applied when incentives are triggered. In the Sales Hub this means a sales rep can explicitly apply a shipping discount as part of a quote or order negotiation.
Repeat toggle (incentives)
Incentive subrules have a Repeat toggle on the action. This controls whether the action fires once per order or once per qualifying item.
- Repeat off: the action fires a single time when the subrule matches. Use this for flat discounts or single bonus products
- Repeat on: the action is applied for each item in the order that satisfies the conditions. Use this for rules that should scale with the number of matching line items
Fallback rows
The last subrule in a table is typically a fallback with a condition that is always true, for example "Order subtotal is greater than or equal to 0". This ensures the subrule always matches if no earlier subrule did.
This is useful for shipping cost rules where you want a default rate when no specific country or carrier condition applies.
See also
- Business rules overview for how rules apply at runtime
- Rule types for output schemas and practical examples