pixiGetOrderChanges
Returns orders that were created, changed, invoiced or scanned out within a time window, with one row per detected change.
Collects change events for orders in the time window from DateFrom (inclusive) to DateTo (exclusive) and returns them as a flat list. It is meant for polling clients that synchronise orders into an external system.
If DateFrom is not given, it defaults to the current time minus one day. If DateTo is not given, it defaults to the current time.
Depending on ChangeType, one or all of these checks run:
CORDER: order headers whoseCreateDateis in the window.Param1is empty.UORDER: order headers whoseUpdateDateis in the window.Param1is empty.CORDERL: order lines whoseCreateDateis in the window. One row per order line;Param1holds theOrderlineKey.UORDERL: order lines whoseUpdateDateis in the window. One row per order line;Param1holds theOrderlineKey.IORDER: invoices whoseInvDateis in the window. One row per order and invoice;Param1holds theInvoiceNr.SORDER: invoices whoseScanOutDateis in the window. One row per order and invoice;Param1holds theInvoiceNr.
ALL (default) runs all six checks.
Optional filters:
ShopID: for header events, the shop of the order address (AddrShopId). For line events, the shop of the order line (OrdShopID). For invoice events, the shop of the invoice (InvShopID).PaymentType: for header and line events, the payment type of the address (APayment). For invoice events, the payment type of the invoice (Payment).
Only rows with OrderNr > 0 are returned. Rows are sorted by OrderNr, then ChangeType, then Param1, all ascending.
Notes
- All reads use
NOLOCK, so uncommitted changes can appear and rows can be missed or duplicated under concurrent load. - The window is half-open (
>= DateFrom,< DateTo). Use the previousDateToas the nextDateFromto poll without gaps or overlaps. - Results are not de-duplicated. The same order can appear several times: with several change types, with several order lines or with several invoices.
CORDER/UORDERuse an inner join on the order address. Order headers without a matching address are not reported.Param1is avarchar, so it sorts as text:OrderlineKeyandInvoiceNrvalues sort alphabetically, not numerically.- An unknown
ChangeTypevalue raises no error; it simply returns an empty result. - No error rows are produced.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ChangeType
|
varchar(10) string |
ALL |
Type of change to report. Allowed values
Example: |
ShopID
|
varchar(3) string |
NULL |
Optional shop filter. It is applied to the address shop, the order line shop or the invoice shop, depending on the change type. Example: |
PaymentType
|
char(1) string |
NULL |
Optional payment type filter. It is applied to the address payment type ( Example: |
DateFrom
|
datetime dateTime |
NULL |
Start of the time window (inclusive). Defaults to the current time minus one day. Example: |
DateTo
|
datetime dateTime |
NULL |
End of the time window (exclusive). Defaults to the current time. Example: |
Result set 1 · Always (may be empty)
One row per detected change, sorted by OrderNr, ChangeType and Param1.
| Column | Type | Description |
|---|---|---|
OrderNr
Nullable |
int |
Order number of the affected order |
ChangeType
Nullable |
varchar(10) string |
Type of change: |
Timestamp
Nullable |
datetime dateTime |
Time of the change. This is the create date, update date, invoice date or scan-out date, depending on the change type. |
Param1
Nullable |
varchar(100) string |
Additional reference: |
Response example
<SqlRowSet1>
<row>
<OrderNr>100245</OrderNr>
<ChangeType>CORDER</ChangeType>
<Timestamp>2024-05-01T09:15:22</Timestamp>
</row>
<row>
<OrderNr>100245</OrderNr>
<ChangeType>CORDERL</ChangeType>
<Timestamp>2024-05-01T09:15:23</Timestamp>
<Param1>587311</Param1>
</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:pixiGetOrderChanges>
<!-- <ChangeType>ALL</ChangeType> -->
<!-- <ShopID>001</ShopID> -->
<!-- <PaymentType>V</PaymentType> -->
<!-- <DateFrom>2024-05-01T00:00:00</DateFrom> -->
<!-- <DateTo>2024-05-02T00:00:00</DateTo> -->
</ns1:pixiGetOrderChanges>
</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:pixiGetOrderChanges>
<!-- <ChangeType>ALL</ChangeType> -->
<!-- <ShopID>001</ShopID> -->
<!-- <PaymentType>V</PaymentType> -->
<!-- <DateFrom>2024-05-01T00:00:00</DateFrom> -->
<!-- <DateTo>2024-05-02T00:00:00</DateTo> -->
</ns1:pixiGetOrderChanges>
</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 = [
// 'ChangeType' => 'ALL',
// 'ShopID' => '001',
// 'PaymentType' => 'V',
// 'DateFrom' => '2024-05-01T00:00:00',
// 'DateTo' => '2024-05-02T00:00:00',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetOrderChanges', $soapArguments);
- SQL object:
- dbo.pipiGetOrderChanges