Get a purchase order
distru-get-purchase-orderReadGets one purchase order (a purchase from a supplier) by ID: header detail with supplier, owner, intake, billing and supplier locations, amount paid and the matched compliance manifest number.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Resolve via distru-search-purchase-orders. |
| includeOrderItems | boolean | No | Line quantity, receivedQuantity and price (cost per unit) are in product.unitType; receivedQuantity is 0 before PARTIALLY_RECEIVED and equals quantity once COMPLETED; a line has a package only once the purchase is matched to a compliance transfer. |
| includeOrderCharges | boolean | No | Charges, discounts and taxes. |
| includePayments | boolean | No | Non-voided payments, oldest paymentDate first; they sum to paid. Their ids work with distru-get-purchase-payment and distru-void-purchase-payment. paymentMethod null when the method was deleted. Their QuickBooks fields read as on distru-get-purchase-payment. |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence | Description |
|---|---|---|---|
| purchaseOrder | object | Null or absent | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object[] | Always | |
| purchaseOrder. | object | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | enumCHECKBOXDATEDROPDOWNTEXT | Always | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | enumCOMPLETEDDELIVERINGDRAFTPARTIALLY_RECEIVEDPENDINGPROCESSING | Always | |
| purchaseOrder. | enumNOT_PAIDOVER_PAIDPAIDPARTIALLY_PAID | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Null or absent | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Null or absent | |
| purchaseOrder. | object | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | enumDELETED_IN_QBOERRORNOT_SYNCEDPARTIALLY_SYNCEDPENDINGSYNCED | Can be null | |
| purchaseOrder. | object[] | Can be absent | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | object[] | Can be absent | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | boolean | Always | |
| purchaseOrder. | object[] | Can be absent | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | enumPOSTEDVOIDED | Always | VOIDED payments no longer count toward paid. |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Always | Dollars, as recorded; a void leaves it unchanged. |
| purchaseOrder. | object | Can be null | Null once the method is deleted. |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Can be null | |
| purchaseOrder. | string | Can be null | Full name of the QuickBooks Bank or Credit Card account the payment was made from. Null when it has none or the account is not in the QuickBooks cache. |
| purchaseOrder. | string | Can be null | Its QuickBooks bill payment ID. |
| purchaseOrder. | enumDELETED_IN_QBOERRORNOT_SYNCEDPARTIALLY_SYNCEDPENDINGSYNCED | Can be null | Null unless the company's QuickBooks module is on and connected. PENDING and ERROR are its latest sync's outcome and win over the rest. A payment syncs only once its purchase has a QuickBooks bill and purchase payment sync is on, so NOT_SYNCED is normal before that. |
| purchaseOrder. | string | Always | |
| purchaseOrder. | string | Always | Also moves on a void. |
| purchaseOrder. | string | Can be null | Manifest number of the matched compliance transfer; null when unmatched. |
What the AI reads
Gets one purchase order (a purchase from a supplier) by ID: header detail with supplier, owner, intake, billing and supplier locations, amount paid and the matched compliance manifest number. Line items, charges and payments are left out unless you pass includeOrderItems, includeOrderCharges or includePayments. Use for a specific purchase after resolving its ID via distru-search-purchase-orders; to browse purchases use distru-search-purchase-orders; for payments across purchases, distru-search-purchase-payments. intakeLocation is where the inventory is received into; supplierLocation is where the items ship from, null when unset or when the supplier uses Distru itself. A soft-deleted location is null. description is the purchase notes. paid is the sum of the non-voided payments. complianceManifestNumber is null when unmatched. Drafts are returned too (status DRAFT) and may lack supplier, locations, dates and lines. qbBillId is its QuickBooks bill ID. qbSyncStatus is null unless the company's QuickBooks module is on and connected; PENDING and ERROR are its latest sync's outcome and win over the rest; DELETED_IN_QBO = the bill was deleted in QuickBooks; NOT_SYNCED = it has no QuickBooks bill. Bill payment syncs don't count. qbSyncStatus ERROR: distru-search-quickbooks-activities with purchaseOrderIds gives the error. ERROR or NOT_SYNCED: distru-sync-to-quickbooks pushes it, or says why it can't. Null if no purchase matches the ID; a permission error if the caller can't view it.