Skip to content

Stock pools and matching

Bind a configurator to your stock so it picks the nearest matching item and falls back to a formula when nothing fits.

A stock pool is a set of items that share declared key attributes. You manage pools and their items in the Stock tab: each item has a sku, description, attributes, quantity, reserved quantity, cost and a low stock threshold.

Pool bindings

A binding exposes a pool to formulas under a key such as stock.rod. It matches on an attribute against a target expression over parameters, using one of three modes: nearest, nearest_above or nearest_below. A secondary attribute can refine ties.

Take the carbide rod example. A custom endmill binds the carbide_rods pool, matching diameter nearest_above the requested diameter and length nearest_above the required overall length. The cost path then reads stock.rod.cost and stock.rod.matched.

ts
match: {
 attr: "diameter_mm",
 target: "diameter_mm",
 mode: "nearest_above",
 secondary: { attr: "length_mm", target: "oal_mm", mode: "nearest_above" }
}

Fallback pricing

When no item qualifies, stock.rod.matched is false and the cost comes from the binding fallback expression instead. This keeps the configurator priceable even when the exact stock is not on the shelf.

ts
// fallbackCostExpr, used when nothing matches
diameter_mm * oal_mm * 0.012

Reservation and low stock

Ordering a configured product reserves the matched stock: the reserved quantity rises at order creation and is released if the order is cancelled. When a pool drops below its threshold an amber banner shows on the pool and a chip appears on the dashboard.

The seeded carbide_rods pool ships with twelve sample items. The numbers are illustrative starting points for you to edit, not pricing advice.