Postman collection
Payments Read

pixiCAGetInvoiceMatch

Returns the customer account entries that are matched against the customer account entry of a given invoice.

Looks up the customer account (CA) entry of an invoice and lists all CA entries that are matched with it, for example payments or credit notes that settle the invoice.

  1. At least one of InvoiceKey or InvoiceNr must be set (a value of 0 or an empty string counts as not set). Otherwise an error is raised.
  2. If InvoiceKey is not set, it is resolved from Invoices via InvoiceNr.
  3. The CA entry whose InvoiceRef equals the invoice key is determined.
  4. All match records in CustomerAccountMatch where this CA entry is on either side (CAref1 or CAref2) are read, and the counterpart CA entries are returned. A match record that references the invoice entry on both sides (self-match) returns the invoice entry itself.
  5. The currency code is taken from pixi.Currency via the entry's currency ID.

The result has no defined sort order.

Notes

  • All reads use NOLOCK, so uncommitted data may be returned.
  • The column InvoiceNr only echoes the input parameter. If the call is made with InvoiceKey only, InvoiceNr is empty (NULL) in the result.
  • If both parameters are passed, InvoiceKey is used and InvoiceNr is not checked against it.
  • If no invoice or no CA entry is found for the invoice, an empty result set is returned without an error.
  • If several CA entries reference the same invoice, only one of them (not deterministically chosen) is used.
  • The header comment of the procedure ("show all CA Events and Statistics for a selected customer") does not match the actual behaviour.

Tables used

Invoices · Read CustomerAccount · Read CustomerAccountMatch · Read Currency · Read
SQL object:
dbo.pipiCAGetInvoiceMatch
Updated at 2026-10-30