Postman collection
Invoices Read

pixiGetRemindersCA

Returns invoices with their reminder history, reminder costs, open amount, customer account status and billing address, optionally filtered by reminder level, shop, payment type and date.

Returns one row per invoice that matches the filters, enriched with reminder (dunning) data, customer account (CA) figures and the invoice address.

Parameter normalisation

  • ReminderLevel = 0, ShopID = '' and PaymentType = '' are treated as NULL (no filter).
  • ReminderDays = 0 is treated as NULL. If ReminderDays > 0, InvoiceFrom and InvoiceTo are overwritten with the period from now minus ReminderDays days until now.
  • If InvoiceFrom is set and InvoiceTo is empty, InvoiceTo is set to the current date and time.

Filters (all combined with AND)

  • ReminderLevel: only invoices that have at least one reminder line with exactly this level. If NULL, all invoices are candidates, including invoices without any reminder.
  • InvoiceFrom/InvoiceTo: invoice date between both values (inclusive). Only applied if InvoiceFrom is set.
  • PaymentType: invoice payment type equals the value.
  • ShopID: the customer belongs to this shop (CustomerOf).
  • OnlyUnmatched = 1: only invoices whose paid sum differs from the total.
  • OnlyWhenCAUnbalanced: see notes – the effective value is taken from OnlyUnmatched; when active, only invoices of customers whose customer account balance is not 0.

Only invoices whose customer exists, belongs to an existing shop and whose invoice address exists are returned.

Returned data

  • Invoice data: key, number, customer and address key, shop, highest order number and the external order number of that order, date and total.
  • Reminder data: highest reminder level, earliest reminder date per level 1–6 (ReminderDate1 … ReminderDate6), costs of the latest reminder (highest reminder key) and the sum of costs of all reminders of the invoice.
  • OpenInvoiceAmount = total minus paid sum.
  • Customer account: CAMatched (1 if all positive or all negative account entries are fully matched, otherwise 0) and CAFinancialBalance (sum of the customer account; with multiple currencies converted with today's exchange rate if multi-currency is enabled).
  • Customer and address data (external customer number, company, name, street, ZIP, city, country, phone, fax, e-mail).

Rows are sorted by customer key; there is no further sort order within a customer and no paging.

Notes

  • Pitfall: the code sets OnlyWhenCAUnbalanced to the value of OnlyUnmatched. The value passed for OnlyWhenCAUnbalanced is therefore ignored; sending OnlyUnmatched = 1 activates both the paid-sum filter and the customer-account-balance filter.
  • Without ReminderLevel the call is not limited to reminded or open invoices. Without further filters it returns every invoice in the database, which can be very slow. Use OnlyUnmatched, a date range or ReminderLevel to narrow the result.
  • ReminderDays > 0 takes precedence over explicitly passed InvoiceFrom/InvoiceTo. InvoiceTo alone (without InvoiceFrom) has no effect.
  • CAMatched is stored in a temporary money column, so it is returned as a decimal value (1.00 / 0.00) instead of a boolean.
  • The customer account figures are calculated for all customers via fPixi_CA_IsMatched and fPixi_CA_FinancialBalance. The currency conversion depends on the setting MultiCurrencyEnabled and today's exchange rate; if no rate exists for today, the converted amount becomes NULL.
  • All reads use NOLOCK, so uncommitted data may be returned.
  • Only reminder levels 1 to 6 have their own date column.

Tables used

Invoices · Read Customers · Read ReminderLines · Read Reminders · Read Orderlines · Read InvLines · Read Addresses · Read CustomerAccount · Read Shops · Read ExchRate · Read Settings · Read
SQL object:
dbo.pipiGetRemindersCA
Updated at 2026-10-30