Update products in bulk

distru-bulk-update-productsWriteLeafLink

Applies 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.

FieldTypeRequiredDescription
idsstring[]YesProducts 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).
includeInactivebooleanNoSet only when the user explicitly asks to change inactive products; otherwise leave inactive products out of ids. Without it, listing one refuses the save.
vendorIdstringNoVendor company. Resolve via distru-search-companies.
categoryIdstringNoResolve via distru-search-lookups (type PRODUCT_CATEGORY). Requires subcategoryId (null to clear it).
unitPricestring or numberNoSale price per unit.
brandIdstring or nullNoBrand company. Resolve via distru-search-companies. Send null to clear it.
subcategoryIdstring or nullNoMust 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.
groupIdstring or nullNoResolve via distru-search-lookups (type PRODUCT_GROUP). Send null to clear it.
strainIdstring or nullNoFrom the strain on distru-search-products rows. Send null to clear it.
ownerIdstring or nullNoOwning user. Resolve via distru-search-users. Send null to clear it.
unitCoststring or number or nullNoSend null to clear it.
wholesaleUnitPricestring or number or nullNoSend null to clear it.
msrpstring or number or nullNoSend null to clear it.
unitsPerCasestring or number or nullNoGreater than zero. Send null to clear it.
maxMenuBuyerOrderQuantityinteger or nullNoMost 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.
descriptionstring or nullNoPlain text. Also sets descriptionMarkdown to it unless descriptionMarkdown is sent too. Required when your company requires product descriptions. Send null to clear it.
descriptionMarkdownstring or nullNoSupports italic, bold, strikethrough, links. Cleared only by description: null, which clears both. Send null to clear it.
grossWeightstring or number or nullNoPer unit, in grossWeightUnitTypeId; greater than zero. Set or clear together with it. Send null to clear it.
grossWeightUnitTypeIdstring or nullNoWeight unit type Metrc supports; set or clear together with grossWeight. Resolve via distru-search-lookups (type UNIT_TYPE). Send null to clear it.
quantityAvailableThresholdMinstring or number or nullNoLow-stock alert, in the product's unit type; below quantityAvailableThresholdMax. Send null to clear it.
quantityAvailableThresholdMaxstring or number or nullNoHigh-stock alert, in the product's unit type; above quantityAvailableThresholdMin. Send null to clear it.
isFeaturedbooleanNoPinned to the top of Distru Commerce menus.
menuVisibilityenum
DO_NOT_INCLUDEINCLUDE_IN_ALLINCLUDE_IN_SELECT
NoDistru 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.
menusstring[]NoRequired with menuVisibility INCLUDE_IN_SELECT and only read then. Replaces the whole list. Resolve via distru-search-menus.
addMenuIdsstring[]NoAdded 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.
removeMenuIdsstring[]NoTaken 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.
tagIdsstring[]NoReplaces each product's whole tag list; [] removes every tag. Resolve via distru-search-lookups (type PRODUCT_TAG).
addTagIdsstring[]NoAdded to each product, keeping its other tags. Resolve via distru-search-lookups (type PRODUCT_TAG).
removeTagIdsstring[]NoRemoved from each product, keeping its other tags. Resolve via distru-search-lookups (type PRODUCT_TAG).
customFieldsobject[]NoOnly the fields listed change. A required custom field cannot be cleared.
customFields[].customFieldIdstringYesResolve via distru-search-custom-fields (entityType PRODUCT).
customFields[].valuestring or string[]YesTEXT: 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.

FieldTypePresence
productsobject[]Always
products[].idstringAlways
products[].namestringAlways
products[].skustringAlways
products[].updatedAtstringAlways
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.