Postman collection
Payments Read

pixiGetPaymentDetailsForInvoice

Returns the customer account entry of an invoice together with all matched account entries and their bank line and bank import details.

Looks up the payment situation of a single invoice via the customer account (CustomerAccount).

  1. The invoice is identified by InvoiceNr in Invoices. The customer account entry whose InvoiceRef points to this invoice is determined (the invoice entry).
  2. All customer account entries that are matched with this invoice entry in CustomerAccountMatch are collected. The match is evaluated in both directions (CARef1 and CARef2), so payments, credit notes or other entries linked to the invoice are found regardless of how the match was stored.
  3. For the invoice entry and all matched entries, one row each is returned with the account entry data. If an entry was created from a bank line (BanklineRef), the bank line data (BankLines) and the data of the bank import file (BankHeader) are added; otherwise these columns are empty.

Sort order: the invoice entry itself comes first, followed by the matched entries in ascending order of CustomerAccountKey.

If no invoice with the given number exists or it has no customer account entry, an empty result set is returned.

Notes

  • All tables are read with NOLOCK, so uncommitted data may be returned.
  • Only direct matches of the invoice entry are returned; entries that are matched only indirectly (via another matched entry) are not included.
  • If several invoices share the same InvoiceNr, the subquery returns more than one value and SQL Server raises error 512 (returned as SqlMessage).
  • If several customer account entries reference the invoice, only one of them (not deterministically chosen) is used as the invoice entry.
  • Column types are not visible in the code; types in this documentation are derived from column names and usage.

Tables used

CustomerAccount · Read Invoices · Read CustomerAccountMatch · Read BankLines · Read BankHeader · Read
SQL object:
dbo.pipiGetPaymentDetailsForInvoice
Updated at 2026-10-30