Search a menu's products

distru-search-menu-productsRead

Searches the products on one menu, with quantity available, sold-out status and THC as that menu shows them.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
menuIdstringYesResolve via distru-search-menus.
searchstringNoMatches name, SKU, strain, brand, category, subcategory, strain type, category type, and product group (if the menu allows group filtering). Ranks by relevance; sortBy ignored.
productIdsstring[]NoResolve via distru-search-products.
officialProductCategoriesenum[]
CAPSULESCLONESCONCENTRATESEDIBLESFLOWERMERCHOTHERPREROLLSTINCTURESTOPICALSVAPES
NoCategory type. See productCategoryIds.
productCategoryIdsstring[]NoNarrows only its own category type: FLOWER + EDIBLES + a Gummies category returns all flower but only gummies. Works alone, also for a category with no category type. From includeFilterOptions (only categories with a category type). Resolve via distru-search-lookups (type PRODUCT_CATEGORY).
productSubcategoryIdsstring[]NoNarrows only its own category, as productCategoryIds narrows a category type. Works alone. From includeFilterOptions. Resolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories).
strainTypesenum[]
HIGH_CBDHYBRIDINDICAINDICA_DOMINANTSATIVASATIVA_DOMINANT
No
strainIdsstring[]NoFrom includeFilterOptions or a row's strain.
brandIdsstring[]NoBrand, itself a company. From includeFilterOptions or a row's brand, or resolve via distru-search-companies.
productGroupIdsstring[]NoFrom includeFilterOptions. Resolve via distru-search-lookups (type PRODUCT_GROUP).
includeFilterOptionsbooleanNoAdds filterOptions: the values of each filter this menu shows, keyed by the param they go in; category types nest their categories and subcategories. They span the whole menu (or productIds), not search or the other filters. Slow on large menus.
sortByobjectNoDefault: most recently updated on the menu first. Ignored when search is set; to find by name, use search.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
INSERTED_ATPRODUCT_NAMEUPDATED_AT
YesINSERTED_AT = added to the menu; UPDATED_AT = menu listing last changed; PRODUCT_NAME = buyer-facing name.
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
notestringCan be absent
filterOptionsobjectCan be absent
filterOptions.officialProductCategoriesobject[]Can be absent
filterOptions.officialProductCategories[].idstringAlways
filterOptions.officialProductCategories[].namestringAlways
filterOptions.officialProductCategories[].productCategoryIdsobject[]Can be absent
filterOptions.officialProductCategories[].productCategoryIds[].idstringAlways
filterOptions.officialProductCategories[].productCategoryIds[].namestringAlways
filterOptions.officialProductCategories[].productCategoryIds[].productSubcategoryIdsobject[]Can be absent
filterOptions.officialProductCategories[].productCategoryIds[].productSubcategoryIds[].idstringAlways
filterOptions.officialProductCategories[].productCategoryIds[].productSubcategoryIds[].namestringAlways
filterOptions.officialProductCategories[].productSubcategoryIdsobject[]Can be absent
filterOptions.officialProductCategories[].productSubcategoryIds[].idstringAlways
filterOptions.officialProductCategories[].productSubcategoryIds[].namestringAlways
filterOptions.strainTypesobject[]Can be absent
filterOptions.strainTypes[].idstringAlways
filterOptions.strainTypes[].namestringAlways
filterOptions.strainIdsobject[]Can be absent
filterOptions.strainIds[].idstringAlways
filterOptions.strainIds[].namestringAlways
filterOptions.brandIdsobject[]Can be absent
filterOptions.brandIds[].idstringAlways
filterOptions.brandIds[].namestringAlways
filterOptions.productGroupIdsobject[]Can be absent
filterOptions.productGroupIds[].idstringAlways
filterOptions.productGroupIds[].namestringAlways
itemsobject[]Always
items[].idstringAlways
items[].namestringAlways
items[].unitsPerCasestringCan be null
items[].maxMenuBuyerOrderQuantitynumberCan be null
items[].totalThcstringCan be null
items[].totalCannabinoidUnitenum
MGPERCENT
Can be null
items[].brandobjectCan be null
items[].brand.idstringAlways
items[].brand.namestringAlways
items[].categoryobjectAlways
items[].category.idstringAlways
items[].category.namestringAlways
items[].category.officialProductCategoryobjectCan be null
items[].category.officialProductCategory.idstringAlways
items[].subcategoryobjectCan be null
items[].subcategory.idstringAlways
items[].subcategory.namestringAlways
items[].strainobjectCan be null
items[].strain.idstringAlways
items[].strain.namestringAlways
items[].strain.strainTypeenum
HIGH_CBDHYBRIDINDICAINDICA_DOMINANTSATIVASATIVA_DOMINANT
Can be null
items[].unitTypeobjectAlways
items[].unitType.idstringAlways
items[].unitType.namestringAlways
items[].unitType.categoryenum
COUNTVOLUMEWEIGHT
Can be null
items[].unitType.qtyPerSiUnitstringCan be null
items[].quantityAvailablestringCan be null
items[].soldOutbooleanAlways
items[].unitPricestringCan be null
items[].thcPercentageTotalLevelsobject[]Always
items[].thcPercentageTotalLevels[].thcPercentageTotalstringAlways
items[].thcPercentageTotalLevels[].quantityAvailablestringCan be null
items[].thcPercentageTotalRangeobjectCan be null
items[].thcPercentageTotalRange.maxstringAlways
items[].thcPercentageTotalRange.minstringAlways
What the AI reads

Searches the products on one menu, with quantity available, sold-out status and THC as that menu shows them. Use it instead of distru-search-products when finding products to add to an order — it only shows products available on the menu. For which products are placed on a menu, including ones buyers don't see, use distru-search-products menuIds / notOnMenuIds. A filter given several values matches any of them. 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.