Postman collection
Customers Read

pixiGetCustomerEvents

Returns the customer account events (debits, credits, payments, direct debits, manual bookings) filtered by customer, event type and date range.

Reads entries from the customer account ledger (CustomerAccount) and enriches them with display and status information.

Filters (all optional, combined with AND; a parameter left out or NULL does not filter):

  • CustKey: only entries whose CustRef equals this customer key.
  • EventID: only entries of this event type.
  • DateFrom / DateTo: only entries with EventDate in the range (both bounds inclusive).

If no parameter is given, all customer account entries are returned.

Enrichment per entry:

  • EventName: description of the event type from CustomerAccountEvents, translated via the translation table (language ID 2, falls back to the untranslated text). For entries linked to a direct debit (DTAUSref set), the translated direct debit state is appended in square brackets, e.g. Lastschrift [Exportiert].
  • Number: a human-readable reference depending on the linked object, checked in this order: invoice number (InvoiceRef), bank line text BankText01 (BanklineRef), account number of the direct debit (DTAUSref), reference of the manual booking (ManualBookingRef), otherwise an empty string.
  • OpenTOMatch: Amount minus the already matched amount (NULL counts as 0).
  • AllowToDelete: 1 if the entry may be deleted, otherwise 0. An entry is deletable only if it is not matched with other entries and either the event type and the direct debit state allow deletion, or it belongs to an invoice that is not paid, not paid by credit card (CCPPaymentDone not Y), has no reminder lines and whose lines are all in status EIN or all in status RET (or has no lines).
  • CCPTranLogKey: a credit card transaction log entry of the same customer whose invoice number equals the invoice number or the referenced invoice number of the linked invoice.
  • OrderCurrency: currency code (CodeA) of the entry.
  • IsDeleted: always 0.

The result has no defined sort order.

Notes

  • All reads use NOLOCK, so uncommitted data may appear.
  • The setting CaEnabled changes the "paid" check for AllowToDelete: if it is 0 or missing, Invoices.Payed is used; otherwise the latest creation date in CustomerAccountMatch for the entry is used.
  • The deletion rule is an inline copy of fPixi_CA_canIdeleteEvent, but without that function's additional check on the invoice scan-out date (ScanOutDate). Results may therefore differ from the function.
  • Entries whose CurrencyId has no row in pixi.Currency are not returned (inner join).
  • If the event type has no row in CustomerAccountEvents, EventName and AllowToDelete are NULL.
  • DateTo is compared with <=; a pure date such as 2024-03-31 means midnight, so entries later that day are excluded.
  • If several returned entries reference the same direct debit (DTAUSref), the creation of a unique index on an internal temporary table can fail with a SQL error; filtering by customer usually avoids this.
  • The view PV_CustomerAccountMatchGroup is based on PV_CustomerAccountBond, whose definition is not attached.

Tables used

CustomerAccount · Read CustomerAccountEvents · Read CustomerAccountMatch · Read CustomerAccountManualBookings · Read DTAUS · Read DTAUSstates · Read Invoices · Read InvLines · Read OrderLines · Read ReminderLines · Read CCPTranLog · Read BankLines · Read Currency · Read Settings · Read Translation · Read
SQL object:
dbo.pipiGetCustomerEvents
Updated at 2026-10-30