Create, update or delete a product

distru-mutate-productWrite

Creates, updates or deletes one catalog product.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
actionenum
CREATEUPDATEDELETE
Yes
idstringNoRequired for UPDATE and DELETE. Resolve via distru-search-products.
namestringNoRequired for CREATE. Unique within your company. No : [ or ].
skustringNoRequired for CREATE. Unique within your company.
categoryIdstringNoRequired for CREATE. Resolve via distru-search-lookups (type PRODUCT_CATEGORY).
unitTypeIdstringNoRequired for CREATE. Package-tracked products need a standard unit type. Cannot change once the product has inventory. Resolve via distru-search-lookups (type UNIT_TYPE).
vendorIdstringNoRequired for CREATE. Vendor company. Resolve via distru-search-companies.
unitPricestring or numberNoRequired for CREATE. Sale price per unit.
inventoryTrackingMethodenum
BATCHPACKAGEPRODUCT
NoRequired for CREATE; cannot change afterwards. PACKAGE: stock in Metrc-tagged packages. BATCH: lot-tracked stock without Metrc tags. PRODUCT: untracked stock.
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.
externalNamestring or nullNoCustomer-facing name on Distru Commerce menus; blank falls back to name. Send null to clear it.
upcstring or nullNoSend null to clear it.
subcategoryIdstring or nullNoMust belong to the product's category. Resolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories). Send null to clear it.
brandIdstring or nullNoBrand company. Resolve via distru-search-companies. Send null to clear it.
strainIdstring or nullNoFrom the strain on distru-search-products rows. Send null to clear it.
groupIdstring or nullNoResolve via distru-search-lookups (type PRODUCT_GROUP). 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.
totalCannabinoidUnitenum or null
MGPERCENT
NoRequired while totalThc or totalCbd is set. Send null to clear it.
totalThcstring or number or nullNoIn totalCannabinoidUnit; non-negative, at most 100 for PERCENT. Send null to clear it.
totalCbdstring or number or nullNoIn totalCannabinoidUnit; non-negative, at most 100 for PERCENT. 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.
unitNetWeightstring or number or nullNoPer unit, in unitNetWeightAndServingSizeUnitTypeId, which must be set with it. Greater than zero. Send null to clear it.
unitServingSizestring or number or nullNoPer unit, in unitNetWeightAndServingSizeUnitTypeId, which must be set with it. Greater than zero, at most unitNetWeight. Send null to clear it.
unitNetWeightAndServingSizeUnitTypeIdstring or nullNoWeight or volume unit type. Required while unitNetWeight or unitServingSize is set. Resolve via distru-search-lookups (type UNIT_TYPE). 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.
tagIdsstring[]NoReplaces the whole list; [] removes every tag. Resolve via distru-search-lookups (type PRODUCT_TAG).
isInactivebooleanNoHidden from distru-search-products unless its status asks for inactive.
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.
customFieldsobject[]NoOnly the fields listed change. Required custom fields must be set, on update too, while still blank.
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

This tool returns one of 2 shapes, depending on its inputs.

Presence on a nested field assumes its parent exists.

Result with product

FieldTypePresence
productobjectAlways
product.idstringAlways
product.customFieldsobject[]Always
product.customFields[].customFieldobjectAlways
product.customFields[].customField.idstringAlways
product.customFields[].customField.namestringAlways
product.customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
product.customFields[].valuestringCan be null
product.namestringAlways
product.externalNamestringCan be null
product.skustringAlways
product.upcstringCan be null
product.descriptionstringCan be null
product.descriptionMarkdownstringCan be null
product.isInactivebooleanAlways
product.isFeaturedbooleanAlways
product.maxMenuBuyerOrderQuantitynumberCan be null
product.inventoryTrackingMethodenum
BATCHPACKAGEPRODUCT
Always
product.unitCoststringCan be null
product.activeQuantityCoststringCan be null
product.unitPricestringAlways
product.wholesaleUnitPricestringCan be null
product.msrpstringCan be null
product.unitsPerCasestringCan be null
product.totalThcstringCan be null
product.totalCbdstringCan be null
product.totalCannabinoidUnitenum
MGPERCENT
Can be null
product.quantityActivestringAlways
product.quantityActivePassedTestingstringCan be null
product.quantityAvailablestringAlways
product.quantityIncomingstringAlways
product.quantityReservedstringAlways
product.quantityPendingOutputstringAlways
product.quantityAvailableThresholdMinstringCan be null
product.quantityAvailableThresholdMaxstringCan be null
product.unitNetWeightstringCan be null
product.unitServingSizestringCan be null
product.unitNetWeightAndServingSizeUnitTypeobjectCan be null
product.unitNetWeightAndServingSizeUnitType.idstringAlways
product.unitNetWeightAndServingSizeUnitType.namestringAlways
product.grossWeightstringCan be null
product.grossWeightUnitTypeobjectCan be null
product.grossWeightUnitType.idstringAlways
product.grossWeightUnitType.namestringAlways
product.menuVisibilityenum
DO_NOT_INCLUDEINCLUDE_IN_ALLINCLUDE_IN_SELECT
Always
product.menusobject[]Always
product.menus[].idstringAlways
product.menus[].namestringAlways
product.thumbnailImageUrlstringAlways
product.urlstringAlways
product.insertedAtstringAlways
product.updatedAtstringAlways
product.categoryobjectCan be null
product.category.idstringAlways
product.category.namestringAlways
product.subcategoryobjectCan be null
product.subcategory.idstringAlways
product.subcategory.namestringAlways
product.groupobjectCan be null
product.group.idstringAlways
product.group.namestringAlways
product.unitTypeobjectAlways
product.unitType.idstringAlways
product.unitType.namestringAlways
product.strainobjectCan be null
product.strain.idstringAlways
product.strain.namestringAlways
product.brandobjectNull or absent
product.brand.idstringAlways
product.brand.namestringNull or absent
product.vendorobjectNull or absent
product.vendor.idstringAlways
product.vendor.namestringNull or absent
product.ownerobjectCan be null
product.owner.idstringAlways
product.owner.profileobjectAlways
product.owner.profile.fullNamestringAlways
product.quickbooksSalesItemobjectCan be null
product.quickbooksSalesItem.idstringAlways
product.quickbooksSalesItem.namestringAlways
product.quickbooksPurchaseItemobjectCan be null
product.quickbooksPurchaseItem.idstringAlways
product.quickbooksPurchaseItem.namestringAlways
product.tagsobject[]Always
product.tags[].idstringAlways
product.tags[].namestringAlways

Result with id

FieldTypePresence
idstringAlways
What the AI reads

Creates, updates or deletes one catalog product. Creates no inventory and pushes nothing to Metrc. Cannot add images, so CREATE is refused when your company requires product images. Does not change images, inventory, batches or the bill of materials (use distru-set-product-bill-of-materials); apply the same change to many products with distru-bulk-update-products. Read current values with distru-get-product. DELETE soft-deletes the product with its batches and bill of materials (no tool or screen restores them) and removes it from other products' bills of materials for good; refused while it has stock or appears on any sales order, purchase, return, stock transfer, product request or assembly; to retire such a product, UPDATE isInactive. CREATE and UPDATE return the product as distru-get-product does with includeTags; DELETE returns its id. Sparse update: on UPDATE only the fields passed change and the rest stay as they are; a field sent as null is cleared.