Postman collection
Invoices Read

pixiGetInvoicesByOrderNr

Returns all invoices that contain lines of the given order, with payment, bank/credit card, shipping and currency data.

Looks up every invoice that is linked to the order OrderNr through its invoice lines: the order lines of the order are joined to the invoice lines (OrderLineRef), and each referenced invoice is returned once.

For each invoice the call returns:

  • Invoice data: number, date, payment and shipment address IDs, total.
  • Payment data:
    • the payment code and its text from the payment types. If no text exists, the code itself is returned as text.
    • payment date and paid sum.
    • a computed Paid flag.
  • Bank and credit card data of the payment address (AddrRef).
  • Shipping data: tracking ID, scan-out date as ship date, and the reminder level.
  • Order data: OrderNr, plus OrderNrExternal with surrounding spaces removed.
  • Currency: the ISO code (CodeA) of the invoice currency.

Paid is 1 when PayedSum (NULL treated as 0) equals total, otherwise 0.

The result has no defined sort order.

Notes

  • All tables are read with NOLOCK, so uncommitted data may appear.
  • Invoices are only returned if the payment address exists in Addresses and the currency exists in Currency. Both are inner joins.
  • Paid is 0 for overpaid invoices as well, because the code checks for equality, not for 'paid sum ≥ total'.
  • If total is NULL, Paid is 1.
  • If the order lines carry different OrderNrExternal values, the maximum value is returned for all invoices.
  • The result contains sensitive payment data (account number, credit card number), so the output must be handled accordingly.

Tables used

Invoices · Read Orderlines · Read Invlines · Read Payments · Read Addresses · Read Currency · Read
SQL object:
dbo.pipiGetInvoicesByOrderNr
Updated at 2026-10-30