Import Metrc packages

distru-import-metrc-packagesWrite

Brings Metrc packages into Distru inventory as Distru packages, all-or-nothing: each package's full Metrc quantity is added as stock at its location.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
packagesobject[]Yes
packages[].metrcPackageLabelstringYesFull Metrc tag label, ignoring case.
packages[].productIdstringNoPackage-tracked product whose unit type measures like the package's unit (weight, volume or count). Omit to use the package's productMostRecentlyMappedToMetrcItem, else a product named like the Metrc item, else the product mapped to the most similar Metrc item name; the package is rejected when none matches or the match measures differently. Resolve via distru-search-products.
packages[].locationIdstringNoOne of the license's locations. Default the license's intake location. Resolve via distru-search-locations.
packages[].costPerUnitstring or numberNoDollars per unit of the package, in its Metrc unit. Needs the "Apply costs on package import" permission. Required on every package when the company requires a cost on intake.
packages[].batchNumberstringNoThe package's own free-text lot label, not a Distru batch.
packages[].expirationDatestringNo

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
packagesobject[]Always
packages[].idstringAlways
packages[].customFieldsobject[]Always
packages[].customFields[].customFieldobjectAlways
packages[].customFields[].customField.idstringAlways
packages[].customFields[].customField.namestringAlways
packages[].customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
packages[].customFields[].valuestringCan be null
packages[].metrcLabelstringAlways
packages[].complianceTypeenum
BIOTRACKMETRCNONE
Always
packages[].metrcIdnumberCan be null
packages[].complianceProductNamestringCan be null
packages[].complianceStrainNamestringCan be null
packages[].distruStatusenum
ACTIVEASSEMBLINGDESTROYEDDISCONTINUEDFINISHEDON_HOLDRETURNINGSELLINGSOLDTRANSFERRED
Always
packages[].isActivebooleanAlways
packages[].metrcStatusenum
ACTIVEDISCONTINUEDFINISHEDONHOLDTRANSFERRED
Can be null
packages[].metrcProductionBatchNumberstringCan be null
packages[].metrcSourcePackageLabelsstring[]Can be null
packages[].syncingbooleanAlways
packages[].syncingReasonenum
ASSEMBLY_INPUTASSEMBLY_OUTPUTCOMPLIANCE_TRANSFERCREATE_HARVEST_PACKAGECREATE_PLANT_BATCHES_FROM_PACKAGEDESTROY_PACKAGEFINISH_PACKAGESALES_ORDERSTOCK_ADJUSTMENTUNFINISH_PACKAGEUNKNOWN
Can be null
packages[].batchNumberstringCan be null
packages[].descriptionstringCan be null
packages[].compliancePackagedDatestringCan be null
packages[].harvestDatestringCan be null
packages[].expirationDatestringCan be null
packages[].finishedAtstringCan be null
packages[].insertedAtstringAlways
packages[].updatedAtstringAlways
packages[].isTestSamplebooleanAlways
packages[].isTradeSamplebooleanAlways
packages[].isFinishedGoodbooleanCan be null
packages[].labTestingStateenum
FAILEDNOT_TESTEDPASSEDPENDING
Always
packages[].labTestingStateDatestringCan be null
packages[].quantitystringAlways
packages[].quantityActivestringAlways
packages[].quantityAssemblingstringAlways
packages[].quantityInMetrcstringCan be null
packages[].quantityCoststringCan be null
packages[].unitTypeobjectAlways
packages[].unitType.idstringAlways
packages[].unitType.namestringAlways
packages[].productobjectAlways
packages[].product.idstringAlways
packages[].product.namestringAlways
packages[].product.skustringAlways
packages[].batchobjectAlways
packages[].batch.idstringAlways
packages[].batch.namestringAlways
packages[].locationobjectAlways
packages[].location.idstringAlways
packages[].location.namestringAlways
packages[].licenseobjectAlways
packages[].license.idstringAlways
packages[].license.licenseNumberstringAlways
packages[].activeSalesOrderobjectCan be null
packages[].activeSalesOrder.idstringAlways
packages[].activeSalesOrder.orderNumberstringAlways
packages[].primaryTestResultobjectCan be null
packages[].primaryTestResult.idstringAlways
packages[].primaryTestResult.namestringAlways
packages[].primaryTestResult.labNamestringCan be null
packages[].primaryTestResult.releaseDatestringCan be null
packages[].primaryTestResult.thcPercentagestringCan be null
packages[].primaryTestResult.thcPercentageTotalstringCan be null
packages[].primaryTestResult.cbdPercentagestringCan be null
packages[].primaryTestResult.cbdPercentageTotalstringCan be null
What the AI reads

Brings Metrc packages into Distru inventory as Distru packages, all-or-nothing: each package's full Metrc quantity is added as stock at its location. Sends nothing to Metrc. Packages must be active or on hold in Metrc, have quantity left, all be on one license, and not already be imported; find them with distru-search-metrc-packages (importStatus IMPORTABLE). Returns the Distru packages as distru-get-package does.