Postman collection
Orderlines Write

pixiCancelOrderline

Cancels a single orderline or a whole bundle orderline, or marks it as not available (`STO`/`NLB`), if it is not final, not boxed and not invoiced.

Sets the status of an orderline, or of a bundle orderline together with all of its orderlines, to STO (cancelled) or NLB (not available).

  1. Status defaults to STO; an empty value or NULL is also treated as STO.
  2. A value of 0 for OrderlineKey or BundleOrderlineKey counts as not sent. If neither key is sent, an error row is returned.
  3. If only OrderlineKey is sent and this orderline belongs to an existing bundle orderline (BundleOrderlineRef), the call switches to that bundle. The whole bundle is then processed, not just the single line.
  4. If a bundle key is known (sent or looked up), OrderlineKey is ignored. All orderlines with this BundleOrderlineRef are processed.
  5. Only orderlines that meet all of these conditions are updated:
    • their current status is not a final state in OrderStates (FinalState = 'Y')
    • they are not packed in a box (boxitems)
    • they are not on an invoice line (Invlines)
  6. The selected orderlines get the new Status, UpdateEmp = 'API' and the current date as UpdateDate. The related bundle orderlines are updated in the same way.
  7. On success, a row with SuccessfulMessage is returned. The text depends on whether a single orderline or a bundle was cancelled.

If Status is not STO or NLB, or if no orderline meets the conditions, a row with ErrorMessage is returned.

Notes

  • The message ONLY Status STO or NLB Allowed is also returned when the status is valid but no orderline qualifies. This happens when the key does not exist, or when all lines are in a final state, boxed or invoiced. The text is therefore misleading in this case.
  • For bundles, only the qualifying orderlines are updated. The bundle orderline itself still gets the new status as soon as at least one of its lines qualifies. Lines that are boxed, invoiced or final keep their old status.
  • The success or error message is returned in a column whose name differs (ErrorMessage vs. SuccessfulMessage). Clients should check which column is present.
  • The checks read with NOLOCK. The two updates do not run in an explicit transaction.
  • The procedure's return value (0/1) is not part of the result rows.
  • The status value is written as sent. Its comparison with STO/NLB depends on the database collation.

Tables used

Orderlines · Write BundleOrderlines · Write OrderStates · Read boxitems · Read Invlines · Read
SQL object:
dbo.pipiCancelOrderline
Updated at 2026-10-30