pixiReadPOSItems
Returns POS (point of sale) receipt lines from `POSitem2`, filtered by key or by the create/update date of the POS header, with optional key-based paging.
Reads POS item rows (lines of point-of-sale receipts). If POSItemKey is not passed, it is treated as 0. The first matching branch decides the filter:
- Create or update date – if
CreateAndUpdateDateFromorCreateAndUpdateDateTois set: items whose POS header (POSheader2) was created or updated in the range. A row matches the lower bound ifPHCreateDateorPHUpdateDateis>=the from value, and the upper bound ifPHCreateDateorPHUpdateDateis<the to value. - Create date – else if
CreateDateFromorCreateDateTois set: headerPHCreateDate>=from and<to. - Update date – else if
UpdateDateFromorUpdateDateTois set: headerPHUpdateDate>=from and<to. - Key range – else if
RowCountis passed: all items withPOSitemKeygreater thanPOSItemKey. - Single item – otherwise: the item with exactly
POSitemKey=POSItemKey.
In branches 1–4 only items with POSitemKey > POSItemKey are returned, sorted by POSitemKey ascending. Branches 1–3 only return items that have a matching POS header (inner join).
RowCount limits the number of returned rows (if not 0). For paging, pass the last received POSitemKey as POSItemKey in the next call.
Notes
- All reads use
NOLOCK; uncommitted data may be returned. - The row limit is applied with
SET ROWCOUNT. - Calling without any parameter falls into the single-item branch with key
0and normally returns an empty result. - Passing
RowCount=0still selects the key-range branch (the value is not NULL) but applies no row limit, so all items abovePOSItemKeyare returned. - Date upper bounds are exclusive (
<). In the combined create/update filter the bounds are evaluated independently, so a row can match the from bound via one date and the to bound via the other. - The date filters refer to the POS header, not to the item itself.
- The final "no data" branch in the code is unreachable because
POSItemKeyis never NULL after the default handling.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
POSItemKey
|
int | NULL |
Key of a POS item. Exact match in the single-item branch; otherwise only items with a greater key are returned (paging start). NULL is treated as 0. Example: |
CreateDateFrom
|
datetime dateTime |
NULL |
Lower bound (inclusive) for the creation date of the POS header. Example: |
CreateDateTo
|
datetime dateTime |
NULL |
Upper bound (exclusive) for the creation date of the POS header. Example: |
UpdateDateFrom
|
datetime dateTime |
NULL |
Lower bound (inclusive) for the update date of the POS header. Ignored if a create-date or combined filter is set. Example: |
UpdateDateTo
|
datetime dateTime |
NULL |
Upper bound (exclusive) for the update date of the POS header. Ignored if a create-date or combined filter is set. Example: |
CreateAndUpdateDateFrom
|
datetime dateTime |
NULL |
Lower bound (inclusive) matched against the header's create or update date. Takes precedence over all other date filters. Example: |
CreateAndUpdateDateTo
|
datetime dateTime |
NULL |
Upper bound (exclusive) matched against the header's create or update date. Takes precedence over all other date filters. Example: |
RowCount
|
int | NULL |
Maximum number of rows (0 or NULL = no limit). If passed without date filters, switches to the key-range branch ( Example: |
Result set 1 · Always (one of the filter branches); may be empty.
POS item rows from POSitem2.
| Column | Type | Description |
|---|---|---|
POSitemKey
|
int |
Primary key of the POS item. |
PIheaderRef
Nullable |
int |
Reference to the POS header ( |
PIitemRef
Nullable |
int |
Reference to the Artikel. |
PIeanUpc
Nullable |
string |
EAN/UPC of the Artikel. |
PIitemNrInt
Nullable |
string |
Internal item number. |
PIqty
Nullable |
decimal |
Quantity. |
PIprice
Nullable |
decimal |
Unit price. |
PIdiscount
Nullable |
decimal |
Discount. |
PIendPrice
Nullable |
decimal |
Final price after discount. |
PIvatInPrice
Nullable |
decimal |
VAT contained in the price. |
PIstockReduced
Nullable |
boolean |
Indicates whether stock was reduced for this line. |
PIstockBinRef
Nullable |
int |
Reference to the Lagerplatz used. |
PIstockReducedWithRef
Nullable |
int |
Reference to the stock booking used for the reduction. |
PIcustomerTookItem
Nullable |
boolean |
Indicates whether the customer took the item directly. |
PIstockAfter
Nullable |
decimal |
Stock after the booking. |
ScanCode
Nullable |
string |
Scanned code. |
VatPercent
Nullable |
decimal |
VAT rate in percent. |
ItemTotal
Nullable |
decimal |
Line total. |
ItemNameChanged
Nullable |
boolean |
Indicates whether the item name was changed at the POS. |
ItemNameNew
Nullable |
string |
Changed item name. |
BundleOrderlineRef
Nullable |
int |
Reference to the bundle orderline. |
OrderlineKey
Nullable |
int |
Key of the related orderline. |
SerialNr
Nullable |
string |
Serial number. |
Response example
<SqlRowSet1>
<row>
<POSitemKey>15231</POSitemKey>
<PIheaderRef>4102</PIheaderRef>
<PIitemRef>8812</PIitemRef>
<PIeanUpc>4006381333931</PIeanUpc>
<PIitemNrInt>ART-10023</PIitemNrInt>
<PIqty>2</PIqty>
<PIprice>19.99</PIprice>
<PIdiscount>0</PIdiscount>
<PIendPrice>19.99</PIendPrice>
<PIvatInPrice>3.19</PIvatInPrice>
<PIstockReduced>1</PIstockReduced>
<PIstockBinRef>311</PIstockBinRef>
<PIstockReducedWithRef>99821</PIstockReducedWithRef>
<PIcustomerTookItem>1</PIcustomerTookItem>
<PIstockAfter>14</PIstockAfter>
<ScanCode>4006381333931</ScanCode>
<VatPercent>19</VatPercent>
<ItemTotal>39.98</ItemTotal>
<ItemNameChanged>0</ItemNameChanged>
<ItemNameNew/>
<BundleOrderlineRef>0</BundleOrderlineRef>
<OrderlineKey>552310</OrderlineKey>
<SerialNr/>
</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:pixiReadPOSItems>
<!-- <POSItemKey>15230</POSItemKey> -->
<!-- <CreateDateFrom>2024-03-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-04-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-03-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-04-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-03-01T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-04-01T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadPOSItems>
</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:pixiReadPOSItems>
<!-- <POSItemKey>15230</POSItemKey> -->
<!-- <CreateDateFrom>2024-03-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-04-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-03-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-04-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-03-01T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-04-01T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadPOSItems>
</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 = [
// 'POSItemKey' => '15230',
// 'CreateDateFrom' => '2024-03-01T00:00:00',
// 'CreateDateTo' => '2024-04-01T00:00:00',
// 'UpdateDateFrom' => '2024-03-01T00:00:00',
// 'UpdateDateTo' => '2024-04-01T00:00:00',
// 'CreateAndUpdateDateFrom' => '2024-03-01T00:00:00',
// 'CreateAndUpdateDateTo' => '2024-04-01T00:00:00',
// 'RowCount' => '500',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReadPOSItems', $soapArguments);
- SQL object:
- dbo.pipiReadPOSItems