Search products
distru-search-productsReadSearches the product catalog with prices, costs, stock across locations, potency and classification.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Default: 10 |
| cursor | string | No | nextCursor of the previous call; keep the other arguments unchanged. |
| belowQuantityAvailableThresholdMin | boolean | No | true: available below quantityAvailableThresholdMin (reorder candidates); false: every other product, incl. those with no minimum. |
| brandIds | string[] | No | Any of these brands, each itself a company. Resolve via distru-search-companies. |
| hasBillOfMaterials | boolean | No | |
| ids | string[] | No | Product IDs. |
| madeWithProductId | string | No | Only 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. |
| menuIds | string[] | No | On any of these menus. Inactive products only with status ANY. Resolve via distru-search-menus. |
| notOnMenuIds | string[] | No | On none of these menus, e.g. what is missing from a menu. Resolve via distru-search-menus. |
| productCategoryIds | string[] | No | Resolve via distru-search-lookups (type PRODUCT_CATEGORY). |
| productGroupIds | string[] | No | Resolve via distru-search-lookups (type PRODUCT_GROUP). |
| productSubcategoryIds | string[] | No | Resolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories). |
| search | string | No | Case-insensitive substring of name or SKU, plus fuzzy match on name. Ranks substring matches first, then closest names. |
| status | enumACTIVEANYINACTIVE | No | Default ACTIVE. Deleted products never returned. |
| strainIds | string[] | No | IDs from each row's strain. |
| tagIds | string[] | No | Any of these tags. Resolve via distru-search-lookups (type PRODUCT_TAG). |
| unitTypeCategories | enum[]COUNTVOLUMEWEIGHT | No | What the product is measured in: COUNT = each-based, WEIGHT = grams/pounds, VOLUME = liquids. |
| vendorId | string | No | Resolve via distru-search-companies. |
| customFields | object[] | No | Set one of contains, anyOf or onOrAfter/onOrBefore per entry. Records with no value for the field never match. |
| customFields[]. | string | Yes | Resolve via distru-search-custom-fields. |
| customFields[]. | string | No | TEXT: case-insensitive substring. |
| customFields[]. | string[] | No | DROPDOWN, CHECKBOX: any of these options, case-sensitive. |
| customFields[]. | string | No | DATE: YYYY-MM-DD, company timezone. |
| customFields[]. | string | No | DATE: YYYY-MM-DD, company timezone. |
| sortBy | object | No | Default: most recently updated first. Ignored when search is set. |
| sortBy. | enumASCDESC | Yes | |
| sortBy. | enumINSERTED_ATNAMEQUANTITY_ACTIVEQUANTITY_AVAILABLEQUANTITY_AVAILABLE_THRESHOLD_MIN_RATIOUNIT_PRICEUPDATED_AT | Yes | QUANTITY_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.
| Field | Type | Presence |
|---|---|---|
| hasMore | boolean | Always |
| nextCursor | string | Can be absent |
| totalCount | integer | Can be absent |
| items | object[] | Always |
| items[]. | string | Always |
| items[]. | object[] | Always |
| items[]. | object | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | enumCHECKBOXDATEDROPDOWNTEXT | Always |
| items[]. | string | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | boolean | Always |
| items[]. | enumBATCHPACKAGEPRODUCT | Always |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Always |
| items[]. | object | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | enumMGPERCENT | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Null or absent |
| items[]. | string | Always |
| items[]. | string | Null or absent |
| items[]. | object | Null or absent |
| items[]. | string | Always |
| items[]. | string | Null or absent |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Can be absent |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | object[] | Can be absent |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Can be absent |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Can be absent |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Can be absent |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Can be absent |
| items[]. | string | Always |
| items[]. | string | Always |
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.