Get Metrc lab test batches
Changed onGet the Metrc lab test batches that can be assigned to a test sample package created under the given license, grouped by Metrc item category. Lab test batches are defined by the state in Metrc and vary per license and item category; Distru caches them from Metrc, so this is a read-only view of that cache.
data is an object with one key per Metrc item category defined for the license (the category_name values returned by GET /public/v1/metrc/items), each holding the batches assignable to a test sample of that category. A batch not restricted to specific categories appears under every category. A category with no assignable batches maps to an empty list.
Use this before calling POST /public/v1/assemblies/create_test_sample: the sample's lab_test_batches values must come from the names listed under the sample item's category, and every batch listed there with required: true must be included or the test sample is rejected.
The response is complete (not paginated). data is an empty object when the license's Metrc facility type does not use package sample lab test batches — in that case lab_test_batches must be omitted when creating a test sample.
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
The license whose lab test batches to return, given as a Distru license resource ID (as returned by the licenses endpoint — not a Metrc or state license number). A license ID that doesn't belong to your company simply returns an empty object. Exactly one of license_id or license_number must be given.
The license whose lab test batches to return, given as its license number (exact match, not a substring). A convenience alternative to license_id — exactly one of the two must be given; combining them 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.
Response
Metrc lab test batches grouped by item category
Changes
- info
endpoint added
- info