Postman collection
Payments Read

pixiGetPendingPayments

Returns customer account payments that were not fully matched at a given key date, either summed per payment type or as single entries.

Lists payments booked on customer accounts (CustomerAccount) that were still open, meaning not fully matched, at a given point in time.

Parameter handling

  • Date: if NULL or earlier than 1990-01-01, the current date and time (GETDATE()) is used.
  • Details: NULL is treated as 0.
  • ShopID: an empty string is treated as NULL, which means no shop filter.

Selection

  1. For every customer account entry the latest log entry with event PAY and an EventDate strictly before Date is taken from CustomerAccountLog.
  2. The entry is included only if Amount - Matched of that PAY log entry is at least 0.01.
  3. OpenAmount is the amount of the customer account entry minus the Matched value of the latest log entry of any event type before Date. If there is no such entry, 0 is subtracted.
  4. The payment type comes from the payment method of the Auftrag (delivery address APayment) or the Rechnung (Payment) that is linked to the bank line through BankMatch. If no payment method is found, ZZZ unbekannt is used.
  5. With ShopID set, only customers whose CustomerOf equals ShopID are returned.

Currency

  • If the setting MultiCurrencyEnabled is not 1, amounts are returned in the original currency of the entry and dbCurrency is NULL.
  • If MultiCurrencyEnabled = 1, Amount and OpenAmount are converted into the database (home) currency by dividing them by the exchange rate. dbCurrency then holds the code of the database currency.

Output

  • Details = 1: one row per customer account entry, sorted by PaymentType, CustRef and CustomerAccountKey.
  • Details = 0 (default): one row per PaymentType and dbCurrency with the summed OpenAmount and the key date that was used, sorted by PaymentType.

Notes

  • All reads use NOLOCK, so results can include uncommitted data.
  • The filter uses the latest PAY log entry, but OpenAmount uses the latest log entry of any event type. The two values can therefore differ.
  • With multi-currency enabled, entries without a matching exchange rate for the database currency (via pixi.ExchRate, source from setting DatabaseCurrencyExchRateSourceId, base currency from setting HomeCurrency) are dropped by inner joins.
  • In the multi-currency branch, the subquery for the matched amount filters the exchange rate source on the outer alias instead of its own. If several rate sources exist, the TOP 1 rate that is used is not deterministic.
  • The join to Payments uses an OR on the Auftrag and Rechnung payment codes. If both are linked and differ, an entry can appear twice and is then counted twice in the summary.
  • In single-currency mode dbCurrency is NULL, so the summary mixes amounts of different original currencies within one payment type.
  • The key date comparison is strict (EventDate < Date). If only a date is passed, its time part is midnight, so events of that day are excluded.

Tables used

Settings · Read Currency · Read CustomerAccountLog · Read CustomerAccount · Read ExchRate · Read OrderHeader · Read BankMatch · Read Addresses · Read Invoices · Read Payments · Read Customers · Read
SQL object:
dbo.pipiGetPendingPayments
Updated at 2026-10-30