pixiGetOrder
Returns full details of one or more orders, including addresses, customer, order lines, bundle lines, invoices and customer account entries as nested XML.
Collects a set of order numbers from the three input parameters and returns one row per distinct order number with the order header fields and several nested XML documents.
Selecting orders (all parameters can be combined; the results are merged and de-duplicated):
OrderNr: used directly if it is greater than 0. It is not checked againstOrderHeader.OrderNrExternal: every order whoseOrderNrExternalmatches exactly is added.OrderNrXML: an XML document with rootOrderNrs; eachOrderNrelement adds that order number, eachOrderNrExternalelement adds all orders with this external number.
If no order number is collected, the call returns no result set at all.
Per order the row contains:
- Order header fields from
OrderHeader(shipping vendor, gift message, status, totals, references, flags,OrderType,ShipCost…). BillingAddressandShippingAddress: XML of the address referenced byAddrRef/ShipAdrRef, enriched with country names and country codes (ISO2, ISO3, Afterbuy, Plenty).Customer: XML of the customer referenced byCustRef.Orderlines: XML of all order lines with currency code (OrderCurrency), item data andPickListNr.BundleOrderlines: XML of the bundle order lines of the order.Invoices: XML of all invoices that contain at least one invoice line referencing an order line of this order; each invoice contains itsInvoiceLines.CustomerAccount: XML of customer account entries of the order's customer that either belong to one of these invoices, or have no invoice and are linked to the order via a bank match; sorted byCustomerAccountKeyascending.OnPicklist: picklist state of the order lines (None,Partial,All).VoucherID: the highestVoucherIDfound on the order lines.
The order of the rows is not defined (no ORDER BY).
Notes
- All reads use
NOLOCK; data can be uncommitted or inconsistent. - A non-existing
OrderNrstill produces a row:OrderNris filled, all header fields and XML columns are NULL. - Malformed
OrderNrXMLis silently ignored (emptyCATCH). The XML document handle is never released withsp_xml_removedocument. OnPicklistlogic:Noneif no line is on a picklist,Partialif some lines have a picklist and some do not,Allif all lines are on one or more picklists. It is NULL for orders without order lines.- Order lines and bundle lines are joined to
ItemsandCurrencywith inner joins; lines whose item no longer exists are missing from the XML. - The nested XML uses
FOR XML PATHwithout a row name, so every record is arowelement; NULL values are omitted. - Fields ending in
_OrderCurr(e.g.Price_OrderCurr,Total_OrderCurr) are duplicates of the base fields and are marked in the code to be removed; do not rely on them. - Fetching many orders at once can be expensive because of the many correlated subqueries per order.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderNr
|
int | NULL |
Internal Pixi order number. Used only if greater than 0. Example: |
OrderNrXML
|
varchar(max) xml |
NULL |
XML list of order numbers and/or external order numbers (root Example:
|
OrderNrExternal
|
varchar(50) string |
NULL |
External (shop) order number; all orders with exactly this value are returned. Example: |
Result set 1 · If at least one order number was collected from the parameters
One row per distinct order number with header fields and nested XML documents.
| Column | Type | Description |
|---|---|---|
OrderNr
|
int |
Order number. |
BillingAddress
Nullable |
xml |
Billing address ( |
ShippingAddress
Nullable |
xml |
Shipping address, same structure as |
Customer
Nullable |
xml |
Customer ( |
OrderShippingVendor
Nullable |
string |
Shipping vendor code of the order ( |
GiftMessage
Nullable |
string |
Gift message. |
ShipInstruct
Nullable |
string |
Shipping instruction. |
Discount
Nullable |
decimal |
Order discount. |
CreateDate
Nullable |
dateTime |
Creation date of the order header. |
CreateEmp
Nullable |
string |
Employee who created the order. |
UpdateEmp
Nullable |
string |
Employee who last updated the order. |
UpdateDate
Nullable |
dateTime |
Date of the last update. |
CustRef
Nullable |
int |
Customer key. |
AddrRef
Nullable |
int |
Billing address key. |
ShipAdrRef
Nullable |
int |
Shipping address key. |
OhSLocked
Nullable |
string |
Lock flag of the order header. |
Address_Remarks
Nullable |
string |
Address remarks. |
Verfahren
Nullable |
string |
Shipping procedure. |
Product
Nullable |
string |
Shipping product. |
Extras
Nullable |
string |
Shipping extras. |
Shipdate
Nullable |
dateTime |
Planned ship date. |
Shop_Note
Nullable |
string |
Note from the shop. |
ForceToPicklistIfNotFULL
Nullable |
string |
Flag: force to picklist even if not complete. |
DFType
Nullable |
string |
Direct fulfillment type of the order. |
OHMultiForceToPicklist
Nullable |
string |
Multi force-to-picklist flag. |
OHCancelAfterForcedShipOut
Nullable |
string |
Flag: cancel remaining lines after forced ship-out. |
SubShopLogo
Nullable |
string |
Sub-shop logo. |
SubShopName
Nullable |
string |
Sub-shop name. |
Referrer
Nullable |
string |
Referrer of the order. |
ChannelRef
Nullable |
string |
Sales channel reference. |
OrderNrExternal
Nullable |
string |
External (shop) order number. |
OrderStatus
Nullable |
string |
Order status. |
OrderLinesTotal
Nullable |
decimal |
Total of the order lines. |
OrderLinesDiscount
Nullable |
decimal |
Discount of the order lines. |
OrderTotal
Nullable |
decimal |
Order total. |
Orderlines
Nullable |
xml |
Order lines ( |
BundleOrderlines
Nullable |
xml |
Bundle order lines ( |
Invoices
Nullable |
xml |
Invoices of the order with VAT data, payment info, tracking ID and nested |
CustomerAccount
Nullable |
xml |
Customer account entries related to the order ( |
OrderType
Nullable |
string |
Order type (e.g. B2C). |
OnPicklist
Nullable |
varchar(10) string |
Picklist state: |
ShipCost
Nullable |
decimal |
Shipping cost of the order. |
VoucherID
Nullable |
string |
Highest voucher ID found on the order lines. |
Response example
<SqlRowSet1>
<row>
<OrderNr>100234</OrderNr>
<BillingAddress>
<row AddrKey="55012" AddrType="B">
<AddrNr>55012</AddrNr>
<FirstName>Anna</FirstName>
<LastName>Muster</LastName>
<Street>Hauptstr.</Street>
<HouseNr>5</HouseNr>
<City>München</City>
<ZIP>80331</ZIP>
<CountryCodePixi>D</CountryCodePixi>
<CountryCodeISO2>DE</CountryCodeISO2>
</row>
</BillingAddress>
<Customer>
<row CustKey="30871">
<PaymentCode>PP</PaymentCode>
<ShopID>SHP</ShopID>
</row>
</Customer>
<OrderShippingVendor>DHL</OrderShippingVendor>
<CreateDate>2024-03-11T09:42:17</CreateDate>
<OrderNrExternal>SHOP-4711</OrderNrExternal>
<OrderStatus>AUF</OrderStatus>
<OrderTotal>59.90</OrderTotal>
<Orderlines>
<row OrderlineKey="812345">
<OrderlineKey>812345</OrderlineKey>
<ArtNr>TS-100-M</ArtNr>
<ArtName>T-Shirt M</ArtName>
<Qty>2</Qty>
<Price>24.95</Price>
<Status>AUF</Status>
<OrderCurrency>EUR</OrderCurrency>
<ItemNrInt>4711</ItemNrInt>
</row>
</Orderlines>
<OrderType>B2C</OrderType>
<OnPicklist>None</OnPicklist>
<ShipCost>4.95</ShipCost>
</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:pixiGetOrder>
<!-- <OrderNr>100234</OrderNr> -->
<!-- <OrderNrXML><![CDATA[<OrderNrs><OrderNr>100234</OrderNr><OrderNr>100235</OrderNr><OrderNrExternal>SHOP-4711</OrderNrExternal></OrderNrs>]]></OrderNrXML> -->
<!-- <OrderNrExternal>SHOP-4711</OrderNrExternal> -->
</ns1:pixiGetOrder>
</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:pixiGetOrder>
<!-- <OrderNr>100234</OrderNr> -->
<!-- <OrderNrXML><![CDATA[<OrderNrs><OrderNr>100234</OrderNr><OrderNr>100235</OrderNr><OrderNrExternal>SHOP-4711</OrderNrExternal></OrderNrs>]]></OrderNrXML> -->
<!-- <OrderNrExternal>SHOP-4711</OrderNrExternal> -->
</ns1:pixiGetOrder>
</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 = [
// 'OrderNr' => '100234',
// 'OrderNrXML' => '<OrderNrs><OrderNr>100234</OrderNr><OrderNr>100235</OrderNr><OrderNrExternal>SHOP-4711</OrderNrExternal></OrderNrs>',
// 'OrderNrExternal' => 'SHOP-4711',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetOrder', $soapArguments);
- SQL object:
- dbo.pipiGetOrder