Split a package

distru-split-packageWriteMetrcTrym

Splits part of a package into new packages, each with its own Metrc tag. Claims those tags in Trym when your company is connected to it.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
packageIdstringYesThe source: active, not syncing, on hold or on an order. Resolve via distru-search-packages.
outputsobject[]YesOne new package each.
outputs[].metrcLabelstringYesAn unused Metrc package tag on the source's license. Resolve via distru-search-available-metrc-tags (licenseId).
outputs[].quantitystring or numberYesGreater than 0, in the source package's unit type; the same amount leaves the source.
outputs[].locationIdstringNoDefaults to the source's. On the source's license. Resolve via distru-search-locations.
outputs[].metrcLocationIdstringNoMetrc room. Defaults to the source's where the state uses Metrc rooms. Resolve via distru-search-metrc-locations (licenseId).
outputs[].productIdstringNoDefaults to the source's. Resolve via distru-search-products.
outputs[].metrcItemIdstringNoDefaults to the source's Metrc item. Resolve via distru-search-metrc-items.
outputs[].productionBatchNumberstringNoMarks the output a Metrc production batch, so set it only when it is one.
outputs[].batchNumberstringNoThe package's free-text batch number, not a Distru batch. Defaults to the source's.
outputs[].packageDatestringNoYYYY-MM-DD. Defaults to today.
outputs[].expirationDatestringNoDefaults to the source's. ISO 8601 with a UTC offset, e.g. "2026-09-01T00:00:00-07:00"; the company timezone is on distru-get-me.
outputs[].notestringNoPackage note sent to Metrc.
outputs[].copyCustomFieldsbooleanNoCopies the source's custom field values.
outputs[].costsobject[]NoAdded to the cost carried over from the source.
outputs[].costs[].costTypeIdstringYesResolve via distru-search-lookups (type COST_TYPE).
outputs[].costs[].quantitystring or numberYesGreater than 0, in the cost type's unit type.
outputs[].costs[].costPerUnitstring or numberNoDollars per unit of the cost type's unit type. Defaults to the cost type's costPerUnit; refused when the cost type's allowInlineEdits is false.
outputs[].costs[].descriptionstringNo

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
assemblyIdstringAlways
packagesobject[]Always
packages[].idstringAlways
packages[].metrcLabelstringAlways
packages[].quantitystringAlways
packages[].locationobjectAlways
packages[].location.idstringAlways
packages[].location.namestringAlways
packages[].productobjectAlways
packages[].product.idstringAlways
packages[].product.namestringAlways
sourcePackageobjectAlways
sourcePackage.idstringAlways
sourcePackage.metrcLabelstringAlways
sourcePackage.quantitystringAlways
What the AI reads

Splits part of one package into new packages, completed at once: each output takes its quantity from the source and becomes a new package with its own Metrc label, at the source's location unless locationId is set (same license). Each new package is then created in Metrc in the background; follow it with distru-search-metrc-activities. Not idempotent, but a used label is refused, so a repeated call fails. Returns the new packages and the source's remaining quantity, in the package's unit type.