Search a menu's collections

distru-search-menu-collectionsRead

Lists the collections on one menu, or fetches one collection with its products (collectionId).

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
menuIdstringYesResolve via distru-search-menus.
customerIdstringNoFor the menu's seller: fills Recently Ordered with the products this customer's linked Distru company ordered in the last 6 months (Sales Order form orders can take an hour), by name, not recency. Needs collectionId, includeProducts or productLimit. Empty without it or for a customer never linked, so not proof of no orders. Doesn't change prices. Resolve via distru-search-companies.
collectionIdstringNoReturns only this collection, with its products. To find one by name, list them without collectionId (limit 100).
includeProductsbooleanNoProducts of every listed collection; large, so prefer collectionId for one. Always on with collectionId.
productLimitintegerNoProducts per collection, by name. Default 120; productCount is the full count.
sortByobjectNoDefault: most recently updated first. Ignored with collectionId.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
INSERTED_ATNAMEPOSITIONUPDATED_AT
YesNAME = customName when set, else name; POSITION = display order on the menu.
limitintegerNoDefault: 10
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].customNamestringCan be null
items[].officialbooleanAlways
items[].positionnumberAlways
items[].productCountintegerCan be absent
items[].productsobject[]Can be absent
items[].products[].idstringAlways
items[].products[].namestringAlways
items[].products[].unitsPerCasestringCan be null
items[].products[].totalThcstringCan be null
items[].products[].totalCannabinoidUnitenum
MGPERCENT
Can be null
items[].products[].brandobjectCan be null
items[].products[].brand.idstringAlways
items[].products[].brand.namestringAlways
items[].products[].categoryobjectAlways
items[].products[].category.idstringAlways
items[].products[].category.namestringAlways
items[].products[].category.officialProductCategoryobjectCan be null
items[].products[].category.officialProductCategory.idstringAlways
items[].products[].subcategoryobjectCan be null
items[].products[].subcategory.idstringAlways
items[].products[].subcategory.namestringAlways
items[].products[].strainobjectCan be null
items[].products[].strain.idstringAlways
items[].products[].strain.namestringAlways
items[].products[].strain.strainTypeenum
HIGH_CBDHYBRIDINDICAINDICA_DOMINANTSATIVASATIVA_DOMINANT
Can be null
items[].products[].unitTypeobjectAlways
items[].products[].unitType.namestringAlways
items[].products[].unitType.categoryenum
COUNTVOLUMEWEIGHT
Can be null
items[].products[].unitType.qtyPerSiUnitstringCan be null
items[].products[].quantityAvailablestringCan be null
items[].products[].soldOutbooleanAlways
items[].products[].unitPricestringCan be null
items[].products[].thcPercentageTotalLevelsobject[]Always
items[].products[].thcPercentageTotalLevels[].thcPercentageTotalstringAlways
items[].products[].thcPercentageTotalLevels[].quantityAvailablestringCan be null
items[].products[].thcPercentageTotalRangeobjectCan be null
items[].products[].thcPercentageTotalRange.maxstringAlways
items[].products[].thcPercentageTotalRange.minstringAlways
What the AI reads

Lists the collections on one menu, or fetches one collection with its products (collectionId). To search or filter products across the whole menu use distru-search-menu-products; for a customer's order history, distru-search-sales-orders. A product's unitPrice is the base price per unit (a case costs unitPrice × unitsPerCase), before price-tier discounts, so it may not be what a buyer pays; null when the menu hides prices from the caller. For the tiers that can apply, use distru-search-price-tiers with menuIds and validAt: a tier with no customer condition applies to every buyer, while customerIds and customerGroupIds only find tiers that name them. A product's thcPercentageTotalRange spans the THC % of its in-stock lab results; thcPercentageTotalLevels lists the THC % a buyer must pick from and is empty unless the menu sells the product by potency.