Get Metrc packages
Changed onGet the Metrc packages Distru caches from Metrc across your licenses, filtered by various attributes. Results are ordered by Metrc's package id ascending and scoped to the company that owns the API key. Only the current version of each package is returned.
Each row mirrors a package as it exists in Metrc — label, quantity, item, location, testing and remediation state — plus what Distru knows around it: a derived status that reflects the package's real state (Metrc's raw active/inactive buckets don't), the company unit_type matching the package's Metrc unit of measure, the full cached Metrc item, and package, the Distru package created when this Metrc package was imported (null when it hasn't been imported). Use is_importable=true to list exactly the packages you could import or receive into Distru.
This is a read-only cache: it does not create, move, or adjust packages in Metrc. Data is eventually consistent — changes synced from Metrc can take up to ~1 second to appear here.
Request
- Base URLhttps://app.distru.com
- AuthHTTP bearer
Query parameters
Filter to packages belonging to this license, given as a Distru license resource ID (as returned by the licenses endpoint — not a Metrc or state license number). Omit to return packages across all of the company's licenses; a license ID that doesn't belong to your company simply returns no packages.
Filter to packages belonging to the Metrc license with this license number (exact match, not a substring). A convenience alternative to license_id; combining the two is a 400. Unlike license_id, an unknown value is rejected — if your company has no Metrc license with this number the request fails with a 400.
Filter to the single package whose full 24-character Metrc tag label equals this value exactly. Case-sensitive and matched verbatim; a partial or lowercase value returns nothing. Use search for substring matching.
Filter to packages whose Metrc tag label contains this value (case-insensitive substring match). Must be at least 4 characters; a shorter value is a 400. A 24-character value is matched as an exact full label.
Filter to packages in any of these derived statuses (multiple values are OR-ed; the same values are returned as each package's status): • ACTIVE — live at the facility • ONHOLD — on administrative hold in Metrc • TRANSFERRED — shipped away on a transfer • FINISHED — zeroed out and finished • DISCONTINUED — discontinued in Metrc Omit to return every status.
When true, keep only packages that can currently be imported into Distru: positive quantity, active or on hold in Metrc, not yet imported, and not marked ignore-for-import in Distru. false and omitted behave the same (no filter).
Filter to packages whose Metrc item category name exactly matches one of the given values (OR semantics, case-sensitive — the item.category_name values returned by GET /public/v1/metrc/items). An empty list is ignored. At most 200 values may be given.
Filter to packages whose Metrc item name exactly matches one of the given values (OR semantics, case-sensitive). An empty list is ignored. At most 200 values may be given.
Filter to packages whose Metrc strain name exactly matches one of the given values (OR semantics, case-sensitive). An empty list is ignored. At most 200 values may be given.
Filter to packages with these Metrc package identifiers — Metrc's own integer IDs (the id in the response), not Distru IDs. Matches a package if its Metrc ID equals any of the listed values (OR semantics). An empty list is ignored. At most 200 IDs may be given.
Filter by when Distru last fetched the package from Metrc (the fetched_datetime in the response). Accepts a comma-separated from,to range (ISO-8601 UTC); either side may be omitted, e.g. ,2022-07-10T00:00:00Z returns packages last fetched on or before that time.
Page selector. Page size is fixed by the server; paginate by following the next_page URL in each response rather than building page selectors yourself — it is null on the last page. next_page uses page[after]=<cursor>, an opaque token marking where the next page resumes; pass it back exactly as given, and only to the endpoint that issued it. This is seek-based, so every page stays fast no matter how deep you page.
Response
A list of Metrc packages
Example response
{
"data": [
{
"item": {
"license": {
"id": "02c88a3f-d759-4973-88f9-60049d682524",
"license_number": "C11-1234567890"
}
},
"license": {
"id": "02c88a3f-d759-4973-88f9-60049d682524",
"license_number": "C11-1234567890"
}
}
]
}Changes
- info
endpoint added
- info