Postman collection
Stock Write

pixiBinCreate

Creates one or more bins (Lagerplätze) from an XML list, validates each entry and returns a status row per bin.

Creates new bins in the table InvBin from the XML passed in BinsXML. Each /Bins/Bin element describes one bin.

Input checks for the whole request

  • If BinsXML is NULL or empty, or contains no /Bins/Bin element, a single status row ERROR / XML contains no data. is returned.
  • If the text cannot be converted to XML, ERROR / Cannot parse XML is returned.

Validation per bin (a bin that fails a check gets Status = ERROR and is not inserted):

  1. Duplicates within the request: with setting FilterStockOperationsWithLocation = 0 the bin name must be unique in the request; with setting = 1 the combination name + location must be unique. Transport bins (TransportBin = 1) with the same name are always duplicates, regardless of location.
  2. Name must not be empty.
  3. LocId must not be empty.
  4. SortNr must be an integer ≥ 0 (mandatory).
  5. MaxItems must be an integer ≥ 0 (mandatory).
  6. Duplicates in the database: with setting = 0 no existing bin may have the same name in any location; with setting = 1 no existing bin may have the same name in the same location.
  7. The location LocId must exist in Location.

Insert All bins without error are inserted in one transaction into InvBin with BinLocID, BinName, BinMaxItems, BinSortNum, BinGroup, TransportBin; CreateEmp/UpdateEmp are set to CreateEmp (default API), CreateDate/UpdateDate to the current time. A missing Group is stored as empty string, a missing TransportBin as 0.

Response One row per Bin element, sorted by its position in the XML (Row). Successfully created bins have Status = CREATED, an empty Message and the new BinKey (looked up by name and location). Rejected bins have Status = ERROR, the reason in Message and BinKey = NULL.

Notes

  • The behaviour depends on the setting FilterStockOperationsWithLocation (read via SettingGet, default 0): with 0 bin names are unique system-wide, with 1 only per location.
  • Only one error message is kept per bin. An empty name overwrites a previously set duplicate message; later checks only run on rows that have no error yet.
  • Which of several duplicate entries in the request is accepted is not guaranteed to be the first in the XML, because the numbering within a duplicate group is ordered only by the bin name.
  • SortNr and MaxItems are parsed with TRY_PARSE (culture of the session language). A missing value already fails as Datatype error, so the messages SortNr is empty. / MaxItems is empty. are practically never returned. The SortNr and MaxItems columns of the response show the parsed input, so they are NULL for non-numeric values.
  • TransportBin is read directly as bit. A value that cannot be converted (e.g. yes) raises a SQL error outside the error handling and comes back as SqlMessage.
  • Existence checks against InvBin and Location use NOLOCK; parallel calls with the same bin names can therefore still create duplicates.
  • The insert runs in its own transaction (or a savepoint if a transaction is already open). On an unexpected error everything is rolled back, the error is logged via log.InsertError (not attached) and a single row ERROR with the SQL error text is returned.

Tables used

InvBin · Write Location · Read Settings · Read
SQL object:
dbo.pipiBinCreate
Updated at 2026-10-30