pixi Developer & Integration Documentation

pixiGetCRMSales

Description

Returns aggregated net sales totals per customer for CRM reporting. For each customer, the result contains the compound total (invoice amount minus returns) and the compound total excluding shipping costs, covering all invoices within the optional date range.

Optionally filter by one or more shop IDs passed as an XML document. When no shops are specified, all shops are included. When no date range is specified, all invoices are included with no date filter applied.

Monetary amounts are returned in the original order currency by default. When multi-currency is enabled in pixi system settings, all amounts are converted to the base currency and the BaseCurrency field indicates which currency was used.


Request Parameters

#

Name

Type

Required

Example

Description

1

CustomerOf

varchar(max)

0

Check additional information

XML document listing the shop IDs to filter by. When omitted or empty, all shops are included. See Additional Notes for XML format.

2

CalculationStart

datetime

0

2024-01-01 00:00:00

Start of the invoice date range. Only invoices on or after this date are included. When omitted, no start date filter is applied.

3

CalculationEnd

datetime

0

2024-12-31 23:59:59

End of the invoice date range. Only invoices on or before this date are included. When omitted, no end date filter is applied (all invoices are included).

4

Rows

int

0

1000

Maximum number of customer rows to return. Default is 1000.

5

Offset

int

0

0

Cursor-based pagination offset: returns only customers with CustKey greater than this value. Pass the last CustKey received in the previous page to fetch the next page. Default is 0 (start from the beginning).


Request body

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dem="https://api.pixi.eu/soap/demosandbox/">
<soapenv:Header/>
<soapenv:Body>
<dem:pixiGetCRMSales>
<dem:CustomerOf><SHOPS><SHOP><SHOPID>NEW</SHOPID></SHOP><SHOP><SHOPID>ZEB</SHOPID></SHOP></SHOPS></dem:CustomerOf>
<dem:CalculationStart>2024-01-01 00:00:00</dem:CalculationStart>
<dem:CalculationEnd>2024-12-31 23:59:59</dem:CalculationEnd>
<dem:Rows>1000</dem:Rows>
<dem:Offset>0</dem:Offset>
</dem:pixiGetCRMSales>
</soapenv:Body>
</soapenv:Envelope>


Response


Body 1: Customer sales summary

#

Name

Type

Description

1

CustKey

int

Unique customer identifier.

2

TotalCompound

decimal

Net sales total for the customer: sum of all invoice amounts minus return credits (including shipping costs).

3

TotalWithoutShipcostsCompound

decimal

Net sales total excluding shipping costs: sum of all invoice amounts minus return credits, with shipping costs removed.

4

BaseCurrency

varchar(3)

ISO currency code of the amounts returned. NULL when multi-currency conversion is disabled (amounts are in original order currency). Populated with the base currency code when multi-currency is enabled.


Additional Notes

CustomerOf XML format: pass a list of shop IDs as an XML document. Each SHOP element must contain a SHOPID element with the 3-character shop code. Only shops that exist in the pixi Shops table are matched.

Example XML:
<SHOPS>
<SHOP><SHOPID>NEW</SHOPID></SHOP>
<SHOP><SHOPID>ZEB</SHOPID></SHOP>
</SHOPS>

Pagination: results are ordered by CustKey ascending. To retrieve the next page, pass the last CustKey value from the current response as the Offset parameter.

Multi-currency: when the MultiCurrencyEnabled system setting is active, all monetary amounts are converted to the base currency using the exchange rate stored on each invoice. The BaseCurrency field indicates the currency used. When disabled, amounts reflect the original order currency and BaseCurrency is NULL.