OrderFulfillment

Get the Order Fulfillment report

Changed on

Returns one row per product sold over the reported date range, pivoted across the matching sales orders: alongside the product's group, category, and subcategory, each row carries one dynamic column per order (keyed by the slugified order number, e.g. so_1042) holding the net quantity of that product on that order, plus the product's total units, unit price, and total value. This is a read-only reporting endpoint — it never changes orders, inventory, or compliance state.

When no order_datetime filter is provided, the report defaults to the last 30 days: from the beginning of the day 30 days ago through the end of today, in the company's timezone. Canceled and merged orders are always excluded from this report, so filtering status to CANCELED returns no rows.

Every value is returned as it appears in the report's CSV export, with numeric cells returned as strings (currency and comma formatting stripped) so they match the rest of the API. Because the per-order columns are dynamic, the exact set of keys on each row and in meta.columns depends on which orders match the filters; a product that was not on a given order leaves that order's cell as an empty string (""). Report-level information (the resolved human-readable date range and the full column list) is returned under meta.

Each row also carries its product's ID, product_id, right after the product name, so a row can be followed to the product endpoints without a name lookup. The CSV export leaves this ID column out.

Required permission: reports_permissions_order_fulfillment.

get/public/v1/reports/order-fulfillment

Request

  • Base URL
    https://app.distru.com
  • Auth
    HTTP bearer

Query parameters

order_datetimestring

Restricts the report to orders whose order date falls in this range, given as two ISO8601 timestamps separated by a comma: after,before (both bounds inclusive). Either side may be left empty to leave that bound open-ended — 2026-01-01T00:00:00Z, keeps only the lower bound and leaves the upper bound open, while ,2026-02-01T00:00:00Z keeps only the upper bound and leaves the lower bound open. Both sides empty (order_datetime=,) is rejected as invalid. Omit the parameter entirely to get the default window: the last 30 days, from the start of the day 30 days ago through the end of today, in the company's timezone.

statusstring[]

Restricts to orders in any of the given statuses (values are OR'd together). SCREAMING_CASE. Canceled and merged orders are excluded from this report regardless of this filter, so CANCELED yields no rows.

searchstring

Case-insensitive substring match on the order number, the customer's company name, or the order's LeafLink short ID; an order is included when the text appears in any of the three. Omit to apply no text filter.

company_relationship_idsstring[]

Restricts to orders for the given customers, identified by their company relationship IDs (the ID of the buyer on the order). Multiple IDs are OR'd.

product_idsstring[]

Restricts the report to these products, given as product IDs. Omit to include every product sold in the range.

location_idsstring[]

Restricts to order items fulfilled from these locations, identified by their location IDs. Combined with user_ids using OR: an order item matches when its location OR its user is in the respective list. Providing only location_ids restricts to those locations; omitting both location_ids and user_ids applies no location/user restriction.

user_idsstring[]

Restricts to order items assigned to these users, identified by their user IDs. Combined with location_ids using OR (see location_ids). Providing only user_ids restricts to those users; omitting both applies no location/user restriction.

owner_idsstring[]

Restricts to orders owned by these sales reps, identified by their user IDs. Multiple IDs are OR'd; omit to include orders from every owner.

Response

The Order Fulfillment report

Changes