Postman collection
Invoices Read

pixiGetInvoicesForCustomer

Returns the invoices of one customer, identified by customer key or external customer number, optionally filtered to a single invoice number.

Lists invoices together with payment, bank or card, shipping and order information for one customer.

Identifying the customer

NULL values are first replaced by 0 (for CustKey) or an empty string. Then exactly one identifier must be set:

  • CustKey <> 0 and CustomerNrExternal empty: the invoices of this customer key are returned.
  • CustKey = 0 and CustomerNrExternal set: all customers in Customers with this CustomerNrExternal are used. If several customers share the number, the invoices of all of them are returned.
  • Both set or both empty: no customer is selected and the result set is empty.

Invoice filter

  • If InvoiceNr is empty or NULL, all invoices of the customer are returned.
  • Otherwise only the invoice with exactly this InvoiceNr is returned.

Returned data per invoice

  • Invoice data from Invoices: number, date, payment and shipment address IDs, total, payment code, payment date, paid amount, tracking ID, ship date and reminder level.
  • PaymentText comes from Payments. If the code is not found there, the payment code itself is returned.
  • Paid is 1 if the paid amount (a missing amount counts as 0) equals the total, otherwise 0.
  • Card and bank data (Cc…, Account, Blz, BankName, AccountName) come from the payment address in Addresses.
  • OrderNr and OrderNrExternal are the highest values found among the order lines linked to the invoice lines. They are NULL if the invoice has no linked order lines.
  • OrderCurrencyCode is the currency code from pixi.Currency.

The code does not define a sort order.

Notes

  • All tables are read WITH (NOLOCK), so uncommitted data can appear in the result.
  • pixi.Currency is joined with an inner join. Invoices whose CurrencyId has no matching currency are not returned.
  • If CustKey and CustomerNrExternal are both sent, the call returns no rows and no error. Send only one of them.
  • If the invoice total is NULL, the comparison for Paid is not true and the column returns 1.
  • The result contains sensitive payment data: card number, card holder, card expiry and bank account.

Tables used

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