Insert a stock adjustment
Record a stock adjustment — a manual change to on-hand inventory that isn't a sale, purchase, or transfer (for example waste, theft, damage, a recount, or a reconciliation with the state compliance system).
Identify what to adjust with exactly one of product_id, batch_id, or package_id, matching how the product's inventory is tracked (product-, batch-, or package-tracked). Supplying more than one, or none, is rejected.
There are two adjustment modes, selected by whether you pass package_id:
• Standard adjustment (product_id or batch_id): set quantity in the product's unit type and a source location_id. A positive quantity adds on-hand inventory at that location (recorded as a gain), a negative quantity removes it (recorded as a loss); when reason is waste the quantity moves the stock into a waste state and must be negative. No compliance system is touched, so the change is visible in Distru inventory immediately.
• Compliance adjustment (package_id): set compliance_quantity in the package's unit type and omit location_id — the package's current location is used automatically. The package's tracked quantity is updated and the change is pushed to the connected state traceability system (Metrc or BioTrack) synchronously, as part of this request. A 200 means the compliance system accepted the change; if it rejects it, you get a 400 carrying the compliance error message as a single human-readable string. reason must be one the compliance system accepts for package adjustments.
The whole operation is atomic: if any validation fails or the compliance sync is rejected, nothing is persisted — no inventory moves and the package is left untouched. A compliance adjustment additionally requires the target package to be in an adjustable state — it is rejected if the package is on hold, destroyed, discontinued, inactive, syncing, transferred, finished, scheduled for destruction, assigned to an order, or has unresolved compliance audit discrepancies, and a negative adjustment cannot exceed the package's currently available quantity. For Metrc finished-good packages, an increase also cannot push the quantity above what was received or created for that package (less what has already been used), and count-based packages may be required to stay whole numbers.
Stock adjustments are immutable: once created they cannot be edited or deleted through this API.
Required permission: products_permissions_adjust_inventory. Setting unit_cost additionally requires cost accounting to be enabled for the company and permission to apply costs on quantity adjustments.
Request body
Response
The stock adjustment was inserted successfully
Changes
No recorded changes to this endpoint across all 1 revision of this API.