Postman collection
Invoices Read

pixiGetInvoicePackageLines

Returns the package lines of invoice packages for an invoice (by ID or number) or for a single package, with item number, invoice line and quantity.

Returns the lines of invoice packages (pixi.InvoicePackageLines). Each line links a package to an invoice line and a quantity.

Input and validation

  • At least one of InvoiceNumber, InvoiceId or PackageId must be given. An empty InvoiceNumber counts as not given.
  • InvoiceNumber is resolved to an invoice key. If both InvoiceId and InvoiceNumber are given, they must point to the same invoice.
  • If PackageId is given, the package must have package lines. If an invoice is also given, the package must belong to that invoice.
  • If an invoice is given, at least one package of that invoice must have package lines.
  • If a check fails, the call returns one Status/Message row with Status = Error. No further result set follows.

Selection

  • Only an invoice given: all packages of the invoice are used.
  • PackageId given, with or without an invoice: only this package is used.
  • Invoices are discarded if they have no invoice lines, or if a joined invoice line has no order line reference (OrderLineRef).
  • The call matches the package lines with the invoice lines of the selected invoices. It returns only lines whose item has an internal item number (pixi.ItemCode, code type 2).
  • InvoiceNr is the same value in all rows. It is the number of the selected invoice.

The result has no explicit sort order. If no line matches, the call returns an Info status row.

Notes

  • All reads use NOLOCK. Data that is being written at the same time can show up uncommitted.
  • A code comment says that these packages are created by the Delphi ShipOut process.
  • Pitfall: the invoice is discarded completely if any of its joined invoice lines has no OrderLineRef. In that case the call returns the Info row and no lines, even if the invoice has package lines.
  • Lines whose item has no internal item number (code type 2 in pixi.ItemCode) do not appear. If an item has several codes of type 2, its lines are returned more than once.
  • Error and info rows come back in the normal result set with the columns Status and Message. No SQL error is raised. The return code is 1 for errors and 0 otherwise.

Tables used

Invoices · Read InvoicePackage · Read InvoicePackageLines · Read Invlines · Read ItemCode · Read
SQL object:
dbo.pipiGetInvoicePackageLines
Updated at 2026-10-30