Postman collection
Stock Read

pixiGetChangedItemStockSince

Returns items whose stock was recalculated since a given point in time, with physical and available stock, estimated delivery and open supplier order quantity, paged.

Delta export of item stock based on the item column LastCalculateStockDate.

  1. If Since is NULL, it is treated as 0 (1900-01-01), so all items qualify. A NULL Start is treated as 0.
  2. The first Start + Rowcount items with LastCalculateStockDate >= Since are collected, ordered by LastCalculateStockDate, then ItemKey. Each row gets a sequential RowNr in this order.
  3. For the rows with RowNr > Start the item data is filled in: item numbers, EAN, physical stock (Quantity), minimum stock, enabled flag, bundle flag, the estimated delivery date from the estimated delivery table and the available stock.
  4. Available stock is the export stock of the item's locations minus a deduction that depends on settings:
    • If StockExportUsePhysicalStock is '1', nothing is deducted.
    • Otherwise, if reservations (ReservePrepaymentOrders = '1') are disabled, or they are enabled and ExportAvailableStock_WhenReservationsAreEnabled = 1, the quantity of open order lines is deducted.
    • Otherwise, if reservations are enabled, the quantity of open reservations is deducted.
    • Bundle items never get a deduction.
  5. The open supplier order quantity is calculated per item as the sum of ordered minus delivered minus undelivered quantity over supplier order lines whose supplier order has a status flagged as open (IsAllOpen = 1) and whose consideration start date is empty or not in the future.
  6. Up to Rowcount rows with RowNr > Start are returned, sorted by RowNr.

Paging: Start is the number of rows to skip, Rowcount the page size. For the next page pass Start + Rowcount with the same Since, or start over with the last UpdateDate as new Since.

Notes

  • All reads use NOLOCK; results may contain uncommitted data and can shift between paging calls if stock is recalculated meanwhile (the order depends on LastCalculateStockDate).
  • The filter is >= Since; when continuing with the last UpdateDate as Since, items with exactly that timestamp are returned again.
  • The column OpenSupplierOrderQTY is never filled and is always 0. The actual open supplier order quantity is in OpenSupplOrdersQty, which is NULL if the item has no open supplier order lines.
  • Rowcount must not be NULL; TOP with NULL causes an SQL error.
  • Settings are read via fpixi_GetSetting; missing settings count as '0'. The setting ExportAvailableStock_WhenReservationsAreEnabled is converted to int, a non-numeric value causes a conversion error.
  • Cost grows with Start, because Start + Rowcount rows are prepared on every call.

Tables used

items · Read Item_EstimatedDelivery · Read SupplierOrder · Read SupplierOrderStatus · Read SupplierOrderLine · Read Settings · Read
SQL object:
dbo.pipiGetChangedItemStockSince
Updated at 2026-10-30