Postman collection
Customers Read

pixiCAGetCustomerEvents

Returns all customer account events (bookings, including deleted ones) of a customer together with the customer's account statistics such as balance and suggested refund.

Lists the customer account (Kundenkonto) of one customer.

Identifying the customer

  • Pass CustRef (the internal customer key), or
  • pass both ShopID and CustNrExt (the external customer number in that shop). The procedure then looks up CustKey in Customers where CustomerOf = ShopID and CustomerNrExternal = CustNrExt.
  • If CustRef is empty or 0 and one of ShopID/CustNrExt is missing, an error is raised.
  • If CustRef is given, ShopID and CustNrExt are ignored.

Events All account events of the customer are collected (no filter, translations in language 1):

  • active bookings from CustomerAccount (IsDeleted = 0),
  • deleted bookings from CustomerAccountLog with history remark DELETE (IsDeleted = 1).

Number is the invoice number, bank line text, direct debit account number or manual booking reference, depending on what the event refers to. OpenTOMatch is Amount minus the matched amount.

Statistics The account statistics (balance, open orders, suggested refund, matched flag, account currency) are calculated per customer and joined to every event row.

Result One row per event, each carrying the same statistics columns. If the customer has no events, a single row with only the statistics columns filled is returned (event columns, including CustRef, are NULL).

Notes

  • Read-only; all permanent tables are read with NOLOCK, so uncommitted data may appear.
  • The final SELECT has no ORDER BY; the events are produced in ascending EventDate order by the helper procedure, but the order of the returned rows is not guaranteed.
  • If ShopID/CustNrExt do not match a customer, no customer key is found; the result then depends on the statistics procedure Pixi_CA_GetCustomerAccountSummary (not attached) and is typically empty.
  • The statistics temp table has a unique index on CustRef. If the summary returns more than one row per customer (e.g. several currencies), the insert fails with a duplicate key error.
  • The column DoNotRefund is the per-event flag, not the do-not-refund total of the statistics.
  • Currency conversion of the statistics depends on the setting MultiCurrencyEnabled; AccountCurrencyCode may be the order or the base currency.
  • Column names IsAcountMatched and SuggestedRefound are spelled exactly like this.

Tables used

Customers · Read Shops · Read Currency · Read ExchRate · Read CustomerAccount · Read CustomerAccountLog · Read CustomerAccountEvents · Read CustomerAccountManualBookings · Read DTAUS · Read DTAUSstates · Read CCPTranLog · Read Invoices · Read BankLines · Read Orderlines · Read OrderStates · Read
SQL object:
dbo.pipiCAGetCustomerEvents
Updated at 2026-10-30