Skip to main content

Business rules

Business rules are configurable logic blocks that determine how the platform behaves in specific scenarios. They control which carriers are available, how shipping costs are calculated, which payment methods are shown, what incentives apply and how transaction costs are determined.

Rules are created and managed through the Backoffice UI. Each rule type has its own page in the Admin sidebar (Shipping costs, Carriers, Payment methods, Incentives, Transaction costs). Partners do not need to build rules programmatically. The platform evaluates them automatically based on order data such as subtotal, delivery address, line items, user type and company.

Rule types

Each business rule belongs to one of five types. Each type governs a specific domain of logic.

TypeWhat it controls
Shipping costsCalculates the shipping cost for an order based on conditions like delivery country, order subtotal or carrier
CarriersDetermines which carriers are available for the customer to choose from
Payment methodsDetermines which payment methods are available for the customer to choose from
IncentivesApplies promotions such as bonus products, discount codes or order total discounts
Transaction costsCalculates transaction fees based on the selected payment method or other conditions

How rules apply at runtime

Business rules are evaluated against the current state of the order. The platform passes order data (subtotal, addresses, line items, user, company) through each rule's decision table and applies the matching outputs.

Cart (frontend checkout)

All five rule types are evaluated automatically on every cart change. When a customer adds an item, changes the delivery address or enters a discount code, the platform re-evaluates the applicable rules and updates the cart with the new carriers, shipping costs, payment methods and incentives.

Tender (Sales Hub order and quote editor)

In the Sales Hub tender (order/quote editor), business rules are also evaluated automatically when data changes. The key differences from cart:

  • Incentives must be triggered explicitly by the sales rep using the tenderApplyIncentives mutation. They are not applied automatically on every change
  • Most outcomes can be overwritten. A sales rep can override shipping costs, select a different carrier or adjust payment terms manually. The overruled field (Y or N) on postage and payment data indicates whether the value was set by business rules or overridden by the sales rep

This gives sales reps flexibility to adjust quotes and orders while still benefiting from automated rule evaluation as a starting point.

How rules are structured

Every business rule contains a decision table with rows called subrules. Each subrule has conditions (IF) and actions (THEN). When the conditions match, the actions are applied.

Rules use a hit policy to determine how multiple matching subrules are handled:

  • First stops at the first matching subrule (top to bottom). Used when subrules are mutually exclusive or prioritized
  • All evaluates every subrule and collects all matching outputs. Used when multiple results should stack (for example making several carriers selectable at the same time)

For details on building rules in the Backoffice, see Rule editor. For the output schema and examples per rule type, see Rule types.