Get an assembly

distru-get-assemblyRead

Gets one assembly by ID: header detail with kind, status, cost, license and owner.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
idstringYesResolve via distru-search-assemblies.
includeAssemblyLinesbooleanNoOutput lines, each with the input lines consumed into it.
includeOutputCostItemsbooleanNocostItems on each output line; returns the output lines even without includeAssemblyLines, not their inputs. costItems: the costs that make up the output's cost, oldest first; null when none is recorded or the caller cannot view cost details. Costs carry over from inputs, so recordedOn can be an upstream package, batch, product, harvest, plant or plant batch rather than this output; MULTIPLE_PLANTS is a cost split over several plants or plant batches, NONE one tied to no inventory. quantity is the share that went into this output, out of costQuantity; both in unitType. totalCost is quantity × costPerUnit; both null when no cost per unit is recorded or the caller cannot see it. costType is null for purchase costs and costs Distru records itself; origin.purchaseOrder and origin.assembly are null when team restrictions hide them.
includeOutputAddedCostsbooleanNoaddedCosts on each output line: costs added in this assembly, e.g. labor or packaging. Returns the output lines even without includeAssemblyLines, not their inputs. quantity is in unitType (the cost type's, else the output product's). costPerUnit and totalCost null when no cost per unit recorded or caller can't see it. Once the output is completed these are also in its costItems with origin.type ASSEMBLY; never add the two.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresence
assemblyobjectCan be null
assembly.idstringAlways
assembly.customFieldsobject[]Always
assembly.customFields[].customFieldobjectAlways
assembly.customFields[].customField.idstringAlways
assembly.customFields[].customField.namestringAlways
assembly.customFields[].customField.fieldTypeenum
CHECKBOXDATEDROPDOWNTEXT
Always
assembly.customFields[].valuestringCan be null
assembly.numberstringAlways
assembly.statusenum
COMPLETEDPENDING
Always
assembly.complianceTypeenum
BIOTRACKMETRCNONE
Always
assembly.descriptionstringCan be null
assembly.coststringCan be null
assembly.estimatedStartDatestringCan be null
assembly.estimatedWorkMinutesnumberCan be null
assembly.completedAtstringCan be null
assembly.createdDatestringAlways
assembly.updatedDatestringAlways
assembly.licenseobjectCan be null
assembly.license.idstringAlways
assembly.license.licenseNumberstringAlways
assembly.ownerobjectCan be null
assembly.owner.idstringAlways
assembly.owner.emailstringAlways
assembly.owner.profileobjectAlways
assembly.owner.profile.fullNamestringAlways
assembly.kindenum
MANUFACTURINGPACKAGE_SPLITTEST_SAMPLESALES_ORDER_REPACKAGE
Always
assembly.assemblyOutputsobject[]Can be absent
assembly.assemblyOutputs[].idstringAlways
assembly.assemblyOutputs[].statusenum
COMPLETEDPENDING
Always
assembly.assemblyOutputs[].quantitystringAlways
assembly.assemblyOutputs[].metrcLabelstringCan be null
assembly.assemblyOutputs[].batchNumberstringCan be null
assembly.assemblyOutputs[].expirationDatestringCan be null
assembly.assemblyOutputs[].packageDatestringCan be null
assembly.assemblyOutputs[].productionBatchNumberstringCan be null
assembly.assemblyOutputs[].productobjectAlways
assembly.assemblyOutputs[].product.idstringAlways
assembly.assemblyOutputs[].product.namestringAlways
assembly.assemblyOutputs[].product.unitTypeobjectAlways
assembly.assemblyOutputs[].product.unitType.idstringAlways
assembly.assemblyOutputs[].product.unitType.namestringAlways
assembly.assemblyOutputs[].batchobjectCan be null
assembly.assemblyOutputs[].batch.idstringAlways
assembly.assemblyOutputs[].batch.namestringAlways
assembly.assemblyOutputs[].locationobjectCan be null
assembly.assemblyOutputs[].location.idstringAlways
assembly.assemblyOutputs[].location.namestringAlways
assembly.assemblyOutputs[].packageobjectCan be null
assembly.assemblyOutputs[].package.idstringAlways
assembly.assemblyOutputs[].package.metrcLabelstringAlways
assembly.assemblyOutputs[].packageUnitTypeobjectCan be null
assembly.assemblyOutputs[].packageUnitType.idstringAlways
assembly.assemblyOutputs[].packageUnitType.namestringAlways
assembly.assemblyOutputs[].complianceQuantitystringCan be null
assembly.assemblyOutputs[].assemblyInputsobject[]Can be absent
assembly.assemblyOutputs[].assemblyInputs[].idstringAlways
assembly.assemblyOutputs[].assemblyInputs[].statusenum
COMPLETEDDRAFTPENDING
Always
assembly.assemblyOutputs[].assemblyInputs[].quantitystringAlways
assembly.assemblyOutputs[].assemblyInputs[].productobjectAlways
assembly.assemblyOutputs[].assemblyInputs[].product.idstringAlways
assembly.assemblyOutputs[].assemblyInputs[].product.namestringAlways
assembly.assemblyOutputs[].assemblyInputs[].product.unitTypeobjectAlways
assembly.assemblyOutputs[].assemblyInputs[].product.unitType.idstringAlways
assembly.assemblyOutputs[].assemblyInputs[].product.unitType.namestringAlways
assembly.assemblyOutputs[].assemblyInputs[].batchobjectCan be null
assembly.assemblyOutputs[].assemblyInputs[].batch.idstringAlways
assembly.assemblyOutputs[].assemblyInputs[].batch.namestringAlways
assembly.assemblyOutputs[].assemblyInputs[].locationobjectCan be null
assembly.assemblyOutputs[].assemblyInputs[].location.idstringAlways
assembly.assemblyOutputs[].assemblyInputs[].location.namestringAlways
assembly.assemblyOutputs[].assemblyInputs[].packageobjectCan be null
assembly.assemblyOutputs[].assemblyInputs[].package.idstringAlways
assembly.assemblyOutputs[].assemblyInputs[].package.metrcLabelstringAlways
assembly.assemblyOutputs[].assemblyInputs[].package.unitTypeobjectAlways
assembly.assemblyOutputs[].assemblyInputs[].package.unitType.idstringAlways
assembly.assemblyOutputs[].assemblyInputs[].package.unitType.namestringAlways
assembly.assemblyOutputs[].assemblyInputs[].complianceQuantitystringCan be null
assembly.assemblyOutputs[].costItemsobject[]Null or absent
assembly.assemblyOutputs[].costItems[].namestringAlways
assembly.assemblyOutputs[].costItems[].descriptionstringCan be null
assembly.assemblyOutputs[].costItems[].costTypeobjectCan be null
assembly.assemblyOutputs[].costItems[].costType.idstringAlways
assembly.assemblyOutputs[].costItems[].costType.namestringAlways
assembly.assemblyOutputs[].costItems[].createdByobjectCan be null
assembly.assemblyOutputs[].costItems[].createdBy.idstringAlways
assembly.assemblyOutputs[].costItems[].createdBy.fullNamestringAlways
assembly.assemblyOutputs[].costItems[].insertedAtstringAlways
assembly.assemblyOutputs[].costItems[].originobjectAlways
assembly.assemblyOutputs[].costItems[].origin.typeenum
ASSEMBLYBIOTRACK_ADJUSTMENTBIOTRACK_MANIFEST_RECEIVEDBREAKDOWNCOST_ENTRYMETRC_ADJUSTMENTMETRC_TRANSFER_RECEIVEDOTHERPACKAGE_IMPORTPLANT_BATCH_PACKAGINGPURCHASE_ORDERSTOCK_ADJUSTMENT
Always
assembly.assemblyOutputs[].costItems[].origin.purchaseOrderobjectCan be null
assembly.assemblyOutputs[].costItems[].origin.purchaseOrder.idstringAlways
assembly.assemblyOutputs[].costItems[].origin.purchaseOrder.purchaseNumberstringAlways
assembly.assemblyOutputs[].costItems[].origin.assemblyobjectCan be null
assembly.assemblyOutputs[].costItems[].origin.assembly.idstringAlways
assembly.assemblyOutputs[].costItems[].origin.assembly.numberstringAlways
assembly.assemblyOutputs[].costItems[].origin.breakdownobjectCan be null
assembly.assemblyOutputs[].costItems[].origin.breakdown.breakdownNumberstringCan be null
assembly.assemblyOutputs[].costItems[].recordedOnobjectAlways
assembly.assemblyOutputs[].costItems[].recordedOn.typeenum
PACKAGEBATCHPRODUCTHARVESTPLANTPLANT_BATCHMULTIPLE_PLANTSNONE
Always
assembly.assemblyOutputs[].costItems[].recordedOn.productobjectCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.product.idstringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.product.namestringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.product.skustringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.packageobjectCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.package.idstringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.package.metrcLabelstringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.batchobjectCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.batch.idstringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.batch.namestringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.harvestobjectCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.harvest.namestringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.plantobjectCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.plant.labelstringCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.plant.strainNamestringCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.plantBatchobjectCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.plantBatch.namestringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.plantBatch.strainNamestringCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.multiplePlantsobjectCan be null
assembly.assemblyOutputs[].costItems[].recordedOn.multiplePlants.summarystringAlways
assembly.assemblyOutputs[].costItems[].recordedOn.multiplePlants.detailsstringAlways
assembly.assemblyOutputs[].costItems[].quantitystringAlways
assembly.assemblyOutputs[].costItems[].costQuantitystringAlways
assembly.assemblyOutputs[].costItems[].unitTypeobjectAlways
assembly.assemblyOutputs[].costItems[].unitType.idstringAlways
assembly.assemblyOutputs[].costItems[].unitType.namestringAlways
assembly.assemblyOutputs[].costItems[].costPerUnitstringCan be null
assembly.assemblyOutputs[].costItems[].totalCoststringCan be null
assembly.assemblyOutputs[].addedCostsobject[]Can be absent
assembly.assemblyOutputs[].addedCosts[].namestringAlways
assembly.assemblyOutputs[].addedCosts[].descriptionstringCan be null
assembly.assemblyOutputs[].addedCosts[].costTypeobjectCan be null
assembly.assemblyOutputs[].addedCosts[].costType.idstringAlways
assembly.assemblyOutputs[].addedCosts[].costType.namestringAlways
assembly.assemblyOutputs[].addedCosts[].insertedAtstringAlways
assembly.assemblyOutputs[].addedCosts[].quantitystringAlways
assembly.assemblyOutputs[].addedCosts[].unitTypeobjectAlways
assembly.assemblyOutputs[].addedCosts[].unitType.idstringAlways
assembly.assemblyOutputs[].addedCosts[].unitType.namestringAlways
assembly.assemblyOutputs[].addedCosts[].costPerUnitstringCan be null
assembly.assemblyOutputs[].addedCosts[].totalCoststringCan be null
What the AI reads

Gets one assembly by ID: header detail with kind, status, cost, license and owner. Output lines and the input lines consumed into them are left out unless you pass includeAssemblyLines; includeOutputCostItems and includeOutputAddedCosts add each output's cost breakdown and the costs added on it in this assembly. Use for a specific assembly after resolving its ID via distru-search-assemblies; to browse assemblies use distru-search-assemblies. cost is null when the caller lacks permission to view costs. Line quantity is in the product's unit type; complianceQuantity is the quantity in the package's unit type (input package.unitType, output packageUnitType) as tracked in Metrc, null when complianceType is NONE. An output's batchNumber is the batchNumber its package gets (for a batch-tracked product, its batch's), not the linked Distru batch, whose name is batch.name. Null if no assembly matches the ID; a permission error if the caller can't view it.