pixiGetOrderline
Returns order lines filtered by key, order, status, shop, payment type, dates or invoice, including prices, VAT, shipping data and available stock.
Returns order lines (Orderlines) and bundle order lines (BundleOrderlines) that match all given filters, sorted by OrderlineKey.
Input normalisation
OrderlineKeyandOrderNRwith value0and empty strings for the text and date parameters are treated as not set.RowCountNULL becomes1000.- If
OrderNRExternalcontainsDROP,ALTER,DELETE,TRUNCATEorUPDATE, the procedure returns immediately without any result set.
Filters (combined with AND, only applied when set)
OrderlineKey,OrderNR,OrderNRExternal,Status: exact match on the order line.ShopID:CustomerOFof the customer of the order line.PaymentType:APaymentof the address of the order line.OrderDateFrom/OrderDateToandUpdateDateFrom/UpdateDateTo: exclusive bounds (>and<).InvoiceNr: only lines that appear as invoice lines of the invoice with this number.
Bundle handling (ShowOrderlines)
1: bundles are not processed as normal items; all order lines, including the components of bundles, are returned.0: bundles are processed as normal items; component lines (with a bundle reference) are skipped and the bundle line itself is returned fromBundleOrderlines.- not set: taken from the setting
ProcessBundleItemsAsNormalItems(default0).
Bundle lines are selected with the same filters; the date and invoice filters are checked against the component order lines, and the OrderNR/OrderNRExternal filters only match bundle lines when bundles are processed as normal items.
Row limit: first up to RowCount normal order lines are collected (ascending OrderlineKey), then bundle lines fill the remaining quota. There is no offset; for paging, use OrderlineKey or date filters.
Computed values
FullPrice=Qty×Price;FullPriceForItemis the stored full price of the line.VATRateandPriceNoVAT(rounded to 2 decimals) come from the first invoice line of the order line if present, otherwise from the item VAT class (H,L,N) and the net price of the line.ShipDateis the scan-out date of the invoice (or the invoice it refers to).AvailStockOrderLine= stock quantity of the item at the order line's location minus the number of earlier reservations of the same item by order lines in active (non-final) states other thanEIN,FUT,FUS.ReservedCount= the smaller ofQtyandAvailStockOrderLine, but not below 0.
Bundle lines have no shipping, stock or estimated-delivery data (NULL).
Notes
- Read-only; all tables are read with
NOLOCK, so uncommitted data may appear. - The filter query is built as dynamic SQL but executed with parameters via
sp_executesql. - The keyword check on
OrderNRExternalreturns silently (no rows, no error) – an external order number that merely contains e.g.UPDATEcannot be searched. RowCountlimits the candidate lines before the final joins. Order lines without an order header, currency, item, order state or anItemLocationSpecificrow for their item and location are dropped, so fewer rows thanRowCountmay be returned.- If
ShowOrderlines= 1 (or the setting is0) and noOrderNR/OrderNRExternalfilter is set, bundle lines fromBundleOrderlinescan appear in addition to their component lines. ReservedCountis NULL for bundle lines becauseAvailStockOrderLineis NULL there.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderlineKey
|
int | NULL |
Key of a single order line; 0 means not set. Example: |
OrderNR
|
int | NULL |
Pixi order number; 0 means not set. Example: |
OrderNRExternal
|
varchar(50) string |
NULL |
External (shop) order number, exact match. Values containing DROP, ALTER, DELETE, TRUNCATE or UPDATE end the call without result. Example: |
Status
|
varchar(3) string |
NULL |
Order line status code (from Example: |
ShopID
|
varchar(3) string |
NULL |
Shop ID; matched against Example: |
PaymentType
|
char(1) string |
NULL |
Payment type; matched against Example: |
OrderDateFrom
|
datetime dateTime |
NULL |
Only lines with order date strictly after this value. Example: |
OrderDateTo
|
datetime dateTime |
NULL |
Only lines with order date strictly before this value. Example: |
UpdateDateFrom
|
datetime dateTime |
NULL |
Only lines changed strictly after this value. Example: |
UpdateDateTo
|
datetime dateTime |
NULL |
Only lines changed strictly before this value. Example: |
RowCount
|
int | 1000 |
Maximum number of candidate lines (normal lines first, then bundle lines). NULL means 1000. Example: |
InvoiceNr
|
varchar(50) string |
NULL |
Only lines contained in the invoice with this number. Example: |
ShowOrderlines
|
bit boolean |
NULL |
Controls bundle handling. NULL uses the setting Allowed values
Example: |
Result set 1 · Always, unless OrderNRExternal contains a blocked keyword (then no result set).
Matching order lines and bundle lines, sorted by OrderlineKey.
| Column | Type | Description |
|---|---|---|
OrderlineKey
Nullable |
int |
Key of the order line. |
ArtName
Nullable |
varchar(120) string |
Item name on the line. |
Qty
Nullable |
int |
Ordered quantity. |
Price
Nullable |
money decimal |
Unit price. |
Status
Nullable |
varchar(3) string |
Status code of the line. |
StatusText
Nullable |
varchar(60) string |
Text of the status from |
ItemNrExternal
Nullable |
varchar(50) string |
External item number. |
OrderNR
Nullable |
int |
Pixi order number. |
OrderNrExternal
Nullable |
varchar(50) string |
External order number. |
OrderCurrency
Nullable |
varchar(3) string |
Currency code of the order. |
OrderDate
Nullable |
datetime dateTime |
Order date (for bundle lines from a component line). |
UpdateDate
Nullable |
datetime dateTime |
Last change (for bundle lines from a component line). |
ItemRef
Nullable |
int |
Item key. |
oItemSpecialNote
Nullable |
varchar(8000) string |
Special note on the line. |
DiscountValue
Nullable |
money decimal |
Discount amount. |
DiscountPerc
Nullable |
numeric(6,2) decimal |
Discount percentage. |
FullPrice
Nullable |
money decimal |
|
FullPriceForItem
Nullable |
money decimal |
Stored full price of the line. |
VATRate
Nullable |
varchar(1) string |
VAT class: from invoice line, otherwise |
PriceNoVAT
Nullable |
money decimal |
Net unit price, rounded to 2 decimals for normal lines. |
ItemNrInt
Nullable |
varchar(50) string |
Internal item number. |
ShipDate
Nullable |
datetime dateTime |
Scan-out date of the invoice; NULL for bundle lines. |
DFShipDate
Nullable |
datetime dateTime |
Direct-fulfillment ship date. |
DFShipmentTrackingID
Nullable |
varchar(100) string |
Direct-fulfillment tracking ID. |
AvailStockOrderLine
Nullable |
int |
Stock at the line's location minus earlier reservations of the item; NULL for bundle lines. |
EstimatedDelivery
Nullable |
datetime dateTime |
Estimated delivery date of the line. |
EANUPC
Nullable |
varchar(13) string |
EAN/UPC of the item. |
ReservedCount
Nullable |
numeric decimal |
Minimum of |
Response example
<SqlRowSet1>
<row>
<OrderlineKey>154872</OrderlineKey>
<ArtName>T-Shirt Basic Blau M</ArtName>
<Qty>2</Qty>
<Price>19.9900</Price>
<Status>AUF</Status>
<StatusText>Auftrag</StatusText>
<ItemNrExternal>TS-BL-M</ItemNrExternal>
<OrderNR>200345</OrderNR>
<OrderNrExternal>SHOP-100234</OrderNrExternal>
<OrderCurrency>EUR</OrderCurrency>
<OrderDate>2024-01-15T10:22:00</OrderDate>
<UpdateDate>2024-01-15T10:25:00</UpdateDate>
<ItemRef>4711</ItemRef>
<DiscountValue>0.0000</DiscountValue>
<DiscountPerc>0.00</DiscountPerc>
<FullPrice>39.9800</FullPrice>
<FullPriceForItem>39.9800</FullPriceForItem>
<VATRate>H</VATRate>
<PriceNoVAT>16.8000</PriceNoVAT>
<ItemNrInt>100045</ItemNrInt>
<AvailStockOrderLine>5</AvailStockOrderLine>
<EANUPC>4006381333931</EANUPC>
<ReservedCount>2.0</ReservedCount>
</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:pixiGetOrderline>
<!-- <OrderlineKey>154872</OrderlineKey> -->
<!-- <OrderNR>200345</OrderNR> -->
<!-- <OrderNRExternal>SHOP-100234</OrderNRExternal> -->
<!-- <Status>AUF</Status> -->
<!-- <ShopID>SH1</ShopID> -->
<!-- <PaymentType>V</PaymentType> -->
<!-- <OrderDateFrom>2024-01-01T00:00:00</OrderDateFrom> -->
<!-- <OrderDateTo>2024-02-01T00:00:00</OrderDateTo> -->
<!-- <UpdateDateFrom>2024-01-15T08:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-01-16T08:00:00</UpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
<!-- <InvoiceNr>RE2024-001234</InvoiceNr> -->
<!-- <ShowOrderlines>1</ShowOrderlines> -->
</ns1:pixiGetOrderline>
</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:pixiGetOrderline>
<!-- <OrderlineKey>154872</OrderlineKey> -->
<!-- <OrderNR>200345</OrderNR> -->
<!-- <OrderNRExternal>SHOP-100234</OrderNRExternal> -->
<!-- <Status>AUF</Status> -->
<!-- <ShopID>SH1</ShopID> -->
<!-- <PaymentType>V</PaymentType> -->
<!-- <OrderDateFrom>2024-01-01T00:00:00</OrderDateFrom> -->
<!-- <OrderDateTo>2024-02-01T00:00:00</OrderDateTo> -->
<!-- <UpdateDateFrom>2024-01-15T08:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-01-16T08:00:00</UpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
<!-- <InvoiceNr>RE2024-001234</InvoiceNr> -->
<!-- <ShowOrderlines>1</ShowOrderlines> -->
</ns1:pixiGetOrderline>
</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 = [
// 'OrderlineKey' => '154872',
// 'OrderNR' => '200345',
// 'OrderNRExternal' => 'SHOP-100234',
// 'Status' => 'AUF',
// 'ShopID' => 'SH1',
// 'PaymentType' => 'V',
// 'OrderDateFrom' => '2024-01-01T00:00:00',
// 'OrderDateTo' => '2024-02-01T00:00:00',
// 'UpdateDateFrom' => '2024-01-15T08:00:00',
// 'UpdateDateTo' => '2024-01-16T08:00:00',
// 'RowCount' => '500',
// 'InvoiceNr' => 'RE2024-001234',
// 'ShowOrderlines' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetOrderline', $soapArguments);
- SQL object:
- dbo.pipiGetOrderline