Postman collection
Orders Read

pixiGetOrderNrByOrderNrExternal

Returns the Pixi order number (OrderNr) for an external order number, or 0 if no matching order exists.

Scalar function that resolves an external order number (for example the order number of an online shop) to the internal Pixi order number.

  • Searches the order lines (Orderlines) whose OrderNrExternal equals OrderNrExternal exactly.
  • Joins each matching line to its order header (OrderHeader) via OrderNr, so only orders that still have a header are considered.
  • If several orders match, the highest OrderNr is returned.
  • If nothing matches, 0 is returned instead of NULL.

Notes

  • The external order number is read from the order lines, not from the order header. An order without lines is not found.
  • Both tables are read WITH(NOLOCK), so uncommitted data may be seen.
  • If the same external number was used for several orders, only the highest OrderNr is returned; other matches are silently ignored.
  • Passing NULL never matches and returns 0.

Tables used

Orderlines · Read OrderHeader · Read
SQL object:
dbo.pipiGetOrderNrByOrderNrExternal
Updated at 2026-10-30