Search sales orders
distru-search-sales-ordersReadSearches sales orders — one row per order, not line items.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Default: 10 |
| cursor | string | No | nextCursor of the previous call; keep the other arguments unchanged. |
| batchIds | string[] | No | Line items filled by these batches. Resolve via distru-search-batches. |
| customerIds | string[] | No | Resolve via distru-search-companies. |
| deliveryDateAfter | string | No | Inclusive. YYYY-MM-DD (start of day, company timezone) or ISO 8601 with a UTC offset. |
| deliveryDateBefore | string | No | Inclusive. YYYY-MM-DD (end of day, company timezone) or ISO 8601 with a UTC offset. |
| dueDateAfter | string | No | Payment due date, inclusive. YYYY-MM-DD (start of day, company timezone) or ISO 8601 with a UTC offset. |
| dueDateBefore | string | No | Payment due date, inclusive. YYYY-MM-DD (end of day, company timezone) or ISO 8601 with a UTC offset. |
| ids | string[] | No | |
| menuIds | string[] | No | Menus the orders were placed from. Resolve via distru-search-menus. |
| orderDateAfter | string | No | Inclusive. YYYY-MM-DD (start of day, company timezone) or ISO 8601 with a UTC offset. |
| orderDateBefore | string | No | Inclusive. YYYY-MM-DD (end of day, company timezone) or ISO 8601 with a UTC offset. |
| ownerIds | string[] | No | Sales rep. Resolve via distru-search-users. |
| paymentStatus | enum[]NOT_PAIDOVERPAIDPAIDPAYING | No | |
| productIds | string[] | No | Any line item of these products. Resolve via distru-search-products. |
| taxIds | string[] | No | Any of these taxes. Resolve via distru-search-lookups (type TAX). |
| search | string | No | Case-insensitive substring of order number, customer name, LeafLink short ID or matched compliance manifest number (manifest only for 4+ char terms). Ranked by order number similarity; sortBy ignored. |
| status | enum[]CANCELEDCOMPLETEDDELIVEREDDELIVERINGMERGEDPENDINGPROCESSINGREADY_TO_SHIP | No | |
| totalGreaterThanOrEqualTo | number | No | Dollars. |
| totalLessThanOrEqualTo | number | No | Dollars. |
| customFields | object[] | No | Set one of contains, anyOf or onOrAfter/onOrBefore per entry. Records with no value for the field never match. |
| customFields[]. | string | Yes | Resolve via distru-search-custom-fields. |
| customFields[]. | string | No | TEXT: case-insensitive substring. |
| customFields[]. | string[] | No | DROPDOWN, CHECKBOX: any of these options, case-sensitive. |
| customFields[]. | string | No | DATE: YYYY-MM-DD, company timezone. |
| customFields[]. | string | No | DATE: YYYY-MM-DD, company timezone. |
| sortBy | object | No | Default UPDATED_AT DESC; DUE_DATE is the payment due date. Ignored when search is set. |
| sortBy. | enumASCDESC | Yes | |
| sortBy. | enumDUE_DATEINSERTED_ATORDER_DATEORDER_NUMBERTOTALUPDATED_AT | Yes |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence | Description |
|---|---|---|---|
| hasMore | boolean | Always | |
| nextCursor | string | Can be absent | |
| totalCount | integer | Can be absent | |
| items | object[] | Always | |
| items[]. | string | Always | |
| items[]. | object[] | Always | |
| items[]. | object | Always | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | enumCHECKBOXDATEDROPDOWNTEXT | Always | |
| items[]. | string | Can be null | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Can be null | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | object | Null or absent | |
| items[]. | string | Always | |
| items[]. | string | Null or absent | |
| items[]. | object | Can be null | |
| items[]. | string | Always | |
| items[]. | object | Always | |
| items[]. | string | Always | |
| items[]. | object | Can be null | |
| items[]. | string | Always | |
| items[]. | string | Always | |
| items[]. | string | Can be null | Manifest number of the matched compliance transfer; null when unmatched. |
What the AI reads
Searches sales orders — one row per order, not line items. Use it to find a customer or owner from an order, or to check order status and totals live. For one order's line items and charges, use distru-get-sales-order; for a flattened report with revenue/source breakdowns, distru-report-sales-orders with rowsPer ORDER; for line items across orders, the same report with rowsPer LINE_ITEM. complianceManifestNumber is the matched compliance manifest number, null when unmatched. The returned status is a human-readable string (e.g. "Ready to ship") that does not match the casing of the status filter enum — do not compare them directly.