Skip to main content

Pricing Models

Overview#

A pricing modelis a configurable calculator that works out a product's cost from a set of typed inputs and the rates in a price book. Instead of hard-coding a price, you describe howthe cost is computed โ€” area ร— rate, plus add-ons, rounded a certain way โ€” and the engine evaluates it. You'll find the builder under Admin โ†’ Pricing Models.

Assign a model to a product (on the product form) to turn it into a configurable product. From then on, that product is priced by the model rather than a fixed number.

โš 
Pricing models compute cost only. Markup to a customer-facing sell price happens downstream (in QuickBooks), so your formulas should produce your internal cost.

Anatomy of a model#

The builder has four tabs, evaluated in this order:

  1. Inputs โ€” the typed fields collected for each line.
  2. Components โ€” optional repeatable sub-structures.
  3. Formulas (bindings) โ€” named variables computed from inputs and rates.
  4. Outputs โ€” which variables become the result.

1. Inputs#

Inputs are the values someone enters when pricing a line. Each input has a key (used in formulas) and one of five types:

  • number โ€” any numeric value (e.g. quantity).
  • dimension โ€” a measurement such as length or height.
  • select โ€” a fixed list of options you define.
  • boolean โ€” a yes/no toggle.
  • rate_ref โ€” a reference to a rate-item product. The user picks a product; LOOKUP then resolves its rate from the price book.

2. Components#

Components are repeatable sub-structures with their own inputs and formulas, each constrained by a min/max number of instances. They model things that can appear more than once on a single line โ€” for example a sign with a front face and an optional back face. Use SUM in a line formula to aggregate a value across all instances of a component. Components are optional; a simple model can keep all of its logic at the line level.

3. Formulas (bindings)#

Bindings are ordered name = expression lines that build up derived variables. They reference inputs and earlier bindings by name (there are no cell references). Identifiers may include $, so tape$ is a valid variable name. All evaluation happens on the server in a sandboxed engine โ€” there is no arbitrary code execution.

Exactly nine functions are available:

Functions
ROUND(x, n)Round x to n decimal places.
MIN(a, b, โ€ฆ)Smallest of the arguments.
MAX(a, b, โ€ฆ)Largest of the arguments.
ABS(x)Absolute value.
CEILING(x)Round up to the next whole number.
FLOOR(x)Round down to the previous whole number.
IF(cond, a, b)Return a when cond is true, otherwise b.
SUM(values)Add up a list โ€” typically values across component instances.
LOOKUP(rateRef)The rate for a rate_ref input, read from the active price book.

A missing rate is treated as an error, not a silent $0 โ€” if LOOKUPcan't find a rate for the chosen product in the selected book, the calculation fails loudly so a line never quietly prices at zero.

4. Outputs#

Outputs map your variables to the model's results:

  • unitPrice โ€” required; the per-unit cost.
  • cost and expense โ€” optional extra figures (e.g. a QuickBooks expense).
  • breakdown โ€” an optional list of labeled rows so the result shows how the number was reached.

The live test panel#

Every model has a test panel beside the builder. Pick a price book, fill in sample inputs (a rate_ref input shows a dropdown of your rate-item products โ€” pick one), and click Compute. The result is calculated on the server using the real engine, so what you see in the panel is exactly what the model will produce in practice.

As you edit formulas, validation runs automatically: a broken expression shows an inline located error and Save is blockeduntil it's fixed. Cycles and references to unknown variables are caught the same way.

Worked example: a custom sign#

  1. 1Inputs: length (dimension), height (dimension), material (rate_ref), tape (boolean), quantity (number).
  2. 2Bindings: area = length * height / 144 ยท rate = LOOKUP(material) ยท base = area * rate ยท tape$ = IF(tape, ROUND((length/6 + height/6) * 1.40, 2), 0) ยท unit = base + tape$ ยท expense = unit / 2.
  3. 3Outputs: unitPrice = unit, expense = expense.
  4. 4Test it: choose a price book, set length 14, height 16, material to a rate item priced at 33.09, tape Yes, quantity 1 โ†’ unitPrice โ‰ˆ $58.47 (area 1.556 ร— $33.09 = $51.47 base, plus $7.00 tape).
โ„น
The whole engine is configuration, not code. Different industries model completely different things (sign square-footage, countertop linear feet, service hours) with the same inputs, formulas, and price books โ€” no developer required.

Putting it together#

The three pieces work as a pipeline:

  1. Products โ€” define your catalog, mark materials/labor as rate items, and assign pricing models to configurable products.
  2. Price Books โ€” set the rates those rate items cost.
  3. Pricing Models โ€” write the formulas that turn inputs and rates into a cost.