pixiGetChangedCustomers
Returns customers created or changed since a given point in time, optionally up to an end date, ordered by change date and limited to a maximum row count.
Reads the customer master table and returns all customers whose change date lies in the requested time window. This call is typically used for incremental (delta) synchronisation of customers into an external system.
- The change date of a customer is its
UpdateDate, or itsCreateDateif the customer has never been updated. This value is also returned as columnUpdateDate. - If
Tois omitted or empty, all customers with a change date>= Sinceare returned. - If
Tois set, customers with a change date betweenSinceandTo(both inclusive) are returned. - The result is sorted by change date in ascending order (oldest change first).
- At most
Rowcountrows are returned (default1000).
For each customer the call returns the customer key, the keys of the billing and shipping address, a shipping lock flag, the CustomerOf value, e-mail address and name.
Notes
- The table is read
WITH (NOLOCK), so uncommitted changes may be returned. - The limit is applied with
SET ROWCOUNT. PassingRowcount=0removes the limit and returns all matching rows. - The check for an empty
Tocompares against'', which SQL Server converts to1900-01-01 00:00:00. Passing exactly this date asTois therefore treated like no end date. - Paging pattern: use the highest returned
UpdateDateas the nextSince. Because the filter is>=, the last record(s) are returned again; deduplicate byCustKey. There is no secondary sort key, so if more thanRowcountcustomers share the same change date, the loop cannot advance past them – increaseRowcountin that case. ShipLockis1when the customer fieldSLockedisY, otherwise0.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
Since
Required
|
datetime dateTime |
– |
Start of the time window (inclusive). Customers whose change date ( Example: |
To
|
datetime dateTime |
NULL |
Optional end of the time window (inclusive). If omitted or empty, there is no upper limit. Example: |
Rowcount
|
int | 1000 |
Maximum number of rows to return. Example: |
Result set 1 · Always (may be empty)
Customers changed in the requested time window, ordered by change date ascending.
| Column | Type | Description |
|---|---|---|
CustKey
|
int |
Key of the customer. |
AddrKey
Nullable |
int |
Key of the customer's main (billing) address ( |
ShipAddrKey
Nullable |
int |
Key of the customer's shipping address ( |
ShipLock
|
bit boolean |
|
CustomerOf
Nullable |
string |
Value of the customer field |
eMail
Nullable |
string |
E-mail address of the customer ( |
Name
Nullable |
string |
Name of the customer ( |
UpdateDate
|
datetime dateTime |
Change date: |
Response example
<SqlRowSet1>
<row>
<CustKey>10452</CustKey>
<AddrKey>23011</AddrKey>
<ShipAddrKey>23012</ShipAddrKey>
<ShipLock>false</ShipLock>
<CustomerOf>SHOP1</CustomerOf>
<eMail>anna.mueller@example.de</eMail>
<Name>Anna Müller</Name>
<UpdateDate>2024-05-02T09:14:33.217</UpdateDate>
</row>
<row>
<CustKey>10988</CustKey>
<AddrKey>24170</AddrKey>
<ShipAddrKey>24170</ShipAddrKey>
<ShipLock>true</ShipLock>
<CustomerOf>SHOP1</CustomerOf>
<eMail>info@beispiel-gmbh.de</eMail>
<Name>Beispiel GmbH</Name>
<UpdateDate>2024-05-02T11:40:05.003</UpdateDate>
</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:pixiGetChangedCustomers>
<Since>2024-05-01T00:00:00</Since>
<!-- <To>2024-05-31T23:59:59</To> -->
<!-- <Rowcount>500</Rowcount> -->
</ns1:pixiGetChangedCustomers>
</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:pixiGetChangedCustomers>
<Since>2024-05-01T00:00:00</Since>
<!-- <To>2024-05-31T23:59:59</To> -->
<!-- <Rowcount>500</Rowcount> -->
</ns1:pixiGetChangedCustomers>
</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 = [
'Since' => '2024-05-01T00:00:00',
// 'To' => '2024-05-31T23:59:59',
// 'Rowcount' => '500',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetChangedCustomers', $soapArguments);
- SQL object:
- dbo.pipiGetChangedCustomers