Units of Measure
List Units of Measure
List units of measure. Responds in one of two shapes.
Create Unit of Measure
Create a custom unit of measure.
Bulk Delete Units of Measure
Delete several custom units of measure in one call.
Get Unit of Measure
Get a single unit of measure by id.
Update Unit of Measure
Update a custom unit of measure. All fields are optional - only submitted fields change.
Delete Unit of Measure
Delete a custom unit of measure. System units cannot be deleted, and units still referenced by product configurations, BOM lines, or manufacturing order lines return 422 with the reference count.
List Product Units of Measure
List the unit-of-measure configuration for a product: which unit is the stock unit, which are used for purchasing and sales, and the conversion factor of each unit into stock units.
Update Product Units of Measure
Replace the product's full unit-of-measure configuration in one call. Exactly one row must be the stock unit with conversion_factor 1; at most one purchase unit and at most one sales unit are allowed.
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.
Get Product Density
Get the product's density, where it came from, and the unit-of-measure rows that depend on it. Density drives every weight↔volume conversion on the product's units of measure: once set, the factor for each cross-type unit (e.g. gallons on a product stocked in grams) is derived from it rather than typed in.
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.