Postman collection
Orders Read

pixiGetOrderHeadersByOrderDate

Returns order headers with payment, shipping, voucher and tracking data for all orders that have order lines with an order date in the given range.

Returns one row per order header for all orders that have at least one order line whose Orderdate lies between FromDate and ToDate (inclusive, BETWEEN).

Filter

  • ShopID restricts the order lines to those whose CustomerOF equals the given shop. An empty string is treated like NULL, which means all shops.
  • Only orders for which a customer, a payment address (AddrRef) and a currency exist are returned (inner joins on Customers, Addresses and pixi.Currency).

Building the result

  1. Basic data is taken from the order header, the customer, the payment address (bank and credit card data, ZIP) and the currency (CurrencyCode). OrderLocked is the lock flag of the shipping address, N if none is found.
  2. PaymentType is filled from the payment type of the payment address.
  3. OrderNrExternal, OrderDate, VoucherID and VoucherAmount are taken from the order lines (and the voucher), ShipCost from the order header.
  4. TrackingID (shipment tracking ID, otherwise the Direct-Fulfillment tracking ID) and ShipVendor are taken from the invoices of the order's lines.
  5. Shipdate is the earliest and LastShipdate the latest scan-out date of all invoices belonging to the order's lines.

The result is sorted by OrderDate ascending. There is no paging.

Notes

  • All reads use NOLOCK, so uncommitted data may be returned.
  • BETWEEN is inclusive: if ToDate is a date without time (midnight), order lines later on that day are not included. Pass e.g. 2024-01-31T23:59:59 to cover the whole day.
  • The shop filter applies to CustomerOF of the order lines, while the returned ShopID is the CustomerOf of the customer.
  • For orders with several lines or several invoices, OrderNrExternal, OrderDate, VoucherID, VoucherAmount, TrackingID and ShipVendor are taken from an arbitrary matching row. OrderDate may therefore come from a line outside the requested date range.
  • Shipdate, LastShipdate, TrackingID and ShipVendor are NULL as long as no invoice exists.
  • The result contains sensitive payment data (credit card number, bank account) of the payment address.
  • No paging: large date ranges can produce large results and run slowly.

Tables used

OrderHeader · Read Customers · Read Addresses · Read Currency · Read Orderlines · Read Voucher · Read Invoices · Read InvLines · Read
SQL object:
dbo.pipiGetOrderHeadersByOrderDate
Updated at 2026-10-30