Skip to main content

Price List Rules

Price list rules provide a mechanism for programmatically deriving prices rather than manually entering every amount. A rule defines a set of transformations — markups, discounts, currency conversions, rounding — that can be applied to source prices to produce derived prices. This is particularly useful when maintaining multiple price lists that share a common base but differ by a percentage margin or currency.

Rule structure​

A price list rule is a named container that belongs to a price list and an organisation. Each rule has:

  • Type — categorises the rule (e.g. markup, discount, conversion)
  • Name — human-readable identifier
  • Description — detailed explanation of the rule's purpose

Rules themselves are lightweight headers. The actual pricing logic lives in their rule lines.

Rule lines​

Each rule contains one or more rule lines that define specific price transformations.

Sequencing​

Rule lines are ordered by a sequence number that determines the order in which lines are evaluated. Fine-grained sequencing allows lines to be inserted between existing lines without renumbering the entire set.

Amount transformations​

Each rule line can transform up to three amount fields (mirroring the three amounts on a price record). For each amount, the transformation follows the pattern:

derived_amount = (source_amount × multiplier) + addend

The result is then adjusted according to a configurable rounding rule.

The source for each amount can also be specified — for example, the base price amount or another computed value — giving full flexibility over the transformation pipeline.

Currency conversion​

Rule lines include currency conversion support, allowing prices to be converted from one currency to another as part of the transformation. Each conversion specifies:

  • Rate type — the type of exchange rate to use (e.g. spot, average)
  • Conversion date — the date for which the exchange rate applies

Item targeting​

Each rule line can optionally target a specific catalogue item. When no item is specified, the rule line applies to all items. This allows general rules to provide defaults while item-specific lines override them.

Example: deriving a partner price list​

Consider a scenario where a "Partner Wholesale" price list is derived from the "Standard Retail" list with a 20% discount:

  1. Create a price list rule with type "discount"
  2. Add a rule line with:
    • Multiplier of 0.80 (80% of original = 20% discount)
    • No addend (no flat adjustment)
    • Round-half-up rounding
    • No item targeting (applies to all items)

For a specific high-margin item that should receive a deeper 30% discount, add a second rule line with a lower sequence number targeting that item, using a multiplier of 0.70.

The sequencing and item targeting together create a flexible system where general rules provide defaults and item-specific lines override them.