Assembly

Create a test sample

Pull a quantity from an existing Metrc package into a new test sample package, ready to be sent to a testing lab.

Creates one already-completed assembly with a single input (the quantity drawn from the source package) and a single test sample output — the assembly renders with creation_source: LAB_TESTING and its output with is_test_sample: true. The drawn quantity is consumed from the source package's inventory immediately, and the sample package is produced into inventory at location_id. On success the sample is queued for creation in Metrc as a testing package and synced asynchronously — the Metrc package identifiers are not present in the immediate response, and the source and sample packages are briefly flagged as syncing. Poll GET /public/v1/assemblies/{id} to observe the synced result.

Metrc licenses only, and the license's Metrc facility must be allowed to create test sample packages. The whole operation is atomic: if anything is rejected, nothing is changed.

Required permission: assemblies_permissions_create.

post/public/v1/assemblies/create_test_sample

Request body

batch_numberstring

Distru batch number stored on the sample package. When omitted, copies the source package's batch number; pass null explicitly to leave the sample without one.

compliance_labelstring required

The Metrc tag for the sample package. Must be an available tag in the source package's license.

expiration_datestring

Expiration date reported to Metrc, e.g. "2027-08-19". When omitted, copies the source package's expiration date; pass null explicitly to leave the sample without one.

input_compliance_quantitynumber required

Amount drawn from the source package, in the source package's compliance unit. Must be > 0.

lab_test_batchesstring[]

The Metrc lab test batches to assign to the sample, by exact name. Valid names depend on the license and the sample item's Metrc product category — list them with GET /public/v1/metrc/lab-test-batches, which groups them by item category and marks the ones Metrc requires. Every required: true batch must be included; an unknown or disallowed name is rejected. Omit entirely when the license's facility does not use package sample lab test batches. At most 200 items.

location_idstring

The location ID the sample package is produced into. Must be in the same Metrc license as the source package. Defaults to the source package's location when omitted or null.

metrc_item_idinteger

The Metrc item id for the sample. Required unless use_same_item is true, and must be omitted when it is. Must exist in the source package's Metrc license.

metrc_location_idinteger

The Metrc ID of the Metrc location the sample package will be created in. Only applicable if the license uses Metrc locations. Defaults to the source package's Metrc location when omitted or null.

metrc_notesstring

Notes sent to Metrc as the sample package's note when it is created (max 255 characters).

output_compliance_quantitynumber

Size of the test sample package, in the sample's compliance unit (the source unit when use_same_item is true, otherwise the unit of metrc_item_id). Must be > 0. Defaults to input_compliance_quantity when omitted or null.

package_datestring

The sample package's packaged date. Defaults to today when omitted.

product_idstring

The sample's product ID. Must be package-tracked. Defaults to the source package's product when omitted or null.

source_package_idstring required

The package to pull the sample from. Must be package-tracked and in a Metrc license. An ID that doesn't exist for your company returns 404.

use_same_itemboolean

When true, the sample package reuses the source package's Metrc item and metrc_item_id must be omitted.

Response

The created assembly

Changes

Changed in 1 of the 2 revisions of this API.1