pixiGetOrderNrByAddress
Returns one order number whose order lines reference the given address key as billing or shipping address.
Looks up an order number for an address key. According to the code comment, it is used for desktop notifications.
- Searches the table
Orderlinesfor rows whereAddrRef(billing address) orShipAdrRef(shipping address) equals@AddrKey. - Only rows with
OrderNr > 0are considered. - Returns at most one row (
TOP 1) with the columnOrderNr.
If no matching order line exists, the result set is empty.
Notes
TOP 1is used withoutORDER BY. If several orders reference the same address, which order number is returned is not defined and can change between calls.- The table is read
WITH (NOLOCK), so uncommitted data may be visible. - The lookup works on order lines, not on an order header table. Orders without order lines are not found.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
AddrKey
Required
|
int | – |
Address key. It is compared with the billing address reference Example: |
Result set 1 · Always; contains zero or one row.
The order number found for the address key.
| Column | Type | Description |
|---|---|---|
OrderNr
|
int |
Order number (always greater than 0). |
Response example
<SqlRowSet1>
<row>
<OrderNr>250117</OrderNr>
</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:pixiGetOrderNrByAddress>
<AddrKey>104523</AddrKey>
</ns1:pixiGetOrderNrByAddress>
</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:pixiGetOrderNrByAddress>
<AddrKey>104523</AddrKey>
</ns1:pixiGetOrderNrByAddress>
</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 = [
'AddrKey' => '104523',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetOrderNrByAddress', $soapArguments);
- SQL object:
- dbo.pipiGetOrderNrByAddress