Postman collection
Stock Read

pixiGetPhysicalItemStock

Returns the physical stock quantity of one item at one location, identifying the item by item key, EAN, supplier item number or internal item number.

Scalar function that returns a single integer: the value of LocationQuantity from the location-specific item data for the given location.

Steps:

  1. The item identifiers are normalised: ItemKey = 0 and empty strings for EAN, ItemNrSuppl and ItemNrInt are treated as not set (NULL).
  2. Location-specific item records (ItemLocationSpecific) are joined with the item master (Items) and filtered on LocID = LocationId.
  3. A record matches if any of the supplied identifiers matches: ItemKey, EANUPC = EAN, ItemNrSuppl or ItemNrInt. The identifiers are combined with OR, not AND.
  4. The LocationQuantity of the matching record is returned as Result.

If no record matches, or no identifier is supplied, the result is NULL.

Notes

  • Reads with NOLOCK, so the value may reflect uncommitted changes.
  • Because the identifiers are combined with OR, passing several identifiers that belong to different Artikel can match more than one record. In that case the function returns the quantity of one of them, and which one is not defined (no sort order). Pass only one identifier, ideally ItemKey, to get a deterministic result.
  • EAN, ItemNrSuppl or ItemNrInt may not be unique across items; the same ambiguity applies then.
  • LocationId has no default and must always be supplied.
  • The function returns the stored LocationQuantity only; it does not subtract reservations or open orders.

Tables used

ItemLocationSpecific · Read Items · Read
SQL object:
dbo.pipiGetPhysicalItemStock
Updated at 2026-10-30