Get a sales order
distru-get-sales-orderReadGets one sales order by ID: header detail, customer, owner, shipping and billing locations, menu, the compliance license stock was drawn from and the compliance manifest number.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Resolve via distru-search-sales-orders. |
| includeInvoices | boolean | No | Linked invoice summaries. |
| includeOrderItems | boolean | No | |
| includeOrderItemCostItems | boolean | No | costItems on each line item; returns the line items even without includeOrderItems. costItems: the costs that make up the line item'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 line item; 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 line item, 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. |
| includeOrderItemPriceTiers | boolean | No | priceTierMode and priceTier on each line item; returns the line items even without includeOrderItems. priceTier is the snapshot of the tier applied, null when none; isLive false when the tier was edited or deleted since. pricing applies value to priceBase (PERCENT_OFF: percent off, AMOUNT_OFF: subtracted, FLAT_PRICE: replaces it); price is the result. priceTierMode OVERRIDE: line locked to priceTier; NONE: takes no tier, keeps its own price; AUTO: no tier applied when the order was last saved. |
| includeOrderCharges | boolean | No | Charges, discounts and taxes. |
| includeOriginalOrders | boolean | No | Orders merged into this one, when it is a combined order. |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence | Description |
|---|---|---|---|
| salesOrder | object | Null or absent | |
| salesOrder. | string | Always | |
| salesOrder. | object[] | Always | |
| salesOrder. | object | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | enumCHECKBOXDATEDROPDOWNTEXT | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Can be null | |
| salesOrder. | object | Null or absent | |
| salesOrder. | string | Always | |
| salesOrder. | string | Null or absent | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | object | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object[] | Can be absent | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object[] | Can be absent | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | enumNOT_PAIDOVER_PAIDPAIDPARTIALLY_PAID | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object[] | Can be absent | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | boolean | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Can be null | |
| salesOrder. | object | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | enumAUTONONEOVERRIDE | Null or absent | |
| salesOrder. | object[] | Null or absent | |
| salesOrder. | string | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Always | |
| salesOrder. | enumASSEMBLYBIOTRACK_ADJUSTMENTBIOTRACK_MANIFEST_RECEIVEDBREAKDOWNCOST_ENTRYMETRC_ADJUSTMENTMETRC_TRANSFER_RECEIVEDOTHERPACKAGE_IMPORTPLANT_BATCH_PACKAGINGPURCHASE_ORDERSTOCK_ADJUSTMENT | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Can be null | |
| salesOrder. | object | Always | |
| salesOrder. | enumPACKAGEBATCHPRODUCTHARVESTPLANTPLANT_BATCHMULTIPLE_PLANTSNONE | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Can be null | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | object | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Can be null | |
| salesOrder. | object | Null or absent | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | object | Always | |
| salesOrder. | enumAMOUNT_OFFFLAT_PRICEPERCENT_OFF | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | boolean | Always | |
| salesOrder. | object[] | Can be absent | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Always | |
| salesOrder. | string | Can be null | |
| salesOrder. | string | Always | |
| salesOrder. | boolean | Always | |
| salesOrder. | string | Can be null | Manifest number of the matched compliance transfer; null when unmatched. |
What the AI reads
Gets one sales order by ID: header detail, customer, owner, shipping and billing locations, menu, the compliance license stock was drawn from and the compliance manifest number. Line items, charges and linked invoices are left out unless you pass includeOrderItems, includeOrderCharges or includeInvoices; includeOrderItemCostItems and includeOrderItemPriceTiers add each line's cost breakdown and price tier. Use for a specific order after resolving its ID via distru-search-sales-orders or distru-report-sales-orders; to browse orders use distru-search-sales-orders, for invoice line items and charges use distru-get-invoice, and for price tiers applied across many orders distru-report-sales-orders with rowsPer LINE_ITEM. cost is null unless the caller may view costs; revenue is not permission-gated and is null until the order has fulfilled stock, so a null there means nothing has shipped, not that access was denied. Line item cost and revenue follow the same rules; the order cost can leave out sample lines (a company setting), so line costs may not add up to it. Line quantity and price are in product.unitType. status is a human-readable string and does not match the SalesOrderStatus enum casing. combinedOrder is the order this one was merged into. Null if no order matches the ID; a permission error if the caller can't view it.