Postman collection
Stock Read

pixiShopLinkGetItemsStock

Returns the available stock quantity of all items for the shop stock export, optionally without zero stock and without stock in excluded bin groups.

Returns one row per item with the internal item number and the quantity that can be exported to the shop.

The behaviour depends on the setting OldStockExport:

  • OldStockExport = 1: the procedure collects Quantity from Items into a temporary table, but returns no result set (the final SELECT is only in the other branch).
  • Otherwise (default): the available quantity is calculated per item as ItemQtyIBIExportStock_locations minus a deduction:
    • ItemQtyOpenOrderLines if reservations are disabled (ReservePrepaymentOrders <> 1) or ExportAvailableStock_WhenReservationsAreEnabled = 1, and StockExportUsePhysicalStock = 0 and the item is not a bundle;
    • ItemQtyOpenReservations if reservations are enabled, StockExportUsePhysicalStock = 0 and the item is not a bundle;
    • nothing (0) in all other cases (physical stock export or bundle items).

Filtering and corrections (non-legacy branch):

  1. If ExcludeZeros = 1, only items with a calculated quantity greater than 0 are kept. NULL is treated as 0 (all items).
  2. If ExcludeBinGroups is given (comma-separated list of bin groups), the stock of each item in bins of these groups is summed from InvBinItemLog and subtracted. For bundles whose components lie in these bins, the deduction is the minimum over the components of CEILING(component qty / bundle component qty). The matching to the result row is done via the item code with CodeTypeId = 2 (shop item number) against ItemNrInt.
  3. Negative quantities are set to 0.

The rows are returned without a defined sort order.

Notes

  • If the setting OldStockExport is 1, the call returns no rows at all; ExcludeZeros and ExcludeBinGroups have no visible effect in that case.
  • ExcludeZeros is applied before the bin group deduction and the clamping to 0. Items can therefore still appear with AvailableQty = 0 when ExcludeZeros = 1 and ExcludeBinGroups is used.
  • The bin group deduction matches pixi.ItemCode.Code (code type 2, shop item number) against Items.ItemNrInt. If these numbers differ for an item, no deduction is applied to it.
  • Settings are read via fpixi_GetSetting; a missing setting counts as 0.
  • All tables are read WITH (NOLOCK), so the result may contain uncommitted data.
  • Without paging the call returns every item, which can be a large response for big catalogues.
  • A large block of older logic is commented out in the code and is not executed.

Tables used

Items · Read InvBin · Read InvBinItemLog · Read ItemCode · Read BundleItems · Read Settings · Read
SQL object:
dbo.pipiShopLinkGetItemsStock
Updated at 2026-10-30