Skip to main content

Units of Measure

📄️Enable Product Unit of Measure

Idempotently enable a single unit of measure for a product so a bill-of-materials or manufacturing-order line referencing it can be saved without first configuring the full unit-of-measure set. The unit is added as a pending alternate with no conversion factor (0), which lets draft documents validate; a real conversion factor must still be set before the bill of materials can be activated. Calling this repeatedly for the same unit is safe and returns the existing configuration untouched.

📄️Update Product Density

Set or clear the product's density. The value is normalised to g/mL and stored with its provenance; inside the same transaction every weight↔volume unit on the product is re-derived from it (new factor, `factor_source=density`), pending cross-type rows get a factor, and overridden rows (`is_override=true`) are left alone. Clearing the density reverts density-derived rows to pending manual rows (factor 0) that need a factor before any BOM using them can be activated — so clearing must be confirmed with `clear_derived` when such rows exist.

📄️Suggest Product Density

Ask the account's configured AI model for a density suggestion based on the product's name, SKU, brand, default supplier and purchase unit. Nothing is stored: the caller confirms the value through Update Product Density with source=ai_lookup (and may pass the suggestion back in `suggestion` so it is kept on the activity log). Suggestions are cached per account for 30 days on the product name + supplier, so repeating the call for the same ingredient returns the cached answer (`cached: true`) without spending quota. Uncached calls count against the per-user hourly AI quota configured for the account.