Postman collection
Stock Read

pixiGetStockBins

Returns the stock bins (Lagerplätze), optionally filtered by location and bin group, with the total quantity stored on each bin and optional paging.

Reads the stock bins from InvBin and calculates for each bin the sum of BinItemQTY of all entries in InvBinItem on this bin (NrOfItemOnBin, 0 if the bin is empty).

Filters:

  • LocID: only bins of this location (BinLocID). Empty string or NULL means all locations.
  • BinGroup: only bins of this bin group. Empty string or NULL means all groups.

Paging:

  • If RowCount is 0 or NULL, all matching bins are returned without a RowNr column.
  • If RowCount is greater than 0, the rows are numbered by BinSortNum (RowNr), and at most RowCount rows with RowNr greater than Start are returned. Start is therefore the number of rows to skip.

The result is always sorted by BinSortNum, then BinKey.

Notes

  • All reads use NOLOCK, so the result can contain uncommitted data.
  • The row numbering for paging orders only by BinSortNum, while the output is ordered by BinSortNum, BinKey. If several bins share the same BinSortNum, the assignment of RowNr among them is not deterministic, so pages can overlap or skip bins. Use unique sort numbers or fetch without paging when this matters.
  • The column set differs between the two modes: RowNr is only present when RowCount > 0.
  • A negative RowCount is not handled and makes TOP fail with a SQL error.
  • NrOfItemOnBin is the total quantity on the bin, not the number of distinct items.

Tables used

InvBin · Read InvBinItem · Read
SQL object:
dbo.pipiGetStockBins
Updated at 2026-10-30