Postman collection
Orderlines Write

pixiUpdateOrderline

Updates name, quantity, prices, discounts, note, serial number and DF type of an order line or bundle order line, provided the line can still be changed.

Changes a single order line (OrderlineKey) or a bundle order line (BundleOrderlineKey) and returns a result row with 1 (executed) or 0 (rejected).

Key selection

  • BundleOrderlineKey = 0 is treated as NULL.
  • If both keys are missing, an informational message is raised and result = 0 is returned.
  • If BundleOrderlineKey is set, OrderlineKey is ignored.

Changeability check The line, or for a bundle every component order line, must fulfil all of the following:

  • its order state (OrderStates) is not a final state (FinalState is N or empty),
  • its status is not EIN,
  • it is not packed in a box (boxitems),
  • it is not on an invoice (Invlines).

If a single line fails the check, nothing is changed and result = 0 is returned.

Merging with current values Every parameter left out (NULL) keeps the value stored on the line. For ArtName, oItemSpecialNote and SerialNumber an empty string also keeps the stored value. For bundles the serial number is not processed. If the resulting Price is higher than FullPrice, FullPrice is raised to Price. The same rule applies to the net values.

Update The internal procedure Pixi_UpdateOrderline is then run with update user API. It does the following:

  • updates the order line, or the bundle order line, with quantity, gross/net price, confirmation date, name, note, serial number, full prices, discount percentage/value and DF_type;
  • for bundles, also sets DF_type on all component order lines;
  • writes the current header values (address remarks, gift message and, if a shipping instruction exists, shipping instruction, Verfahren, Product, Extras) back to OrderHeader;
  • synchronises the voucher of the order (see notes);
  • rebuilds the reservations of the whole order if any of its lines has a reservation.

Finally result = 1 is returned.

Notes

  • Non-existent key: if OrderlineKey or BundleOrderlineKey does not exist, the check finds no row and does not reject the call. Nothing is updated, but result = 1 is still returned.
  • Messages instead of errors: all RAISERROR calls use severity 0. They arrive only as SqlMessage, not as SQL errors.
  • Invoice check: if Pixi_UpdateOrderline finds an invoice line, it raises its message and changes nothing. result = 1 is still returned afterwards.
  • Net prices: the net price and net full price are initialised with the passed gross values (Price, FullPrice). The line price is then converted by dbo.fPixi_CalculatePrices (not attached) using tax rate and order type. FullPrice_Net is stored without conversion, so after passing FullPrice it holds the same value as FullPrice.
  • Types: DiscountPerc is passed as numeric(6,2) and is therefore rounded to two decimals. GiftMessage is passed as varchar(1000).
  • Values cannot be cleared: ArtName, oItemSpecialNote and SerialNumber cannot be cleared through this call.
  • Voucher handling (based on the voucher code of the line and OrderHeader.Discount):
    • If the voucher exists with a different amount, its amount is set to the order discount.
    • If that discount is 0, VoucherID is cleared on all lines and bundle lines of the order.
    • If the voucher does not exist and the code is not NULL, a voucher is created (valid for about one year from the order date, single use, shop GRM) and assigned to all lines of the order.
  • Reservations: reservations are removed and recreated by Pixi_Res_RemoveReservationForOrder and Pixi_Res_CreateReservationForOrder. These procedures are not attached and may produce further output.
  • Transactions and errors: the update runs in a transaction, or a savepoint if a transaction is already open. On an exception it is rolled back, a row with the error message and the error count is returned (unnamed columns), the error is logged via log.InsertError, and result = 1 follows anyway.
  • Locking: the checks read with NOLOCK; updates use ROWLOCK.

Tables used

Orderlines · Write BundleOrderlines · Write OrderHeader · Write Voucher · Write OrderStates · Read boxitems · Read Invlines · Read Currency · Read Reservation · Read
SQL object:
dbo.pipiUpdateOrderline
Updated at 2026-10-30