Postman collection
Stock Read

pixiGetItemStockBins

Returns the bin locations (Lagerplätze) and quantities per batch and best-before date for one or more items identified by key, EAN, item numbers or an XML list.

Looks up the stock per bin for one or more items.

Input normalisation

  • ItemKey = 0 is treated as NULL.
  • String parameters are trimmed; empty strings are treated as NULL.
  • If no parameter is left, a status row with Status = Error is returned.

Finding the items (all criteria are combined with OR, so the result is the union of all matches):

  • EAN is matched against item codes of type barcode (code type 1) in ItemCode.
  • ItemNrInt is matched against item codes of type shop item number (code type 2).
  • ItemNrSuppl is matched against item codes of type supplier item number (code type 4).
  • ItemKey is matched against the item ID in ItemCode.
  • ItemXML (element-centric XML, path /ITEMS/ITEM) can list several items. Per ITEM, ITEMKEY is taken directly, while ITEMNRINT, ITEMNRSUPPL and EAN are matched against the columns ItemNrInt, ItemNrSuppl and EANUPC of the items table.

If no candidate item is found, a status row No items found with given parameters. is returned.

Result For each found item, one row per bin, batch number and best-before date with the summed quantity from InvBinItem. Bin data (name, sort number, location, bin group, transport bin flag) comes from InvBin. Rows are sorted by LocID and then by BinName (case-insensitive). Items that are found but have no bin stock records produce no rows (empty result, no error).

Notes

  • All reads use NOLOCK, so results may include uncommitted data.
  • The single parameter ItemKey is matched via the ItemCode table, not via items. An item without any entry in ItemCode is not found by ItemKey; use ItemXML with ITEMKEY instead, which is taken directly.
  • The single parameter EAN searches all barcodes of type 1 in ItemCode, whereas EAN inside ItemXML only matches the main EAN (items.EANUPC).
  • If the same item is found both through the single parameters and through ItemXML, it appears twice in the internal candidate list and its Quantity values are summed twice. Identify each item through only one route.
  • A non-existing ITEMKEY in the XML avoids the "No items found" error but simply yields no rows.
  • OPENXML element names are case-sensitive (ITEMS, ITEM, ITEMKEY, ITEMNRINT, ITEMNRSUPPL, EAN).
  • BestBeforeDate is returned as text in the format yyyy-mm-dd hh:mi:ss.mmm; an empty string means no date. BatchNumber is an empty string if no batch is set.
  • On error the procedure returns code 1 after the status row.

Tables used

ItemCode · Read items · Read InvBinItem · Read InvBin · Read
SQL object:
dbo.pipiGetItemStockBins
Updated at 2026-10-30