Postman collection
Shipping Write

pixiShipoutInvoice

Ships out an invoice or a box: updates packages, shipping vendor, weight and tracking IDs, scans out the box and releases picklist stock.

Performs a complete ship-out of one invoice via the API, identified by InvoiceNr, by BoxNr or by both.

Preparation and checks

  • BoxNr = 0 is treated as NULL. InvoiceNr, TrackingID and ShipVendorCode are trimmed; empty strings become NULL.
  • The setting Centralized_Ship_Out or Premium_API must be enabled.
  • At least one of InvoiceNr / BoxNr is required.
  • LocID must exist in Location; a given BoxNr must exist in boxes (at any location).
  • The invoice is searched by InvoiceNr on location LocID and, additionally, via the order lines contained in box BoxNr on that location. Only invoice lines whose order line status is not MIN are considered. The box is taken from the box items of these order lines.
  • If no invoice is found, No invoice found is returned. If more than one combination of invoice/box is found (e.g. the box holds lines of several invoices, or the invoice lines are spread over several boxes or are only partly boxed), or the found invoice/box differs from the given one, an error row is returned.

Ship-out

  1. If the invoice has a RefToInvoiceKey, box number -2 is used (the subsequent scan-out then fails with 0004. NO BOX !!!). Otherwise an existing box at the location containing the invoice lines is used, or a new box is created for the invoice. If the customer or shipping address is locked or the invoice is already scanned out, a negative box number results and the scan-out fails as well.
  2. The number of packages is set to AmountOfPackages (minimum 1); invoice packages are added or removed accordingly.
  3. The shipping vendor is set to ShipVendorCode (or the invoice's current vendor if not given).
  4. The box is scanned out: lock and payment checks, invoice scan-out, order lines set to status AUS, box emptied, picklist box entries removed, poll records created.
  5. Only if the scan-out did not return ERROR:
    • the weight is written to the invoice and its packages (only if setting CalculateWeightFromItems is not enabled; if Weight is not given, the current PackageGrossWeight of the invoice is used),
    • TrackingID (semicolon-separated list) is stored on the invoice packages and the invoice,
    • stock reserved on the picklist is released using the stock movement operation DirectInvoicesWizard of application ShippingClient_A (user Shipout (API)),
    • for direct invoices (InvCreationMode = Direct) the box including its items is deleted.

The call returns exactly one row with Status and StatusMessage. On success Status is OK and StatusMessage is empty.

Notes

  • The call is not wrapped in one transaction. Package count and shipping vendor are updated before the scan-out and remain changed even if the scan-out returns ERROR. A box created for the invoice may also remain.
  • The parameter BoxNr is only used to find the invoice and to validate the combination; the box that is actually scanned out is determined internally (existing box with the invoice lines on LocID, or a newly created box).
  • Already scanned-out invoices, invoices with a RefToInvoiceKey and invoices of locked customers/addresses end with 0004. NO BOX !!! rather than a specific message.
  • The error Invoice ... could not be found on location ... is practically unreachable, because an empty result is already reported as No invoice found.
  • If LocID is passed as NULL, the invoice's own location is used; error messages that concatenate LocID would then be NULL.
  • Settings read at runtime: Centralized_Ship_Out, Premium_API, CalculateWeightFromItems; in called procedures also EnableMultiInvoiceShipOut, DoNotReleaseStockOnDirectInvoiceScanOut and setting 7 (default weight 0.1 if weight is 0).
  • The scan-out retries up to five times on deadlocks; other SQL errors are logged and raised (returned as SqlMessage).
  • Reads use NOLOCK; the scan-out locks the box row with UPDLOCK. Pakete are updated under the app lock PixiInvoicePackage (timeout 30 s).
  • Events InvoiceChanged may be published when tracking IDs are set.

Tables used

Settings · Read Location · Read boxes · Read boxitems · Read Invoices · Read Invlines · Read Orderlines · Read
SQL object:
dbo.pipiShipoutInvoice
Updated at 2026-10-30