Search products

distru-search-productsRead

Searches the product catalog with prices, costs, stock across locations, potency and classification.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
limitintegerNoDefault: 10
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
belowQuantityAvailableThresholdMinbooleanNotrue: available below quantityAvailableThresholdMin (reorder candidates); false: every other product, incl. those with no minimum.
brandIdsstring[]NoAny of these brands, each itself a company. Resolve via distru-search-companies.
hasBillOfMaterialsbooleanNo
idsstring[]NoProduct IDs.
madeWithProductIdstringNoOnly products whose bill of materials this product can fill an input of: an input of this exact product, or an anyProductMatching input whose conditions it meets. Each row then lists those inputs in madeWithInputs: quantity per unit of the row's product, in unitType; anyProductMatching null for an exact-product input, else the conditions it met (any entry within a list; absent key = no condition). For which products use an ingredient or packaging item, and how much. Resolve via distru-search-products.
menuIdsstring[]NoOn any of these menus. Inactive products only with status ANY. Resolve via distru-search-menus.
notOnMenuIdsstring[]NoOn none of these menus, e.g. what is missing from a menu. Resolve via distru-search-menus.
productCategoryIdsstring[]NoResolve via distru-search-lookups (type PRODUCT_CATEGORY).
productGroupIdsstring[]NoResolve via distru-search-lookups (type PRODUCT_GROUP).
productSubcategoryIdsstring[]NoResolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories).
searchstringNoCase-insensitive substring of name or SKU, plus fuzzy match on name. Ranks substring matches first, then closest names.
statusenum
ACTIVEANYINACTIVE
NoDefault ACTIVE. Deleted products never returned.
strainIdsstring[]NoIDs from each row's strain.
tagIdsstring[]NoAny of these tags. Resolve via distru-search-lookups (type PRODUCT_TAG).
unitTypeCategoriesenum[]
COUNTVOLUMEWEIGHT
NoWhat the product is measured in: COUNT = each-based, WEIGHT = grams/pounds, VOLUME = liquids.
vendorIdstringNoResolve via distru-search-companies.
customFieldsobject[]NoSet one of contains, anyOf or onOrAfter/onOrBefore per entry. Records with no value for the field never match.
customFields[].customFieldIdstringYesResolve via distru-search-custom-fields.
customFields[].containsstringNoTEXT: case-insensitive substring.
customFields[].anyOfstring[]NoDROPDOWN, CHECKBOX: any of these options, case-sensitive.
customFields[].onOrAfterstringNoDATE: YYYY-MM-DD, company timezone.
customFields[].onOrBeforestringNoDATE: YYYY-MM-DD, company timezone.
sortByobjectNoDefault: most recently updated first. Ignored when search is set.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
INSERTED_ATNAMEQUANTITY_ACTIVEQUANTITY_AVAILABLEQUANTITY_AVAILABLE_THRESHOLD_MIN_RATIOUNIT_PRICEUPDATED_AT
YesQUANTITY_AVAILABLE_THRESHOLD_MIN_RATIO = available / quantityAvailableThresholdMin: <= 0 nothing available, < 1 below minimum, so ASC puts most urgent reorders first; minimum unset or 0 always last.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].customFieldsobject[]Always
items[].customFields[].customFieldobjectAlways
items[].customFields[].customField.idstringAlways
items[].customFields[].customField.namestringAlways
items[].customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
items[].customFields[].valuestringCan be null
items[].namestringAlways
items[].skustringAlways
items[].upcstringCan be null
items[].isInactivebooleanAlways
items[].inventoryTrackingMethodenum
BATCHPACKAGEPRODUCT
Always
items[].unitPricestringAlways
items[].wholesaleUnitPricestringCan be null
items[].unitCoststringCan be null
items[].activeQuantityCoststringCan be null
items[].unitsPerCasestringCan be null
items[].quantityActivestringAlways
items[].quantityActivePassedTestingstringCan be null
items[].quantityAssemblingstringAlways
items[].quantityAvailablestringAlways
items[].quantityIncomingstringAlways
items[].quantityPendingOutputstringAlways
items[].quantityPossiblestringCan be null
items[].quantityReservedstringAlways
items[].quantityAvailableThresholdMinstringCan be null
items[].quantityAvailableThresholdMaxstringCan be null
items[].unitNetWeightstringCan be null
items[].unitNetWeightAndServingSizeUnitTypeobjectCan be null
items[].unitNetWeightAndServingSizeUnitType.idstringAlways
items[].unitNetWeightAndServingSizeUnitType.namestringAlways
items[].activeQuantitiesByLocationobject[]Always
items[].activeQuantitiesByLocation[].locationobjectAlways
items[].activeQuantitiesByLocation[].location.idstringAlways
items[].activeQuantitiesByLocation[].location.namestringAlways
items[].activeQuantitiesByLocation[].quantitystringAlways
items[].totalThcstringCan be null
items[].totalCbdstringCan be null
items[].totalCannabinoidUnitenum
MGPERCENT
Can be null
items[].insertedAtstringAlways
items[].updatedAtstringAlways
items[].categoryobjectCan be null
items[].category.idstringAlways
items[].category.namestringAlways
items[].subcategoryobjectCan be null
items[].subcategory.idstringAlways
items[].subcategory.namestringAlways
items[].groupobjectCan be null
items[].group.idstringAlways
items[].group.namestringAlways
items[].tagsobject[]Always
items[].tags[].idstringAlways
items[].tags[].namestringAlways
items[].unitTypeobjectAlways
items[].unitType.idstringAlways
items[].unitType.namestringAlways
items[].strainobjectCan be null
items[].strain.idstringAlways
items[].strain.namestringAlways
items[].brandobjectNull or absent
items[].brand.idstringAlways
items[].brand.namestringNull or absent
items[].vendorobjectNull or absent
items[].vendor.idstringAlways
items[].vendor.namestringNull or absent
items[].quickbooksSalesItemobjectCan be null
items[].quickbooksSalesItem.idstringAlways
items[].quickbooksSalesItem.namestringAlways
items[].quickbooksPurchaseItemobjectCan be null
items[].quickbooksPurchaseItem.idstringAlways
items[].quickbooksPurchaseItem.namestringAlways
items[].madeWithInputsobject[]Can be absent
items[].madeWithInputs[].quantitystringAlways
items[].madeWithInputs[].unitTypeobjectCan be null
items[].madeWithInputs[].unitType.idstringAlways
items[].madeWithInputs[].unitType.namestringAlways
items[].madeWithInputs[].anyProductMatchingobjectCan be null
items[].madeWithInputs[].anyProductMatching.oneOfProductCategoriesobject[]Can be absent
items[].madeWithInputs[].anyProductMatching.oneOfProductCategories[].idstringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductCategories[].namestringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductSubcategoriesobject[]Can be absent
items[].madeWithInputs[].anyProductMatching.oneOfProductSubcategories[].idstringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductSubcategories[].namestringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductGroupsobject[]Can be absent
items[].madeWithInputs[].anyProductMatching.oneOfProductGroups[].idstringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductGroups[].namestringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductStrainsobject[]Can be absent
items[].madeWithInputs[].anyProductMatching.oneOfProductStrains[].idstringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductStrains[].namestringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductTagsobject[]Can be absent
items[].madeWithInputs[].anyProductMatching.oneOfProductTags[].idstringAlways
items[].madeWithInputs[].anyProductMatching.oneOfProductTags[].namestringAlways
What the AI reads

