Postman collection
Orders Read

pixiGetShippedOrders

Returns the shipped orders (invoiced with history status EIN) for a date range, either as detail rows or as order count and total per currency.

Determines all invoices of a period that count as shipped and returns them either in detail or aggregated.

Selection of invoices

  • An invoice qualifies if at least one of its invoice lines (Invlines) refers to an order line that has an OrderHistory entry with status EIN.
  • The period is checked with BETWEEN @FromDate AND @ToDate against Invoices.InvDate (default) or against Invoices.ScanOutDate if SearchByScanOutDate = 1.
  • By default only invoices with total > 0 are returned; with IncludeOrdersWithTotalZero = 1 invoices with total >= 0 are included. Negative totals are never returned.
  • If CustomerNrExternal is filled (it is trimmed; an empty value means no filter), only invoices of the customer with that external customer number are returned.

For each selected invoice the distinct external order numbers (Orderlines.OrderNrExternal) of its lines are determined.

ShowDetails = 1 (default) Returns one row per combination of invoice and external order number, sorted by InvDate. An invoice that covers several orders therefore appears several times. The rows contain invoice data, shipping address, currency, carrier, tracking ID and the employee who scanned the invoice out (ScanOutEmp: alphabetically smallest UpdateEmp of the OrderHistory entries with status AUS).

Any other value of ShowDetails Returns one row per currency with the number of orders (invoice/order number combinations) and the sum of the invoice totals, where each invoice total is counted only once.

Notes

  • All reads use NOLOCK; results may contain uncommitted data.
  • FromDate and ToDate are strings that are implicitly converted for the BETWEEN comparison. A date without time (e.g. 2024-01-31) means midnight, so invoices later on that day are excluded. Pass a time such as 2024-01-31 23:59:59 or the following day. Use an unambiguous format such as ISO yyyy-mm-ddThh:mi:ss.
  • In detail mode, invoices without a matching shipping address (ShipAdrRef) or currency are dropped because of inner joins.
  • In summary mode no row is returned if no invoice matches (the query uses GROUP BY).
  • ScanOutEmp is empty if no OrderHistory entry with status AUS exists for the invoice lines.

Tables used

Invoices · Read Customers · Read Invlines · Read OrderHistory · Read Orderlines · Read Addresses · Read Currency · Read Countries · Read
SQL object:
dbo.pipiGetShippedOrders
Updated at 2026-10-30