Change a lookup value
distru-mutate-reference-typeWriteQuickBooksAdds, 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.
| Field | Type | Required | Description |
|---|---|---|---|
| action | enumCREATEUPDATEDELETE | Yes | |
| type | enumPRODUCT_SUBCATEGORYCOMPANY_GROUPRELATIONSHIP_TYPEPRODUCT_TAGPRODUCT_GROUPPRODUCT_CATEGORYPAYMENT_METHODSTRAIN | Yes | |
| id | string | No | Required for UPDATE and DELETE: an ID of the chosen type. Resolve via distru-search-lookups (PRODUCT_SUBCATEGORY: the subcategories of its PRODUCT_CATEGORY). |
| name | string | No | Required 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. |
| paymentMethodType | enumBANK_REMITTANCEBANK_TRANSFERCASHCHECKCREDIT_CARD | No | PAYMENT_METHOD only. Required for CREATE. |
| officialProductCategoryId | enumCAPSULESCLONESCONCENTRATESEDIBLESFLOWERMERCHOTHERPREROLLSTINCTURESTOPICALSVAPES | No | PRODUCT_CATEGORY only. Required for CREATE; only set on CREATE. |
| productCategoryId | string | No | PRODUCT_SUBCATEGORY only. Required for CREATE; only set on CREATE. Resolve via distru-search-lookups (type PRODUCT_CATEGORY). |
| strainType | enum or nullHIGH_CBDHYBRIDINDICAINDICA_DOMINANTSATIVASATIVA_DOMINANT | No | STRAIN 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
| Field | Type | Presence |
|---|---|---|
| tag | object | Always |
| tag. | string | Always |
| tag. | string | Always |
Result with id
| Field | Type | Presence |
|---|---|---|
| id | string | Always |
Result with productGroup
| Field | Type | Presence |
|---|---|---|
| productGroup | object | Always |
| productGroup. | string | Always |
| productGroup. | string | Always |
Result with paymentMethod
| Field | Type | Presence |
|---|---|---|
| paymentMethod | object | Always |
| paymentMethod. | string | Always |
| paymentMethod. | string | Always |
| paymentMethod. | enumBANK_REMITTANCEBANK_TRANSFERCASHCHECKCREDIT_CARD | Can be null |
Result with relationshipType
| Field | Type | Presence |
|---|---|---|
| relationshipType | object | Always |
| relationshipType. | string | Always |
| relationshipType. | string | Always |
Result with productCategory
| Field | Type | Presence |
|---|---|---|
| productCategory | object | Always |
| productCategory. | string | Always |
| productCategory. | string | Always |
| productCategory. | string | Can be null |
Result with productSubcategory
| Field | Type | Presence |
|---|---|---|
| productSubcategory | object | Always |
| productSubcategory. | string | Always |
| productSubcategory. | string | Always |
| productSubcategory. | object | Always |
| productSubcategory. | string | Always |
| productSubcategory. | string | Always |
Result with companyGroup
| Field | Type | Presence |
|---|---|---|
| companyGroup | object | Always |
| companyGroup. | string | Always |
| companyGroup. | string | Always |
Result with strain
| Field | Type | Presence |
|---|---|---|
| strain | object | Always |
| strain. | string | Always |
| strain. | string | Always |
| strain. | enumHIGH_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.