pixiGetItemStockHistory
Returns the bin stock movement history of one item, identified by item key, EAN, supplier item number or internal item number, with paging.
Returns the stock movement log of an item per bin (Lagerplatz), similar to the bin history in the Pixi client.
- Item lookup: the item is searched in
itemswith the filled identifiers combined by OR:ItemKey(if not 0/NULL),EANUPC=EAN,ItemNrSupplorItemNrInt(each only if not empty). The first match (TOP 1, no sort order) is used. - If no item is found, a single status row with
Status=Erroris returned and the call ends. - Otherwise the log entries of the item from
InvBinItemLogare loaded, numbered newest first (descending log key), and the page given byPageNumberandPageSizeis selected. - For each entry the bin name is taken from the current bin (
InvBin). If the bin no longer exists, the name comes from the bin history (InvBinHist) together with its history remark. - Stock movement operation and type names are translated into the language given by
LanguageID.SMTNameconsists of the type number, a space and the translated type name. - Entries whose
UpdateEmpisAutoExportare removed from the result after paging.
Notes
- All reads use
NOLOCK; results may contain uncommitted data. - If several identifiers are passed, they are combined with OR, so any matching item may be chosen. Pass only one identifier to get a predictable result.
- The
AutoExportfilter is applied after paging, so a page can contain fewer rows thanPageSize.TotalPagesis calculated from all log entries, including the filtered ones. TotalPagesis computed as integer division of total lines byPageSizeplus 1. If the total is an exact multiple ofPageSize, one extra (empty) page is reported.- The final select has no explicit
ORDER BY. Rows are typically, but not guaranteed, returned newest first. SMOName/SMTNameare NULL if no translation exists for the givenLanguageID.- The procedure returns code 1 when no item is found.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKey
|
int | NULL |
Internal key of the item. Ignored if NULL or 0. Example: |
EAN
|
varchar(13) string |
NULL |
EAN/UPC of the item (compared with Example: |
ItemNrSuppl
|
varchar(50) string |
NULL |
Supplier item number. Ignored if empty. Example: |
ItemNrInt
|
varchar(50) string |
NULL |
Internal item number. Ignored if empty. Example: |
LanguageID
|
int | 2 |
Language used for translating stock movement operation and type names. Example: |
PageSize
|
int | 10000 |
Number of log entries per page (before the Example: |
PageNumber
|
int | 1 |
Page to return, starting at 1. Example: |
Result set 1 · If no item matches the given identifiers
Status row reporting that no item was found.
| Column | Type | Description |
|---|---|---|
Status
|
varchar(5) string |
Always |
Message
|
varchar(44) string |
Error text. |
Result set 2 · If an item was found
One row per bin stock log entry of the item on the requested page, excluding entries by AutoExport.
| Column | Type | Description |
|---|---|---|
Qty
|
int |
Quantity of the log entry. |
UpdateEmp
|
varchar(100) string |
Employee or process that made the change. |
UpdateDate
Nullable |
datetime dateTime |
Date and time of the change. |
BinName
Nullable |
varchar(151) string |
Name of the bin; for deleted bins the historic name plus history remark. |
LocID
|
varchar(3) string |
Location (warehouse) ID of the log entry. |
ForOrderline
Nullable |
int |
Order line the movement refers to, if any. |
Reason
Nullable |
varchar(50) string |
Reason text of the movement. |
SMOName
Nullable |
varchar(512) string |
Translated name of the stock movement operation. |
SMTName
Nullable |
varchar(517) string |
Stock movement type number followed by its translated name. |
TotalPages
Nullable |
int |
Total number of pages based on all log entries of the item. |
Response example
<SqlRowSet1>
<row>
<Qty>5</Qty>
<UpdateEmp>mmueller</UpdateEmp>
<UpdateDate>2024-03-12T10:15:22.000</UpdateDate>
<BinName>A-01-03</BinName>
<LocID>001</LocID>
<ForOrderline>884512</ForOrderline>
<Reason>Picking</Reason>
<SMOName>Pick</SMOName>
<SMTName>2 Outgoing</SMTName>
<TotalPages>1</TotalPages>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| Error | No item was found for the given parameters! | None of the passed identifiers (`ItemKey`, `EAN`, `ItemNrSuppl`, `ItemNrInt`) matches an item, or none was passed. Pass at least one valid identifier. |
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:pixiGetItemStockHistory>
<!-- <ItemKey>12345</ItemKey> -->
<!-- <EAN>4006381333931</EAN> -->
<!-- <ItemNrSuppl>SUP-778899</ItemNrSuppl> -->
<!-- <ItemNrInt>ART-100200</ItemNrInt> -->
<!-- <LanguageID>2</LanguageID> -->
<!-- <PageSize>100</PageSize> -->
<!-- <PageNumber>1</PageNumber> -->
</ns1:pixiGetItemStockHistory>
</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:pixiGetItemStockHistory>
<!-- <ItemKey>12345</ItemKey> -->
<!-- <EAN>4006381333931</EAN> -->
<!-- <ItemNrSuppl>SUP-778899</ItemNrSuppl> -->
<!-- <ItemNrInt>ART-100200</ItemNrInt> -->
<!-- <LanguageID>2</LanguageID> -->
<!-- <PageSize>100</PageSize> -->
<!-- <PageNumber>1</PageNumber> -->
</ns1:pixiGetItemStockHistory>
</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 = [
// 'ItemKey' => '12345',
// 'EAN' => '4006381333931',
// 'ItemNrSuppl' => 'SUP-778899',
// 'ItemNrInt' => 'ART-100200',
// 'LanguageID' => '2',
// 'PageSize' => '100',
// 'PageNumber' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetItemStockHistory', $soapArguments);
- SQL object:
- dbo.pipiGetItemStockHistory