Skip to main content

Pricing Rules and Engine Administration

The condition-technique pricing engine governs how sales prices, customer discounts, volume tiering, and surcharges resolve across all sales channels.

This document details the configuration presets, access sequences, multidimensional specificity scoring, and safeguard thresholds available to system administrators.


Configuration Presets​

The engine operates under one of three administrative presets configured via the pricing.preset setting. Presets configure default behaviors and UI complexity to match your business model:

PresetDescriptionTarget Use Case
list_priceOne price per item, kept on the item. Simplest operational model.Distributors selling every customer at one price.
price_lists (Default)Price lists, customer tiers and quantity breaks.Standard wholesale distributors using catalogue price sheets and volume tiers.
full_rulesComplete multidimensional condition-technique engine with custom promotional campaigns, category-level rules, and surcharges.Complex enterprise distributors with multi-tier promotional calendars and margin rules.

Changing the tier​

On Pricing rules, the banner above the list names the tier in use; Change tier opens the three tiers with what each can express. Moving up is a plain setting change. Moving down is refused while active rules exist that the lower tier cannot express — a percentage discount under Tiered price lists, say, or any rule bound to more than the item under Single list price — and the refusal names up to five of them, so you can change or switch them off and try again. The dialog warns before you try.

One percentage is at home under Tiered price lists: a price list's own "percent off list price", for everything on the list or for one item on it — a LIST rule with method percent_off whose scope is the price list alone, or the price list and an item. Those do not block the move down. A percentage on anything else (an item with no price list, a category, a promotion) still does, and so does any percentage under Single list price.

The check belongs to the pricing.preset setting itself, so it applies however the tier is changed: this dialog, PUT /api/v1/settings/pricing.preset, a reset to the default (which is a move down from Full rules), or an agent. Changing the tier needs pricing_rule.manage and the Sales settings area (sales_settings.manage) or setting.manage.


The Access Sequence and Components​

Pricing resolves through a deterministic component pipeline. Each component queries candidate rules matching the order line context:

SequenceComponent KeyComponent NameOperation TypeDescription
10LISTList PriceBaseEvaluates base catalog price rules. Mandatory foundation.
20CLASSCustomer ClassAdjustmentApplies customer tier markups or discounts against base price.
30VOLUMEVolume BreaksAdjustmentApplies quantity breaks based on line quantity thresholds.
40PROMOPromotionsAdjustmentEvaluates active marketing and seasonal promotions.
50SURCHARGESurchargesAdditionApplies mandatory surcharges (e.g., hazmat, delivery fees).

Which scopes each component consults​

Each component tries the scopes below in order, most specific first, and the first scope with a matching rule decides that component. When none matches, a rule with no scope at all applies. A rule whose scope is not in its component's list never applies, however it is written.

ComponentScopes, in order
LISTcustomer + item · customer + category · customer class + item · customer class + category · price list + item · price list + category · price list · channel + item · channel + category · item · category · collection · item tag · brand
CLASScustomer class + item · customer class + category · customer class + brand · customer class
VOLUMEitem · category
PROMOcustomer + item · customer · item · item tag · brand
SURCHARGEsite + channel · site · channel

So a list price set on a brand prices every item of that brand that no more specific rule prices; a rule on a tag beats the brand's and loses to the collection's, and a rule naming the item or its category beats all three. The list_price preset runs the same LIST scopes.

A rule on a price list alone is that list's default. "Everything on Wholesale is 10% off list price" is one LIST rule scoped to the price list and nothing else. It prices every product the list has no price or category rule for, and it is asked before anything that is not the list's — so for a customer on a list with a default, the channel, item, category, collection, tag and brand rules at the list step are no longer reached. Put a default on the company's default list only if that is what you mean: it then answers for every customer with no tier of their own. A product with no list price has nothing to take the percentage off, so the default skips it (no_list_price in the trace) and the later scopes are tried as before. Only LIST asks a price list alone; a discount or promotion scoped that way never applies.

