Update packages in bulk
distru-bulk-update-packagesWriteApplies the same changes to many packages in one all-or-nothing save: if any package fails a check, nothing is saved and the error names every failing package by Metrc label.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| ids | string[] | Yes | Packages to change. Resolve via distru-search-packages. |
| productId | string | No | Moves each package to this product and rewrites its history to match: stock, transactions, costs, assembly and order lines, with quantities and prices converted to the new product's unit type. Each package joins the product's default batch; packages already on it are left alone. Must be package-tracked and measure like the current product (weight, volume or count). The Metrc item is unchanged. For packages imported under the wrong product. Resolve via distru-search-products. |
| isActive | boolean | No | false takes packages out of use in Distru: their stock stops counting as active inventory, they drop out of package lists by default, the inventory assets report and expiring alerts, and assemblies can't use them. Metrc is not touched, so the package stays active there. For packages that are wrong or should be ignored in Distru, like duplicates or test packages, not for empty Metrc packages: finish those with distru-finish-packages. true brings them back. Refused while a package is syncing. |
| batchNumber | string or null | No | Free-text label on the package, not the linked Distru batch. Send null to clear it. |
| description | string or null | No | Send null to clear it. |
| expirationDate | string or null | No | ISO 8601 with a UTC offset, e.g. "2026-09-01T00:00:00-07:00"; the company timezone is on distru-get-me. Send null to clear it. |
| harvestDate | string or null | No | YYYY-MM-DD. Send null to clear it. |
| customFields | object[] | No | Only the fields listed change. Required custom fields must be set, on update too, while still blank. |
| customFields[]. | string | Yes | Resolve via distru-search-custom-fields (entityType PACKAGE). |
| customFields[]. | string or string[] | Yes | TEXT: the text. DROPDOWN: the option name. CHECKBOX: an array of option names. DATE: YYYY-MM-DD, company timezone. "" or [] clears the field. |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence |
|---|---|---|
| packages | object[] | Always |
| packages[]. | string | Always |
| packages[]. | string | Always |
| packages[]. | object | Always |
| packages[]. | string | Always |
| packages[]. | string | Always |
| packages[]. | boolean | Always |
| packages[]. | string | Always |
What the AI reads
Applies the same changes to many packages in one all-or-nothing save: if any package fails a check, nothing is saved and the error names every failing package by Metrc label. Distru-only: nothing is sent to Metrc. To finish empty Metrc packages use distru-finish-packages. Refused whole when an id is unknown, or permission denied when your team can't see a package. Read the new values with distru-get-package. Sparse update: only the fields passed change, on every package; a field sent as null is cleared on all of them.