Update products in bulk
distru-bulk-update-productsWriteLeafLinkApplies the same changes to many products in one all-or-nothing save. Setting the unit price updates linked LeafLink products when your LeafLink settings sync prices.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| ids | string[] | Yes | Products to change. Resolve via distru-search-products. Split a larger set into several calls; if you can make only one, say which products are left (or how many, if the list is long). |
| includeInactive | boolean | No | Set only when the user explicitly asks to change inactive products; otherwise leave inactive products out of ids. Without it, listing one refuses the save. |
| vendorId | string | No | Vendor company. Resolve via distru-search-companies. |
| categoryId | string | No | Resolve via distru-search-lookups (type PRODUCT_CATEGORY). Requires subcategoryId (null to clear it). |
| unitPrice | string or number | No | Sale price per unit. |
| brandId | string or null | No | Brand company. Resolve via distru-search-companies. Send null to clear it. |
| subcategoryId | string or null | No | Must belong to categoryId, sent in the same call. Resolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories). Send null to clear it. |
| groupId | string or null | No | Resolve via distru-search-lookups (type PRODUCT_GROUP). Send null to clear it. |
| strainId | string or null | No | From the strain on distru-search-products rows. Send null to clear it. |
| ownerId | string or null | No | Owning user. Resolve via distru-search-users. Send null to clear it. |
| unitCost | string or number or null | No | Send null to clear it. |
| wholesaleUnitPrice | string or number or null | No | Send null to clear it. |
| msrp | string or number or null | No | Send null to clear it. |
| unitsPerCase | string or number or null | No | Greater than zero. Send null to clear it. |
| maxMenuBuyerOrderQuantity | integer or null | No | Most units of the product one buyer may put in one Distru Commerce menu order, on every menu; sales reps are exempt. null = no cap. Send null to clear it. |
| description | string or null | No | Plain text. Also sets descriptionMarkdown to it unless descriptionMarkdown is sent too. Required when your company requires product descriptions. Send null to clear it. |
| descriptionMarkdown | string or null | No | Supports italic, bold, strikethrough, links. Cleared only by description: null, which clears both. Send null to clear it. |
| grossWeight | string or number or null | No | Per unit, in grossWeightUnitTypeId; greater than zero. Set or clear together with it. Send null to clear it. |
| grossWeightUnitTypeId | string or null | No | Weight unit type Metrc supports; set or clear together with grossWeight. Resolve via distru-search-lookups (type UNIT_TYPE). Send null to clear it. |
| quantityAvailableThresholdMin | string or number or null | No | Low-stock alert, in the product's unit type; below quantityAvailableThresholdMax. Send null to clear it. |
| quantityAvailableThresholdMax | string or number or null | No | High-stock alert, in the product's unit type; above quantityAvailableThresholdMin. Send null to clear it. |
| isFeatured | boolean | No | Pinned to the top of Distru Commerce menus. |
| menuVisibility | enumDO_NOT_INCLUDEINCLUDE_IN_ALLINCLUDE_IN_SELECT | No | Distru Commerce menus. INCLUDE_IN_SELECT: the menus in menus; links to menus you can't see stay. INCLUDE_IN_ALL: every current menu, and new ones, except a copy of a menu it isn't on, or a new (not copied) menu made by someone who can't see the product. |
| menus | string[] | No | Required with menuVisibility INCLUDE_IN_SELECT and only read then. Replaces the whole list. Resolve via distru-search-menus. |
| addMenuIds | string[] | No | Added to each product, keeping its other menus. INCLUDE_IN_ALL products keep that placement; the others become INCLUDE_IN_SELECT. Refused for a menu you can't see. Not with menuVisibility, menus or removeMenuIds. Resolve via distru-search-menus. |
| removeMenuIds | string[] | No | Taken off each product, keeping its other menus. List only products to take off these menus: an INCLUDE_IN_ALL product listed becomes INCLUDE_IN_SELECT, so new menus no longer get it, except copies of menus it's on. Refused for a menu you can't see. Not with menuVisibility, menus or addMenuIds. Resolve via distru-search-menus. |
| tagIds | string[] | No | Replaces each product's whole tag list; [] removes every tag. Resolve via distru-search-lookups (type PRODUCT_TAG). |
| addTagIds | string[] | No | Added to each product, keeping its other tags. Resolve via distru-search-lookups (type PRODUCT_TAG). |
| removeTagIds | string[] | No | Removed from each product, keeping its other tags. Resolve via distru-search-lookups (type PRODUCT_TAG). |
| customFields | object[] | No | Only the fields listed change. A required custom field cannot be cleared. |
| customFields[]. | string | Yes | Resolve via distru-search-custom-fields (entityType PRODUCT). |
| 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 |
|---|---|---|
| products | object[] | Always |
| products[]. | string | Always |
| products[]. | string | Always |
| products[]. | string | Always |
| products[]. | string | Always |
What the AI reads
Applies the same changes to many products in one all-or-nothing save: if any product fails a check, nothing is saved and the error names the failing products. For one product, or values that differ per product (name, SKU, UPC, external name, unit type, potency, net weights), use distru-mutate-product. Refused whole when an id is unknown or inactive without includeInactive, or permission denied when your team can't see a product. Read the new values with distru-get-product. Sparse update: only the fields passed change, on every product; a field sent as null is cleared on all of them.