pixiGetCRMCustomerData
Returns customers with their main address data in pages ordered by CustKey, intended for synchronisation with CRM systems.
Returns customer records together with the address referenced by the customer (AddrRef).
- Only customers with
CustKeygreater thanCustKeyStartare returned. - If
CustomerOfis empty or NULL, customers of all shops are returned; otherwise only customers whoseCustomerOfmatches. - At most
Rowsrows are returned, sorted byCustKeyascending.
Paging: start with CustKeyStart = 0, then pass the highest CustKey of the previous page as CustKeyStart for the next call. Stop when fewer than Rows rows come back.
An empty VATID is returned as NULL. Locked is Y if the customer is locked for sales (SLocked) or for delivery (DLocked), otherwise N.
Notes
- Tables are read with
NOLOCK, so uncommitted changes may be visible and rows can occasionally be missed or duplicated during concurrent writes. - The address is joined with a LEFT JOIN; customers without a matching address are still returned with NULL address columns.
- Despite the header comment about "safe XML values", the code does not transform the values apart from
VATIDandLocked.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
CustKeyStart
|
int | 0 |
Only customers with a Example: |
Rows
|
int | 1000 |
Maximum number of rows returned (page size). Example: |
CustomerOf
|
varchar(3) string |
– |
Shop code the customer belongs to. Empty or NULL returns customers of all shops. Example: |
Result set 1 · Always (may be empty)
Customers with address data, ordered by CustKey ascending, at most Rows rows.
| Column | Type | Description |
|---|---|---|
CustKey
|
int |
Internal customer key. |
CustomerNrExternal
Nullable |
string |
External customer number (e.g. from the shop). |
CustomerOf
Nullable |
string |
Shop code the customer belongs to. |
Anrede
Nullable |
string |
Salutation. |
Name
Nullable |
string |
Name (first address line). |
Name2
Nullable |
string |
Additional name line. |
FirstName
Nullable |
string |
First name. |
LastName
Nullable |
string |
Last name. |
Street
Nullable |
string |
Street. |
HouseNr
Nullable |
string |
House number. |
Address
Nullable |
string |
Address line. |
ZIP
Nullable |
string |
Postal code. |
City
Nullable |
string |
City. |
State
Nullable |
string |
State or region. |
Country
Nullable |
string |
Country. |
eMail
Nullable |
string |
E-mail address. |
Phone
Nullable |
string |
Phone number. |
Fax
Nullable |
string |
Fax number. |
VATID
Nullable |
string |
VAT ID of the customer; NULL if empty. |
Locked
|
varchar(1) string |
|
BirthDate
Nullable |
dateTime |
Date of birth. |
CareOf
Nullable |
string |
Care-of (c/o) addition. |
Response example
<SqlRowSet1>
<row>
<CustKey>1001</CustKey>
<CustomerNrExternal>K-50231</CustomerNrExternal>
<CustomerOf>SHP</CustomerOf>
<Anrede>Herr</Anrede>
<Name>Max Mustermann</Name>
<Name2/>
<FirstName>Max</FirstName>
<LastName>Mustermann</LastName>
<Street>Hauptstraße</Street>
<HouseNr>12</HouseNr>
<Address>Hauptstraße 12</Address>
<ZIP>80331</ZIP>
<City>München</City>
<State>BY</State>
<Country>DE</Country>
<eMail>max@example.com</eMail>
<Phone>+49 89 123456</Phone>
<Fax/>
<Locked>N</Locked>
<BirthDate>1980-05-17T00:00:00</BirthDate>
<CareOf/>
</row>
</SqlRowSet1>
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetCRMCustomerData>
<!-- <CustKeyStart>0</CustKeyStart> -->
<!-- <Rows>500</Rows> -->
<!-- <CustomerOf>SHP</CustomerOf> -->
</ns1:pixiGetCRMCustomerData>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetCRMCustomerData>
<!-- <CustKeyStart>0</CustKeyStart> -->
<!-- <Rows>500</Rows> -->
<!-- <CustomerOf>SHP</CustomerOf> -->
</ns1:pixiGetCRMCustomerData>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
// 'CustKeyStart' => '0',
// 'Rows' => '500',
// 'CustomerOf' => 'SHP',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetCRMCustomerData', $soapArguments);
- SQL object:
- dbo.pipiGetCRMCustomerData