Searches the product catalog: one row per product with prices, costs, stock quantities rolled up across every location plus the active quantity each location holds, stock levels, potency and classification. For the full bill of materials use distru-get-product; for the individual packages or batches holding the stock use distru-search-packages or distru-search-batches; when building an order from a menu use distru-search-menu-products. Results the caller's team restrictions hide are omitted. Quantities are in the product's unit type: active is only stock free in inventory, so stock being assembled, sold, returned or transferred is already out of it; never subtract assembling from active. available is active minus reserved, what can still be sold; assembling is held by pending assemblies; incoming is on purchase orders not yet received, drafts included; possible is how many units its bill of materials can make from the available quantity of its inputs (null without one); quantityActivePassedTesting is the part of active in packages whose lab test passed, null for batch- and product-tracked products. unitCost is the default cost per unit; activeQuantityCost is the total cost of the active quantity, not per unit, null when none is recorded or the caller cannot view costs. unitNetWeight is the net content of one unit, in unitNetWeightAndServingSizeUnitType. vendor is the company the product is purchased from. quantityAvailableThresholdMin and quantityAvailableThresholdMax are the minimum and maximum stock levels (null when unset). inventoryTrackingMethod: an assembly input of a PACKAGE product needs a packageId, of a BATCH one a batchId, of a PRODUCT one neither. quickbooksSalesItem / quickbooksPurchaseItem null = no QuickBooks item of its own: its lines sync through the company's default item. For reorder questions set belowQuantityAvailableThresholdMin and sort by QUANTITY_AVAILABLE_THRESHOLD_MIN_RATIO ASC.