Search Metrc packages

distru-search-metrc-packagesRead

Searches the packages Metrc holds for one license, as Distru last synced them, whether or not they are in Distru inventory.

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 the label.
labelsstring[]NoExact full labels, ignoring case.
metrcIdsinteger[]No
statusesenum[]
ACTIVEONHOLDFINISHEDDISCONTINUEDTRANSFERRED
NoDefault ACTIVE and ONHOLD. ONHOLD = failed lab testing, pending remediation; TRANSFERRED = transferred out to another license.
importStatusenum
IMPORTABLEUNIMPORTEDIMPORTED
NoIMPORTED = imported into Distru; UNIMPORTED = not in Distru and not ignored for import; IMPORTABLE = UNIMPORTED, active or on hold, with quantity left.
searchMetrcItemstringNoCase-insensitive substring of the Metrc item name.
searchMetrcStrainstringNoCase-insensitive substring of the strain name.
searchMetrcCategorystringNoCase-insensitive substring of the Metrc item category.
metrcLocationIdsstring[]NoMetrc location IDs. Resolve via distru-search-metrc-locations.
labTestingStatesstring[]NoExact Metrc lab testing states, e.g. TestPassed, TestFailed, NotSubmitted.
isTestingSamplebooleanNo
isTradeSamplebooleanNo
isFinishedGoodbooleanNo
sortByobjectNoDefault: most recently modified in Metrc first.
sortBy.directionenum
ASCDESC
Yes
sortBy.fieldenum
INSERTED_ATUPDATED_ATLABEL
YesINSERTED_AT = created in Metrc; UPDATED_AT = last modified in Metrc.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
hasMorebooleanAlways
nextCursorstringCan be absent
totalCountintegerCan be absent
itemsobject[]Always
items[].metrcIdnumberAlways
items[].labelstringAlways
items[].statusenum
ACTIVEDISCONTINUEDFINISHEDINACTIVEONHOLDTRANSFERRED
Always
items[].quantitystringAlways
items[].unitTypeobjectCan be null
items[].unitType.idstringAlways
items[].unitType.namestringAlways
items[].metrcItemobjectAlways
items[].metrcItem.idstringAlways
items[].metrcItem.namestringAlways
items[].metrcItem.categorystringCan be null
items[].strainNamestringCan be null
items[].metrcLocationobjectCan be null
items[].metrcLocation.idstringAlways
items[].metrcLocation.namestringCan be null
items[].labTestingStatestringCan be null
items[].labTestingStateDatestringCan be null
items[].productionBatchNumberstringCan be null
items[].packagedDatestringCan be null
items[].expirationDatestringCan be null
items[].finishedDatestringCan be null
items[].archivedDatestringCan be null
items[].notestringCan be null
items[].sourcePackageLabelsstring[]Always
items[].sourceHarvestNamesstring[]Always
items[].receivedFromManifestNumberstringCan be null
items[].receivedFromLicenseNumberstringCan be null
items[].isTestingSamplebooleanAlways
items[].isTradeSamplebooleanAlways
items[].isProductionBatchbooleanAlways
items[].isFinishedGoodbooleanAlways
items[].lastModifiedDatetimestringCan be null
items[].packageobjectCan be null
items[].package.idstringAlways
items[].package.metrcLabelstringAlways
items[].package.productobjectAlways
items[].package.product.idstringAlways
items[].package.product.namestringAlways
items[].productMostRecentlyMappedToMetrcItemobjectCan be null
items[].productMostRecentlyMappedToMetrcItem.idstringAlways
items[].productMostRecentlyMappedToMetrcItem.namestringAlways
What the AI reads

Searches the packages Metrc holds for one license, as Distru last synced them, whether or not they are in Distru inventory. To bring packages into Distru, use distru-import-metrc-packages; for packages already in inventory, use distru-search-packages. package is the Distru package it was imported as, null when not imported. quantity is Metrc's, in unitType: the Distru unit matching Metrc's unit of measure, null when the company has none. productMostRecentlyMappedToMetrcItem is the product the package's Metrc item was last mapped to on this license, the likely product to import it as; null when never mapped or that product is inactive, deleted or hidden from you.