Postman collection
Orders Read

pixiReadOrderHeader

Returns order headers selected by key or order number, or by create/update date ranges, with key-based paging.

Reads records from OrderHeader. The parameters select one of several mutually exclusive modes, checked in this order:

  1. Create-or-update range: CreateAndUpdateDateFrom and/or CreateAndUpdateDateTo is set. Returns orders where CreateDate or UpdateDate is >= From, and CreateDate or UpdateDate is < To.
  2. Create range: CreateDateFrom and/or CreateDateTo is set. Filters CreateDate >= From and CreateDate < To.
  3. Update range: UpdateDateFrom and/or UpdateDateTo is set. Filters UpdateDate >= From and UpdateDate < To.
  4. Paging without date filter: RowCount is set and no date parameter is set. Returns the next orders after OrderHeaderKey.
  5. Single order: otherwise. Returns at most one order where OrderHeaderKey equals the given key or OrderNr equals the given order number.

Only the first matching mode is used. Parameters of later modes are ignored. For example, OrderNr has no effect if any date parameter or RowCount is set.

Paging: In modes 1–4, OrderHeaderKey is an exclusive lower bound. Only orders with a key greater than the passed value are returned. If OrderHeaderKey is not passed, it is treated as 0. To read the next page, pass the last OrderHeaderKey you received.

Row limit: The output is limited to RowCount rows. If RowCount is NULL or 0, the limit is 1000 rows. Values above 100000 are capped to 100000. Rows are always sorted by OrderHeaderKey ascending.

Computed columns:

  • ShipDate is the latest ShipDate of the order's Orderlines.
  • ShopNote is wrapped in a CDATA section if it starts with <.
  • ExchRateId is only filled if the setting MultiCurrencyEnabled is 1.

Notes

  • All reads use NOLOCK, so uncommitted data can be returned.
  • No filter: A call without any parameter returns no rows, unless an order with key 0 exists. The call falls into the single-order mode with key 0.
  • Single-order mode: If both OrderHeaderKey and OrderNr are passed, the filter is an OR. One arbitrary matching order is returned, because there is no sort before TOP 1.
  • Create-or-update mode: The OR logic is loose. The To bound only excludes an order if both CreateDate and UpdateDate are at or after To. This mode collects all matching keys before applying the row limit, which can be slow for wide ranges.
  • RowCount = 0: In modes 2–4, RowCount = 0 leads to zero candidates, so no rows are returned. Pass NULL instead to use the default of 1000. Negative values cause a SQL error.
  • The row limit is applied with SET ROWCOUNT.

Tables used

OrderHeader · Read Orderlines · Read Settings · Read
SQL object:
dbo.pipiReadOrderHeader
Updated at 2026-10-30