Get orders
List sales orders, most recent order date first, filtered by the query parameters below. Each entry is the same full order object returned by GET /public/v1/orders/{id}, including its line items, charges, invoices, and returns.
Results are paginated: the response is a data array plus a next_page URL. Follow next_page to walk subsequent pages; a null next_page means the last page was reached. All datetime filters accept an inclusive range and combine with AND (an order must satisfy every filter given).
Required permission: orders_permissions_view. Results are further limited to the orders the authenticated user can see under their team restrictions, so this may return fewer orders than exist on the company.
Query parameters
Restrict the result to specific orders by ID (the same ID returned as each order's id). Repeat the bracketed key once per ID. Unknown IDs simply match nothing; an empty list is treated as no filter. At most 200 IDs may be given.
Filter by the delivery datetime (an order's delivery_datetime). Inclusive ISO8601 range written as after,before; either side may be omitted. 2022-07-10T00:00:00Z, keeps orders delivered on or after that instant, ,2022-07-10T00:00:00Z keeps those on or before it, and supplying both bounds keeps orders in between. Orders with no delivery datetime are excluded whenever this filter is present.
Filter by the due datetime — when the customer is expected to pay (an order's due_datetime). Inclusive ISO8601 range after,before; either side may be omitted (,2022-07-10T00:00:00Z keeps orders due on or before that instant).
Filter by when the order was created in Distru (its inserted_datetime). Inclusive ISO8601 range after,before; either side may be omitted.
Filter by the order datetime — when the order was placed (its order_datetime). Inclusive ISO8601 range after,before; either side may be omitted. Results are always sorted by this field, newest first.
Page selector. Page size is fixed by the server; paginate by following the next_page URL in each response rather than building page selectors yourself — it is null on the last page. next_page uses page[after]=<cursor>, an opaque token marking where the next page resumes; pass it back exactly as given, and only to the endpoint that issued it. This is seek-based, so every page stays fast no matter how deep you page.
Filter by lifecycle status; repeat the key to pass several and orders in ANY of the given statuses are returned. SCREAMING_CASE, one of: PENDING, PROCESSING, READY_TO_SHIP, DELIVERING, DELIVERED, COMPLETED, CANCELED. See the status field on the order for what each value means. At most 200 statuses may be given.
Filter by when the order was last modified in Distru (its updated_datetime). Inclusive ISO8601 range after,before; either side may be omitted. Useful for polling only the orders that changed since your last sync.
Filter to orders whose buyer (customer) is any of these companies. Pass company relationship IDs — the same id returned as each order's company.id and by GET /public/v1/companies. Repeat the bracketed key once per ID. Unknown IDs (including ones that don't belong to your company) simply match nothing; an empty list is treated as no filter. At most 200 IDs.
Filter to orders placed by any of these buyer companies — the DistruCommerce buyer that placed the order (each order's buyer_company.id), set only for menu orders placed by the buyer themselves. Distinct from company_ids, which is the order's customer/company relationship. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.
Filter to orders owned by any of these Distru users (each order's owner.id). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.
Filter to orders whose top-level location is any of these Distru locations (each order's location.id). This is the order's own location, not the per-line-item fulfillment location. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.
Filter to orders whose billing location is any of these Distru locations (each order's billing_location.id). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.
Filter to orders whose shipping location is any of these Distru locations (each order's shipping_location.id). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.
Filter to orders placed through any of these DistruCommerce menus (each order's menu.id). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.
Filter to orders whose order number contains this text, case-insensitively (substring match). For an exact match on one or more full order numbers, use order_numbers instead.
Filter to orders whose order number exactly matches any of these values, case-insensitively. Repeat the bracketed key once per value; an empty list is treated as no filter. At most 200 values. Use order_number for a substring search instead.
Filter to orders synced from any of these LeafLink orders, matching LeafLink's own order identifier (each order's leaflink_id). Exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values.
Filter to orders associated with any of these Metrc transfers, matching Metrc's own integer transfer id (each order's metrc_transfer_id). Repeat the bracketed key per value; empty list is no filter. At most 200 values.
Filter to orders associated with any of these BioTrack manifests (each order's biotrack_id). Exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values.
Filter by when the order was marked Delivered or Completed (an order's delivered_datetime). Inclusive ISO8601 range after,before; either side may be omitted. Orders that never reached Delivered or Completed have no delivered datetime and are excluded whenever this filter is present.
Filter to orders whose customer belongs to any of these company relationship groups. Pass company relationship group IDs (the same id returned by GET /public/v1/company-relationship-groups). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.
Filter by payment status, derived from the order's invoices and their payments against the order total (net of returns). Repeat the key to pass several; orders in ANY of the given statuses are returned. SCREAMING_CASE, one of: • NOT_PAID — nothing has been paid. • PARTIALLY_PAID — some but not the full amount has been paid. • FULLY_PAID — paid in full. • OVER_PAID — paid more than the order total. At most 200 values.
Filter by the order total (the raw order total including line items, charges, discounts, and taxes — the same value returned as each order's total). Inclusive range written as min,max; either side may be omitted. 100, keeps orders totaling 100 or more, ,500 keeps those totaling 500 or less, and 100,500 keeps those in between.
Filter to orders that contain a line item drawn from any of these batches (matching an order item's batch). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item drawn from any of these packages (matching an order item's package). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose package carries any of these compliance labels (the package's Metrc/BioTrack label). Case-sensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose package has any of these batch numbers (the batch number stored on the package). Case-sensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose batch has any of these batch numbers (matching the order item's batch). Case-sensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item of any of these products (matching an order item's product). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product belongs to any of these product categories. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product belongs to any of these product subcategories. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product belongs to any of these product groups. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product has any of these brands. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product has any of these vendors (the product's supplier company relationship). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product has any of these strains. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product carries any of these tags. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter to orders that contain a line item whose product has any of these SKUs. Case-insensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).
Filter by custom field values, as custom_data[{id}]=value where {id} is a custom field's numeric id. Repeat with different ids to filter on several fields at once; a record must match every one (AND). Matching is case-sensitive exact against the value stored on the record. The id must be a filterable custom field defined on this entity — use GET /public/v1/custom-fields?parent_object=order to list the ids, their types, and which are filterable. A non-numeric id, an id not defined on this entity, or an id that isn't filterable returns a 400.
Response
A list of orders
Changes
No recorded changes to this endpoint across all 1 revision of this API.