Orders
Read
pixiGetOrderNrByOrderNrExternal
Returns the Pixi order number (OrderNr) for an external order number, or 0 if no matching order exists.
Scalar function that resolves an external order number (for example the order number of an online shop) to the internal Pixi order number.
- Searches the order lines (
Orderlines) whoseOrderNrExternalequalsOrderNrExternalexactly. - Joins each matching line to its order header (
OrderHeader) viaOrderNr, so only orders that still have a header are considered. - If several orders match, the highest
OrderNris returned. - If nothing matches,
0is returned instead of NULL.
Notes
- The external order number is read from the order lines, not from the order header. An order without lines is not found.
- Both tables are read
WITH(NOLOCK), so uncommitted data may be seen. - If the same external number was used for several orders, only the highest
OrderNris returned; other matches are silently ignored. - Passing NULL never matches and returns
0.
Tables used
Orderlines · Read
OrderHeader · Read
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderNrExternal
Required
|
varchar(50) string |
– |
External order number as stored in Example: |
Result set 1 · Always
Single value with the found order number.
| Column | Type | Description |
|---|---|---|
Result
|
int |
Highest Pixi |
Response example
<SqlRowSet1>
<row>
<Result>458921</Result>
</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:pixiGetOrderNrByOrderNrExternal>
<OrderNrExternal>SHOP-100234</OrderNrExternal>
</ns1:pixiGetOrderNrByOrderNrExternal>
</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:pixiGetOrderNrByOrderNrExternal>
<OrderNrExternal>SHOP-100234</OrderNrExternal>
</ns1:pixiGetOrderNrByOrderNrExternal>
</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 = [
'OrderNrExternal' => 'SHOP-100234',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetOrderNrByOrderNrExternal', $soapArguments);
- SQL object:
- dbo.pipiGetOrderNrByOrderNrExternal
Updated at 2026-10-30