Postman collection
Orderlines Read

pixiGetOrderlineExtended

Returns order lines and bundle order lines with prices, VAT, stock availability, reservation, shipping and picklist data, filtered by order, item, status, shop, payment or date.

Returns extended data for order lines. All filters are optional and combined with AND. Empty strings and 0 for OrderlineKey/OrderNR are treated as "no filter".

Item filter (ItemXML): items can be given by ITEMKEY, ITEMNRINT, ITEMNRSUPPL or EAN. All matching item keys are collected; only order lines of these items are returned.

Bundle handling (ShowOrderlines):

  • 1: bundles are not treated as normal items, so the component order lines of bundles are included.
  • 0: bundles are treated as normal items, so order lines that belong to a bundle (BundleOrderlineRef set) are excluded.
  • not sent / NULL: taken from the setting ProcessBundleItemsAsNormalItems.

Selection steps:

  1. Up to RowCount (default 1000) rows from Orderlines matching the filters, ordered by OrderlineKey.
  2. The remaining row budget is filled with rows from BundleOrderlines (grouped per bundle line). Filters on OrderNR and OrderNRExternal only match bundle lines if bundles are processed as normal items; date and invoice filters are applied to the component order lines.

Key filter: with IsStartKey = 0, OrderlineKey returns exactly this line; with IsStartKey = 1, all lines with OrderlineKey >= the given value, which allows paging together with RowCount.

Other filters: Status (order line status), ShopID (customer's shop), PaymentType (payment type of the address), OrderDateFrom/OrderDateTo and UpdateDateFrom/UpdateDateTo (exclusive bounds), InvoiceNr (line is contained in this invoice).

Replacements (IsReplacementOnly = 1): only order lines with status MIN or with a MIN entry in the order history are returned.

Calculated values:

  • AvailStockOrderLine: stock quantity of the item at the line's location minus the number of earlier reservations for the same item among the selected lines (only lines in non-final states other than EIN, FUT, FUS are ranked).
  • ReservedCount: the smaller of Qty and AvailStockOrderLine, at least 0.
  • VATRate, PriceNoVAT, ShipDate come from the first invoice line of the order line if there is one, otherwise from the order line and item.

The result is sorted by OrderlineKey.

Notes

  • All reads use NOLOCK; results may contain uncommitted data.
  • The selection is built as dynamic SQL. The row limit comes from RowCount (NULL becomes 1000); the RowCount parameter itself is not used otherwise.
  • If ItemXML is sent but none of the given items can be resolved, no item filter is applied and lines of all items are returned.
  • Invalid XML in ItemXML causes an SQL error from sp_xml_preparedocument.
  • For bundle lines the key filter is always an exact match (IsStartKey is ignored there).
  • IsReplacementOnly only restricts normal order lines; selected bundle lines are still returned.
  • Normal order lines are only returned if an ItemLocationSpecific record exists for the item and the line's LocationID, and if the order header and its currency exist.
  • An order line on several picklists appears once per picklist (PicklistNr).
  • For bundle lines ShipDate, DFShipDate, DFShipmentTrackingID, AvailStockOrderLine, EstimatedDelivery and therefore ReservedCount are NULL; OrderDate/UpdateDate come from one of the component lines.

Tables used

OrderStates · Read Orderlines · Read BundleOrderlines · Read Customers · Read Addresses · Read items · Read Invlines · Read Invoices · Read OrderHistory · Read Reservation · Read PLitem · Read OrderHeader · Read Currency · Read ItemLocationSpecific · Read Orderline_EstimatedDelivery · Read Settings · Read
SQL object:
dbo.pipiGetOrderlineExtended
Updated at 2026-10-30