Postman collection
Customers Read

pixiGetCustomerOrderAccount

Returns a customer's master data, addresses, orders, order lines, bundle lines, invoices, invoice lines and customer account summary and entries.

Collects everything needed for a customer account view of one customer (CustKey) and returns it as nine result sets.

Order selection

The orders come from Orderlines with CustRef = @CustKey. The procedure applies an optional filter on Orderlines.OrderDate:

  • OrderDateFrom and OrderDateTo set: OrderDate >= OrderDateFrom and OrderDate < OrderDateTo. The upper bound is exclusive.
  • Only OrderDateFrom set: OrderDate >= OrderDateFrom.
  • Otherwise: no date filter. This also applies when only OrderDateTo is set (see notes).

An order is included if at least one of its lines matches. All lines of a selected order are returned afterwards.

The invoices are all distinct InvRef values of the lines of the selected orders.

Result sets

  1. Customer master data from Customers.
  2. All addresses of the customer (AdrCustRef = @CustKey), including bank and credit card data and the ISO country codes from Countries.
  3. Order headers of the selected orders, with the currency code.
  4. Order lines of the selected orders, sorted by OrderNr. Includes supplier item number, estimated delivery and a computed ResQty.
  5. Bundle order lines (BundleOrderlines) of the selected orders, sorted by OrderNr.
  6. Invoices linked to the selected orders.
  7. Invoice lines of these invoices, sorted by InvoiceRef.
  8. Financial summary of the customer account. It is calculated by Pixi_CA_GetCustomerAccountSummary and is not date-filtered.
  9. All customer account entries (CustomerAccount) of the customer, sorted by CustomerAccountKey. They are not date-filtered.

Notes

  • Date filter bug: the third branch repeats the condition of the second one (OrderDateFrom IS NOT NULL AND OrderDateTo IS NULL). If only OrderDateTo is passed, it is ignored and all orders of the customer are returned. To set only an upper bound, also pass a very early OrderDateFrom.
  • No locking: all reads use NOLOCK, so uncommitted data can appear.
  • Currency joins: order headers, order lines, bundle lines, invoices, invoice lines and account entries are joined to pixi.Currency with an inner join. Records without a matching currency are not returned.
  • ResQty in result set 4:
    • The code ranks the active reservations of the same item by ResDate and ResOrderlineRef, across all customers and locations. Active means: order status in OrderStates with FinalState = 'N', excluding EIN, FUT and FUS.
    • ResQty is the location stock (ItemLocationSpecific.LocationQuantity) minus the number of earlier reservations.
    • Lines without an active reservation get the full location stock.
  • Always-NULL column: SOrderlineRef is always NULL.
  • Duplicate columns: columns ending in _OrderCurr repeat the base column. The code marks them for removal.
  • Repeated values: ShipCost in result sets 4 and 5 is the order header value, repeated on every line.
  • Sensitive data: result set 2 returns credit card number, CVC and bank data. Handle the response accordingly.
  • Result set 8:
    • It depends on Pixi_CA_GetCustomerAccountSummary, which reads the settings DoNOTChargeShipCostOnSecondDelivery, MultiCurrencyEnabled and HomeCurrency.
    • It can be empty if the customer's shop or the HomeCurrency setting cannot be resolved.
    • With several currencies and multi-currency enabled, amounts are converted with the exchange rate of the current day.
  • Non-existent customer: for an unknown CustKey the result sets are simply empty. No error is raised.

Tables used

Orderlines · Read OrderStates · Read Customers · Read Addresses · Read Countries · Read OrderHeader · Read Currency · Read Reservation · Read Items · Read ItemLocationSpecific · Read Orderline_EstimatedDelivery · Read BundleOrderlines · Read Invoices · Read Invlines · Read CustomerAccount · Read
SQL object:
dbo.pipiGetCustomerOrderAccount
Updated at 2026-10-30