Search Metrc items

distru-search-metrc-itemsRead

Searches the Metrc items of one license — the product definitions the state has accepted.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
limitintegerNoDefault: 10
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
licenseIdstringYesResolve via distru-search-licenses.
searchstringNoCase-insensitive substring of item name. Does not change sort order.
categoryNamesstring[]NoExact, case-sensitive productCategoryName values. Resolve via distru-search-metrc-item-categories.
unitTypeCategoryenum
COUNTVOLUMEWEIGHT
NoMatch the output product's unit type so the assembly's compliance quantity is in a unit Metrc accepts.
sortByobjectNoDefault: most recently created first.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
INSERTED_ATNAME
YesINSERTED_AT = created in Metrc; items whose state omits it sort last.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].idstringAlways
items[].namestringCan be absent
items[].productCategoryNamestringNull or absent
items[].productCategoryTypestringNull or absent
items[].unitOfMeasureNamestringNull or absent
items[].quantityTypestringNull or absent
items[].strainNamestringNull or absent
What the AI reads

Searches the Metrc items of one license — the product definitions the state has accepted. Each row's id is the Metrc item ID an assembly output's metrcItemId expects; it is a Metrc value, not a Distru ID. Check the item's category, unit, quantity type and strain match the product it will be packaged as. Items Distru has queued but Metrc has not created yet are not in this list — use distru-search-pending-metrc-items for those. Deleted items are never returned.