Change a lookup value

distru-mutate-reference-typeWriteQuickBooks

Adds, renames or deletes a value in one of your named lists, such as a product tag, category, group, strain or payment method. Only a payment method reaches QuickBooks.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
actionenum
CREATEUPDATEDELETE
Yes
typeenum
PRODUCT_SUBCATEGORYCOMPANY_GROUPRELATIONSHIP_TYPEPRODUCT_TAGPRODUCT_GROUPPRODUCT_CATEGORYPAYMENT_METHODSTRAIN
Yes
idstringNoRequired for UPDATE and DELETE: an ID of the chosen type. Resolve via distru-search-lookups (PRODUCT_SUBCATEGORY: the subcategories of its PRODUCT_CATEGORY).
namestringNoRequired for CREATE. Up to 255 characters, 31 for PAYMENT_METHOD. Unique within the type and company (within the category for PRODUCT_SUBCATEGORY); case is ignored except for RELATIONSHIP_TYPE, COMPANY_GROUP and STRAIN, where "flower" and "Flower" can both exist.
paymentMethodTypeenum
BANK_REMITTANCEBANK_TRANSFERCASHCHECKCREDIT_CARD
NoPAYMENT_METHOD only. Required for CREATE.
officialProductCategoryIdenum
CAPSULESCLONESCONCENTRATESEDIBLESFLOWERMERCHOTHERPREROLLSTINCTURESTOPICALSVAPES
NoPRODUCT_CATEGORY only. Required for CREATE; only set on CREATE.
productCategoryIdstringNoPRODUCT_SUBCATEGORY only. Required for CREATE; only set on CREATE. Resolve via distru-search-lookups (type PRODUCT_CATEGORY).
strainTypeenum or null
HIGH_CBDHYBRIDINDICAINDICA_DOMINANTSATIVASATIVA_DOMINANT
NoSTRAIN only. Optional; null clears it on UPDATE.

Output

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

Presence on a nested field assumes its parent exists.

Result with tag

FieldTypePresence
tagobjectAlways
tag.idstringAlways
tag.namestringAlways

Result with id

FieldTypePresence
idstringAlways

Result with productGroup

FieldTypePresence
productGroupobjectAlways
productGroup.idstringAlways
productGroup.namestringAlways

Result with paymentMethod

FieldTypePresence
paymentMethodobjectAlways
paymentMethod.idstringAlways
paymentMethod.namestringAlways
paymentMethod.typeenum
BANK_REMITTANCEBANK_TRANSFERCASHCHECKCREDIT_CARD
Can be null

Result with relationshipType

FieldTypePresence
relationshipTypeobjectAlways
relationshipType.idstringAlways
relationshipType.namestringAlways

Result with productCategory

FieldTypePresence
productCategoryobjectAlways
productCategory.idstringAlways
productCategory.namestringAlways
productCategory.officialProductCategoryIdstringCan be null

Result with productSubcategory

FieldTypePresence
productSubcategoryobjectAlways
productSubcategory.idstringAlways
productSubcategory.namestringAlways
productSubcategory.categoryobjectAlways
productSubcategory.category.idstringAlways
productSubcategory.category.namestringAlways

Result with companyGroup

FieldTypePresence
companyGroupobjectAlways
companyGroup.idstringAlways
companyGroup.namestringAlways

Result with strain

FieldTypePresence
strainobjectAlways
strain.idstringAlways
strain.namestringAlways
strain.strainTypeenum
HIGH_CBDHYBRIDINDICAINDICA_DOMINANTSATIVASATIVA_DOMINANT
Can be null
What the AI reads

Creates, renames or deletes a value in one of the company’s named lists other records point at, picked by type: PRODUCT_TAG, PRODUCT_GROUP, PAYMENT_METHOD, RELATIONSHIP_TYPE, PRODUCT_CATEGORY, PRODUCT_SUBCATEGORY, COMPANY_GROUP, STRAIN. Use distru-search-lookups to find the id, and before CREATE to avoid a duplicate. Each type only takes its own extra fields (see each field’s description); others are rejected. Sparse update: on UPDATE only the fields passed change. DELETE of a PAYMENT_METHOD or PRODUCT_CATEGORY hides it, and the records that use it keep it; a deleted PAYMENT_METHOD is made inactive in QuickBooks. DELETE of any other type removes it for good and clears it from every product, company, tax and charge preset that uses it. DELETE of a PRODUCT_TAG, PRODUCT_GROUP, COMPANY_GROUP, PRODUCT_CATEGORY or PRODUCT_SUBCATEGORY also removes it from price tier conditions, and deletes a tier left with no condition. DELETE of a STRAIN, PRODUCT_GROUP or PRODUCT_SUBCATEGORY also removes it from menu collection filters; a collection left with no value in that filter stops filtering on it and shows every product. Distru’s built-in RELATIONSHIP_TYPE values (Potential Customer, Current Customer, Potential Supplier, Current Supplier, Branch) can’t be updated or deleted. Unit types are not created here; resolve an existing one with distru-search-lookups (type UNIT_TYPE). CREATE and UPDATE return the record; DELETE returns its id.