Search lookups

distru-search-lookupsRead

Searches your named lists, such as product categories, tags, groups, payment terms and taxes.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
limitintegerNoDefault 10; PRODUCT_CATEGORY, LICENSE_TYPE and COMPANY_CATEGORY 100.
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
chargeTypesenum[]
CHARGEDISCOUNT
NoCHARGE_PRESET only.
idsstring[]NoIDs of the chosen type; unknown IDs are ignored, not errors. Not for PAYMENT_METHOD, LICENSE_TYPE or COMPANY_CATEGORY. TAX: deleted taxes still match.
searchstringNoCase-insensitive substring of name; PRODUCT_CATEGORY also matches subcategory names and still returns every subcategory; PAYMENT_METHOD also fuzzy word match. Not for TAX.
statusenum
ACTIVEANYINACTIVE
NoCOST_TYPE or UNIT_TYPE only. COST_TYPE: whether it can still be picked for new costs. Default ACTIVE.
unitTypeCategoriesenum[]
COUNTVOLUMEWEIGHT
NoUNIT_TYPE only.
sortByobjectNoDefault: most recently updated first; PRODUCT_CATEGORY name A–Z. Ignored when search is set, except on PAYMENT_METHOD and CHARGE_PRESET. Not for LICENSE_TYPE or COMPANY_CATEGORY, always name A–Z.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
INSERTED_ATNAMEUPDATED_AT
Yes
typeenum
13 values
COMPANY_GROUPRELATIONSHIP_TYPEPRODUCT_TAGPRODUCT_GROUPPRODUCT_CATEGORYUNIT_TYPECOST_TYPEPAYMENT_METHODPAYMENT_TERMTAXCHARGE_PRESETLICENSE_TYPECOMPANY_CATEGORY
Yes

Output

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

Presence on a nested field assumes its parent exists.

Result shape 1

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways

Result shape 2

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].subcategoriesobject[]Always
items[].subcategories[].idstringAlways
items[].subcategories[].namestringAlways

Result shape 3

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].categoryenum
COUNTVOLUMEWEIGHT
Can be null
items[].activebooleanAlways
items[].lockedbooleanAlways

Result shape 4

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].descriptionstringCan be null
items[].activebooleanAlways
items[].allowInlineEditsbooleanAlways
items[].costPerUnitstringCan be null
items[].unitTypeobjectAlways
items[].unitType.idstringAlways
items[].unitType.namestringAlways

Result shape 5

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].daysnumberAlways

Result shape 6

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].taxCodestringAlways
items[].descriptionstringCan be null
items[].taxRatePercentstringAlways
items[].taxAppliedAfterChargesbooleanCan be null
items[].taxAppliedAfterPriceTiersbooleanCan be null
items[].companyCategoriesstringCan be null
items[].isMichiganTaxbooleanAlways
items[].michiganTaxTypeenum
NON_VERTICALVERTICAL
Can be null
items[].deletedAtstringCan be null

Result shape 7

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].typeenum
CHARGEDISCOUNT
Always
items[].unitTypeenum
PERCENTPRICE
Always
items[].pricestringCan be null
items[].percentstringCan be null
items[].allowInlineEditsbooleanAlways
items[].autoApplyTagsOnSalesOrdersbooleanAlways
items[].autoApplyTagsOnPurchaseOrdersbooleanAlways
items[].tagsobject[]Always
items[].tags[].idstringAlways
items[].tags[].namestringAlways
items[].insertedAtstringAlways
items[].updatedAtstringAlways

Result shape 8

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].namestringAlways
What the AI reads

Searches one of the company's named lists other records point at, picked by type: COMPANY_GROUP, company groups it sorts companies into; RELATIONSHIP_TYPE, relationship types saying how it deals with a company (e.g. Current Customer); PRODUCT_TAG, product tags (a product can carry many); PRODUCT_GROUP, product groups (a product is in at most one); PRODUCT_CATEGORY, product categories, one row per category with every subcategory; UNIT_TYPE, unit types (Gram, Unit, Ounce…) and what each measures; COST_TYPE, cost types, e.g. Labor; PAYMENT_METHOD, payment methods (cash, check, card…); PAYMENT_TERM, payment terms (e.g. Net 30); TAX, tax definitions applied to sales; CHARGE_PRESET, charge presets: saved charge or discount templates for orders and invoices; LICENSE_TYPE and COMPANY_CATEGORY, license types and company categories valid in the company's state, names only (no IDs). Use it to resolve an ID by name; for the records carrying one use the tool whose filter takes it, e.g. distru-search-products tagIds. PRODUCT_CATEGORY: deleted categories are never returned; subcategory names are unique only within their category, so tell them apart by ID; a product's subcategory must belong to its category. COST_TYPE: costPerUnit is the rate per unit of its unitType, null when the caller's role may not view cost type rates. TAX: taxes are few, so read them all or filter by ids; deleted taxes come back with deletedAt set, so treat a non-null deletedAt as no longer in use; taxAppliedAfterCharges and taxAppliedAfterPriceTiers are the CA excise ordering flags, and a Michigan tax always applies before discounts, after charges and after other taxes; companyCategories is a comma-separated list of company category names. CHARGE_PRESET: unitType PRICE sets price, PERCENT sets percent; amounts are positive and a DISCOUNT subtracts them; autoApplyTagsOn* say whether the preset is added when a product with one of its tags joins that kind of order; non-admins see only unowned presets, their own and their teams'.