Order fulfillment report

distru-report-order-fulfillmentRead

A grid of products by order for a date range, showing how much of each product each order needs.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
customerIdsstring[]NoResolve via distru-search-companies.
locationIdsstring[]NoOrder items fulfilled from these locations. ORed with userIds. Resolve via distru-search-locations.
orderDatetimeobjectNoInclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Defaults to the last 30 days.
orderDatetime.endstringNo
orderDatetime.startstringNo
ownerIdsstring[]NoSales rep owning the order. Resolve via distru-search-users.
productIdsstring[]NoNarrows the orders, not the products: other products on those orders still come back. Resolve via distru-search-products.
searchstringNoCase-insensitive substring of order number, customer name or LeafLink short ID (name skipped under 2 characters).
statusesenum[]
PENDINGPROCESSINGREADY_TO_SHIPDELIVERINGDELIVEREDCOMPLETED
NoDefault: every status listed. Canceled and merged orders are always left out.
userIdsstring[]NoOrder items assigned to these users. ORed with locationIds. Resolve via distru-search-users.
productCategoryIdsstring[]NoProduct category of the rows. ORed with productSubcategoryIds; a listed subcategory of a listed category narrows that category to it. Resolve via distru-search-lookups (type PRODUCT_CATEGORY).
productSubcategoryIdsstring[]NoProduct subcategory of the rows. See productCategoryIds. Resolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories).
productTagIdsstring[]NoAny of these tags on the product. Resolve via distru-search-lookups (type PRODUCT_TAG).
vendorIdsstring[]NoThe vendor set on the product, not the company an order was placed with. Resolve via distru-search-companies.
brandIdsstring[]NoProduct brand of the rows, itself a company. Resolve via distru-search-companies, or read it on a distru-search-products row.
productGroupIdsstring[]NoResolve via distru-search-lookups (type PRODUCT_GROUP).
maxRowsLimitintegerNoRows per page. Defaults to 500.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresenceDescription
nextCursorstringCan be absentPass as cursor to fetch the next page. Present only when meta.truncated.
metaobjectAlways
meta.reportstringAlways
meta.dateRangestringAlways
meta.rowLimitnumberAlways
meta.offsetnumberAlways
meta.rowCountnumberAlways
meta.totalRowCountnumberAlways
meta.truncatedbooleanAlways
meta.columnsobject[]Always
meta.columns[].keystringAlways
meta.columns[].labelstringAlways
rowsobject[]Always
rows[].productstringAlways
rows[].productIdstringAlways
rows[].groupstringCan be null
rows[].categorystringAlways
rows[].subcategorystringCan be null
rows[].totalUnitsstringAlways
rows[].unitPricestringAlways
rows[].totalValuestringAlways
rows[].customFieldsobject[]Always
rows[].customFields[].keystringAlways
rows[].customFields[].labelstringAlways
rows[].customFields[].valuestringCan be null
What the AI reads

Product-by-order grid: one row per product sold in the range, with one customFields entry per matching order (keyed by the camelized slugified order number, e.g. SO-1042 is so1042) holding that product's quantity on that order net of returns ("" when not on it), plus totalUnits. The order entries vary with the matching orders; read meta.columns. Use for fulfillment or pick breakdowns and which products are on which orders. For line items with their actual prices use distru-report-sales-orders with rowsPer LINE_ITEM; for sales totals per product use distru-report-sales-totals with rowsPer PRODUCT; for order totals use distru-report-sales-orders with rowsPer ORDER. unitPrice is the product's base price, not the order line price, so totalValue (unitPrice × totalUnits) can differ from what was billed. Quantities and money are numeric strings. Returns 500 rows by default (maxRowsLimit, up to 5000). When meta.truncated is true more rows exist: repeat the call with the same filters, any date range made explicit so every page covers the same one, and cursor set to nextCursor — or narrow the filters when you need a summary rather than every row.