Postman collection
Orders Write

pixiAddOrderComment

Sets the shop note (`Shop_Note`) of an order identified by its order number and returns 1 on success or 0 if the order is missing or masked.

Writes a comment into the shop note field of an order.

  1. The order is looked up in OrderHeader by OrderNr. If no order exists, the call returns a row with ReturnMessage = 0 and stops.
  2. The call checks whether the order is editable. An order counts as not editable (masked) if it has an order header attribute of type 2 with value 2. For a masked order the call returns ReturnMessage = 0 and changes nothing.
  3. Otherwise Shop_Note of the order is set to @Comment and the call returns ReturnMessage = 1.

Despite the name, the comment is not appended: the existing content of Shop_Note is replaced completely.

Notes

  • The existing shop note is overwritten. To keep previous text, read the current note first and send the combined text.
  • If Comment is NULL or omitted in the XML as nil, the note is set to an empty string (the blacklist function currently only replaces NULL with '').
  • ReturnMessage = 0 does not distinguish between "order not found" and "order masked".
  • The lookups of the order and its attributes use NOLOCK.
  • The update runs in its own transaction, or in a savepoint if the caller already has an open transaction. On an error the transaction is rolled back and the error is logged via log.InsertError (definition not attached); in that case no ReturnMessage row is returned by this procedure, and whether an error is passed on to the caller depends on log.InsertError.
  • The order lookup by OrderNr is outside the error handling; if several orders shared the same OrderNr, the subquery would fail with a SQL error.

Tables used

OrderHeader · Write OrderHeaderAttribute · Read
SQL object:
dbo.pipiAddOrderComment
Updated at 2026-10-30