pixiGetChangedOrderlines
Returns order line status changes from the order history since a given date, either all changes or only the latest change per order line.
Reads status changes of order lines from the order history and returns them with item and order references.
- Only history entries with
StatusChangeDate>=Sinceare returned. IfSinceisNULL, the current date and time (GETDATE()) is used. WholeHistory=1(default): every matching history entry is returned, so an order line can appear several times.WholeHistory=0: only the entry whoseStatusChangeDateequals the most recentStatusChangeDateof that order line in the whole history is returned. An order line whose latest change is older thanSincedoes not appear.- History entries are joined to the order line and to the item (inner joins). History entries without a matching order line or item are not returned.
- Identical rows are collapsed (
DISTINCT). - The result is sorted by
StatusChangeDateascending. Rowslimits the number of returned rows;0(default) orNULLmeans no limit.
Notes
- All tables are read with
NOLOCK, so uncommitted changes may be returned (dirty reads). - Passing
NULLforSinceeffectively returns only changes made at or after the moment of the call, which is usually an empty result. - The row limit is implemented with
SET ROWCOUNT; there is no offset. For incremental polling, use the highestStatusChangeDateof the last call as the nextSince. Because the filter uses>=, rows with exactly that timestamp are returned again and must be de-duplicated by the caller (e.g. byOrderlineKeyandStatusChangeDate). If more rows share the same timestamp thanRowsallows, polling can get stuck; choose a sufficiently largeRowsvalue. - With
WholeHistory=0, several rows per order line are still possible if multiple history entries share the same latestStatusChangeDatewith different status values.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
Since
Required
|
datetime dateTime |
– |
Start of the time window. Only history entries with Example: |
WholeHistory
|
bit boolean |
1 |
Controls whether all status changes or only the latest change per order line are returned. Allowed values
Example: |
Rows
|
int | 0 |
Maximum number of rows to return. Example: |
Result set 1 · Always (may be empty)
Status changes of order lines, sorted by StatusChangeDate ascending.
| Column | Type | Description |
|---|---|---|
ItemNrInt
Nullable |
string |
Internal item number of the order line's item (from |
OrderNrExternal
Nullable |
string |
External (shop) order number stored on the order line. |
Status
Nullable |
string |
Order line status recorded in this history entry. |
StatusChangeDate
|
dateTime |
Date and time of the status change. |
ItemNrExternal
Nullable |
string |
External (shop) item number stored on the order line. |
ShopID
Nullable |
string |
Shop ID stored in the history entry. |
OrderlineKey
|
int |
Key of the order line ( |
Response example
<SqlRowSet1>
<row>
<ItemNrInt>100234</ItemNrInt>
<OrderNrExternal>WEB-2024-00815</OrderNrExternal>
<Status>AUS</Status>
<StatusChangeDate>2024-03-11T09:15:22.000+01:00</StatusChangeDate>
<ItemNrExternal>SKU-4711</ItemNrExternal>
<ShopID>WEB</ShopID>
<OrderlineKey>558812</OrderlineKey>
</row>
<row>
<ItemNrInt>100877</ItemNrInt>
<OrderNrExternal>WEB-2024-00816</OrderNrExternal>
<Status>STO</Status>
<StatusChangeDate>2024-03-11T10:02:05.000+01:00</StatusChangeDate>
<ItemNrExternal>SKU-0815</ItemNrExternal>
<ShopID>WEB</ShopID>
<OrderlineKey>558820</OrderlineKey>
</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:pixiGetChangedOrderlines>
<Since>2024-03-11T00:00:00</Since>
<!-- <WholeHistory>0</WholeHistory> -->
<!-- <Rows>500</Rows> -->
</ns1:pixiGetChangedOrderlines>
</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:pixiGetChangedOrderlines>
<Since>2024-03-11T00:00:00</Since>
<!-- <WholeHistory>0</WholeHistory> -->
<!-- <Rows>500</Rows> -->
</ns1:pixiGetChangedOrderlines>
</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-03-11T00:00:00',
// 'WholeHistory' => '0',
// 'Rows' => '500',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetChangedOrderlines', $soapArguments);
- SQL object:
- dbo.pipiGetChangedOrderlines