Postman collection
Orders Write

pixiOrderSetInfo

Updates the sub-shop name, sub-shop logo and referrer of an order, identified by Pixi order number or external order number.

Sets informational fields in the header of an existing order.

  1. Order lookup: The procedure searches Orderlines for rows where OrderNrExternal equals @OrderNrExternal or OrderNr equals @OrderNr, and takes the OrderNr from a matching row. If no row matches, @OrderNr keeps the value that was passed in.

  2. Check: If there is not exactly one OrderHeader record with the resulting OrderNr, an error row with ErrorNr 404 is returned and nothing is changed.

  3. Update: Otherwise the OrderHeader record is updated:

    • SubShopName is set to @SubShopName,
    • SubShopLogo is set to @SubShopLogo,
    • Referrer is set to @Referrer.

    A parameter that is omitted or NULL leaves the existing value unchanged. This allows partial updates.

  4. If the update fails, an error row with ErrorNr 500 is returned.

On success the call returns no result set.

Notes

  • The lookup by @OrderNrExternal goes through Orderlines, not OrderHeader. An order without order lines cannot be found by its external number and returns 404. Lookup by @OrderNr alone still works in that case, because the passed value is kept.
  • If both @OrderNr and @OrderNrExternal are passed and they point to different orders, the code does not detect the conflict, although the error text suggests it does. The lookup then takes the OrderNr from one of the matching order lines, and the row that is used is not defined. That order is updated. Pass only one of the two identifiers.
  • The lookup reads with NOLOCK.
  • An empty string is not NULL. It overwrites the field with an empty value. Only NULL or an omitted parameter keeps the existing value.
  • Values longer than 50 characters can make the update fail, which returns the 500 row. Whether this happens depends on the column sizes in OrderHeader, which are not visible in the code.
  • The error texts mention an "invoice", but the call works on orders.
  • No transaction is opened explicitly. The update is a single statement.

Tables used

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