Set a list's default from Sales → Price lists → Edit list → Default % off list price rather than here: that keeps the list, the rule and the audit trail in step (see admin/sales.md, A list's default percentage). The rule it writes is named Price list RETAIL: default. The update that added this step switched off every LIST rule scoped to a price list alone that existed before it, because those had never priced anything and would otherwise have started to. Switch one back on here if it is what you want the list's default to be.

The rules named Price list CODE: SKU hold the prices on a price list. Each price on a list (Sales → Price lists, or a product's Tier prices card) is kept here as a LIST rule scoped to that list and that product, a fixed price or a percentage off list price rounded to the currency's smallest unit, dated as the price is. Change them from the list or the product, not here. An edit made here is not refused, and it prices orders: the product's Tier prices card shows what the engine answers, so the edited price shows there (as Own price, or as Another pricing rule where the scope was changed), but the list's own row still says what it said. Saving the product's price on its Tier prices card again puts the rule back to what the list says, and any later change from the list or the card ends or replaces it.

A price list's price on a parent product reaches its variants. A variant with no price of its own on a list sells at its parent's price on that list — a fixed price, a percentage (taken off the variant's own list price), a quantity break or a box price alike. As soon as the variant has a price of its own that applies to the line, the parent's rows on that list stop applying to it altogether: the parent's cheaper twelve-and-over price does not undercut the variant's own price. When the variant's own price ends, the parent's is back. This is for price-list prices only. A customer's or class's price for the parent, a web price, a rule on the parent with no price list, and every discount, promotion and surcharge apply to the parent itself and not to its variants.

A rule on a brand family reaches its product lines. Brands can be grouped — a family such as Geek Bar above its lines Pulse and Meloso (see admin/units-and-collections.md). A rule scoped to the family prices every item of every line under it, at any depth. When the family and the line both have a rule at the same step, the line's wins, whichever is cheaper: the brand weight of 15 drops by one for each level up, so the nearer brand is always the more specific match. A switched-off family still prices its lines, as a switched-off brand still prices its items. Tax rules and putaway rules that name a brand do not reach its lines — they apply to items filed on that brand itself.

A rule on a collection reaches every product in it or under it. A product is in any number of collections, from any number of trees, so the collection step matches a rule on any collection the product is in, or on any collection above one of those. Of two such rules, the nearer collection wins (the weight drops by 5 a level); two at the same distance — a rule on Deals and one on Disposables, for a product in both — are a tie, settled as below. Adding a product to a collection, or taking it out of one, changes which collection rules price it; the bulk Add to collection / Remove from collection box counts the rules that start or stop reaching the products before OK.

Moving a brand under another family changes which family rules reach everything under it. The Brands screen says how many lines and items move with it; an agent's move is always proposed, naming the price rules that start or stop reaching them.


Multidimensional Specificity Scoring​

When multiple rules match within a single component, the rule with the highest Specificity Score wins. Specificity is the sum of the weights of the dimensions in the rule's scope:

Scope dimensionKeyWeight
Customercustomer1000
Itemitem500
Customer classcustomer_class200
Categorycategory100, less 10 for each level up the tree of categories the match is found (never below 1)
Collectioncollection50, less 5 for each level up the collection tree (never below 1) — matched against every collection the item is in
Item tagitem_tag40 — every tag on an item the same
Price listprice_list30
Unit of measureuom20
Brandbrand15, less 1 for each level up the brand's families (never below 1)
Sitesite10
Storestore8
Channelchannel5
Currencycurrency1
No scope{}0

A weight decides between rules within one step of a component's scope list above; the list itself decides which step is tried first. A dimension only prices anything if some step names it — store is registered but no shipped step names it yet, so a rule scoped to a store alone never applies.

Examples:​

  • Rule matching customer + item: Specificity = 1000 + 500 = 1500
  • Rule matching customer_class + item: Specificity = 200 + 500 = 700
  • Rule matching customer_class only: Specificity = 200
  • Rule matching the parent of one of the item's collections: Specificity = 50 − 5 = 45
  • Global base rule (no scope): Specificity = 0

When two rules are equally specific​

Among the rules matching at one step of the sequence, a rule with a larger quantity break (min_quantity) that the line meets wins first, then the higher specificity. Two matching rules equal on both are a tie — most often two rules on two different tags of one item, since every tag carries the same weight, or on two collections the item is directly in.

A tie is not refused when the rule is saved: the two rules name different tags, and whether they ever meet depends on which tags an item wears later. Only an exact duplicate is refused — the same component, scope, unit, currency and quantity break over overlapping dates.

The engine settles a tie the way NetSuite does by default for conflicting price rules: the rule giving the lower price for the customer wins. Beyond both being in effect on the order date, their start and end dates do not decide it, and neither does which rule was created or loaded first. If both give exactly the same price, the rule with the lower id — the older one — is named the winner. The price trace notes each rule that lost the tie and the two prices, and the explanation sentence on the order line repeats the note.

Two versions of the same rule are not a tie. Rules with the same scope and the same quantity break but different dates — what a price list keeps when a price changes, since the old row stays as the record of what it charged — are settled by date before anything else: the narrower date window applies, then the later start. A price rise is charged from its start date even though the older, lower price is still open.

A rule needs something to price from​

A rule matches only if the line has what it prices from. A markup on cost on a product with no cost yet is skipped, and so is a percent or amount off list — or a marginal quantity break at the list step — on a product with no list price. The price trace shows no_cost or no_list_price against the rule. A skipped rule never wins a tie: before this, it came out at $0.00 and won every one.


Pricing Methods & Break Modes​

Rules support four calculation methods:

  • fixed: Sets an absolute price per unit (e.g., $19.99).
  • percent_off: Deducts a percentage from the accumulated price (e.g., 10%). At 100 or more the price is zero. A rule created on this screen takes zero or more; a price list's own percentage can also be negative, which prices above list price — -5 is 5% over — and the price trace reads it "+5%". Set rounding (0.01 for cents) where the result must be a whole price: 10% off 9.99 is 8.991 without it and 8.99 with it.
  • amount_off: Deducts a flat currency amount per unit (e.g., $1.50).
  • markup_on_cost: Calculates price as item cost multiplied by (1 + markup%).

Volume Break Modes:​

  • flat: If line quantity meets min_quantity, the rule applies to all ordered units.
  • tiered: Only units within the quantity bracket receive the adjusted rate.

Margin Floor Safeguards​

To prevent inadvertent margin erosion or loss-leader pricing:

  1. Minimum Selling Price (min_selling_price): Stored on the item catalog record.
  2. Floor Enforcement: the engine prices freely and the order service holds the line to the floor, in one place: a line whose price after discount is under min_selling_price is refused (price_under_floor), unless a person with sales_order.approve (orders) or sales_quote.approve (quotes) keeps it with a reason, which is stored on the line and audited as sales.floor_price_override. Nothing is clamped: a price silently raised to the floor is a price nobody agreed.
  3. Minimum advertised price: the item's MAP — its own, its variant template's, or its brand's and up the brand's family — is compared with the same price after discount and flagged, never refused — see admin/sales.md.

Permissions​

PermissionRole AssignmentCapability
pricing_rule.readSales, Accounting, ManagerView price rules, run the engine on a context (POST /pricing/resolve), and inspect explanations.
pricing_rule.manageManagerCreate, edit, activate, deactivate and archive rules.
pricing_rule.simulateSales, ManagerRun a proposed rule over past orders before saving it.

Keeping a line under an item's floor is not a pricing permission: it is the approve permission of the document — sales_order.approve on an order, sales_quote.approve on a quote (see docs/admin/sales.md).


Audit Trail​

All price rule modifications inherit AuditedMixin. In addition, whenever a sales order line is created or repriced:

  • The full resolution trace (winning_rule_id, evaluated candidate rules, and calculation steps) is captured and frozen into the order line metadata.
  • Historical orders remain permanently immutable, preserving the exact price calculation as of the order date.