pixiGetItemInfo2
Returns master data, prices, stock, tags and supplier information for one or more items found by item key, EAN, item numbers or an XML list.
Looks up items and returns one row per found item with master data, prices, stock and tags.
Input normalisation
ItemKey= 0 and empty strings inItemNrInt,EANUPC,ItemNrSuppl,ItemXMLandInternalItemNumberare treated as not given. An emptyLocIDis treated as NULL.- If none of
ItemKey,ItemNrInt,EANUPC,ItemNrSuppl,ItemXMLorInternalItemNumberis given, the call returns a single error row (Error,ErrorMsg).LocIDalone is not enough.
Item search
- The single parameters and every
/ITEMS/ITEMelement ofItemXMLform a list of search criteria. Spaces are removed fromITEMKEYin the XML. - Items are searched in the item code table and all hits are combined (logical OR, duplicates removed):
ItemKeymatches the item ID,EANUPC/EANmatches a code of type 1 (EAN),ItemNrIntmatches a code of type 2,InternalItemNumbermatches a code of type 3,ItemNrSupplmatches a code of type 4.
Output
- One row per found item, sorted by
ItemKey. - If
LocIDis given,MinStockQty,Quantity,SafetyStockandTargetStockcome from the location-specific item data of that location; otherwise (or if there is no such data)MinStockQtyandQuantitycome from the item master andSafetyStock/TargetStockare 0. - With
ConsiderFavouriteSupplier= 1, price, supplier number, supplier item number, EAN and minimum order quantity are taken from the active preferred supplier entry (supplier not disabled), falling back to the item master. With 0 (default),MinOrderQtyandEANUPCcome from the supplier entry of the item's main supplier, falling back to the item master. VATLevelmaps the VAT rate code 1/2/3 toMwSt_High/MwSt_Low/MwSt_Null.ItemTAGslists all tags of the item separated by|;ABCcontains the system tagA,BorCof the item.
Notes
- All reads use
NOLOCK, so uncommitted data may be returned. - The search runs entirely over the item code table: an item is only found by
ItemKeyif it has at least one item code entry. - Although
ConsiderFavouriteSupplieris commented as "Not used anymore", the code still evaluates it. With value 1 and no active preferred supplier,MinOrderQtyis 0. - The output joins can produce more than one row per item, e.g. if an item has several internal item numbers (code type 3), several supplier entries for the main supplier, several preferred suppliers or several of the system tags
A/B/C. ITEMKEYvalues in the XML are converted toint; a non-numeric value causes a SQL conversion error. An invalid XML document also causes a SQL error.ItemTAGsis read from the tag assignment tableTagMatch, whileABCis read fromItemTagMatching;ItemTAGsis NULL if the item has no tags.VATLevelis NULL for VAT rate codes other than 1, 2 and 3.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKey
|
int | NULL |
Internal item key. 0 is treated as not given. Example: |
ItemNrInt
|
varchar(50) string |
NULL |
Internal item number (item code type 2). Empty string is treated as not given. Example: |
EANUPC
|
varchar(13) string |
NULL |
EAN/UPC of the item (item code type 1). Empty string is treated as not given. Example: |
ItemNrSuppl
|
varchar(50) string |
NULL |
Supplier item number (item code type 4). Empty string is treated as not given. Example: |
LocID
|
varchar(3) string |
NULL |
Location (warehouse) ID. If given, stock quantity, minimum stock, safety stock and target stock are taken from the location-specific item data. Not a search criterion. Example: |
ItemXML
|
varchar(max) xml |
NULL |
XML list of items to look up. Each Example:
|
InternalItemNumber
|
varchar(50) string |
NULL |
Internal item number (item code type 3). Empty string is treated as not given. Example: |
ConsiderFavouriteSupplier
|
bit boolean |
0 |
If 1, supplier price, supplier number, supplier item number, EAN and minimum order quantity are taken from the active preferred supplier. Commented as no longer used, but still evaluated by the code. Allowed values
Example: |
Response
Result set 1 · If none of the search parameters is given
Error row.
| Column | Type | Description |
|---|---|---|
Error
|
varchar(5) string |
Constant |
ErrorMsg
|
varchar(37) string |
Error message text. |
Result set 2 · If at least one search parameter is given
One row per found item, sorted by ItemKey.
| Column | Type | Description |
|---|---|---|
ItemKey
|
int |
Internal item key. |
SupplPrice
Nullable |
money decimal |
Purchase price (preferred supplier if requested, otherwise item master). |
ItemName
Nullable |
string |
Item name. |
VPE
|
decimal |
Packaging unit, 0 if not set. |
OrderUnit
|
decimal |
Order unit, 0 if not set. |
MinStockQty
Nullable |
int |
Minimum stock (location-specific if |
MinOrderQty
|
int |
Minimum order quantity, 0 if not set. |
SupplNr
Nullable |
varchar(4) string |
Supplier number. |
Category
Nullable |
string |
Text of the item's configuration type. |
ItemNrInt
Nullable |
string |
Internal item number. |
ItemNrSuppl
|
varchar(50) string |
Supplier item number, empty string if not set. |
Quantity
Nullable |
int |
Stock quantity (location quantity if |
PriceVK
Nullable |
decimal |
Sales price. |
VATLevel
Nullable |
nvarchar(9) string |
VAT level: |
Enabled
Nullable |
boolean |
Whether the item is enabled. |
ItemTAGs
Nullable |
nvarchar(1000) string |
All tags of the item separated by |
EANUPC
Nullable |
varchar(13) string |
EAN/UPC (preferred supplier, main supplier entry or item master). |
ABC
|
string |
ABC classification from system tag |
ExportEstimatedDelivery
Nullable |
string |
Estimated delivery information for export. |
PicLinkLarge
Nullable |
string |
Link to the large item picture. |
PicLinkSmall
Nullable |
string |
Link to the small item picture. |
InternalItemNumber
Nullable |
string |
Item code of type 3 (internal item number). |
SafetyStock
|
int |
Location-specific safety stock, 0 if not available. |
TargetStock
|
int |
Location-specific target stock, 0 if not available. |
ItemDescription
Nullable |
string |
Item description. |
Response example
<SqlRowSet1>
<row>
<ItemKey>4711</ItemKey>
<SupplPrice>12.5000</SupplPrice>
<ItemName>Trekking Backpack 40L</ItemName>
<VPE>1</VPE>
<OrderUnit>1</OrderUnit>
<MinStockQty>5</MinStockQty>
<MinOrderQty>10</MinOrderQty>
<SupplNr>L001</SupplNr>
<Category>Standard</Category>
<ItemNrInt>ART-10045</ItemNrInt>
<ItemNrSuppl>SUP-998877</ItemNrSuppl>
<Quantity>42</Quantity>
<PriceVK>49.9900</PriceVK>
<VATLevel>MwSt_High</VATLevel>
<Enabled>1</Enabled>
<ItemTAGs>A|Outdoor|Sale</ItemTAGs>
<EANUPC>4006381333931</EANUPC>
<ABC>A</ABC>
<ExportEstimatedDelivery>2-3 days</ExportEstimatedDelivery>
<PicLinkLarge>https://shop.example.com/img/4711_l.jpg</PicLinkLarge>
<PicLinkSmall>https://shop.example.com/img/4711_s.jpg</PicLinkSmall>
<InternalItemNumber>INT-00045</InternalItemNumber>
<SafetyStock>0</SafetyStock>
<TargetStock>0</TargetStock>
<ItemDescription>Lightweight trekking backpack with rain cover.</ItemDescription>
</row>
</SqlRowSet1>
Error messages
| Status | Message | Cause |
|---|---|---|
| Error | Please specify at least one parameter | None of `ItemKey`, `ItemNrInt`, `EANUPC`, `ItemNrSuppl`, `ItemXML` or `InternalItemNumber` was given (or all were 0/empty). Pass at least one search criterion. |
Examples
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:pixiGetItemInfo2>
<!-- <ItemKey>4711</ItemKey> -->
<!-- <ItemNrInt>ART-10045</ItemNrInt> -->
<!-- <EANUPC>4006381333931</EANUPC> -->
<!-- <ItemNrSuppl>SUP-998877</ItemNrSuppl> -->
<!-- <LocID>001</LocID> -->
<!-- <ItemXML><![CDATA[<ITEMS><ITEM><ITEMKEY>4711</ITEMKEY><ITEMNRSUPPL>SUP-998877</ITEMNRSUPPL><ITEMNRINT>ART-10045</ITEMNRINT><EAN>4006381333931</EAN><INTERNALITEMNUMBER>INT-00045</INTERNALITEMNUMBER></ITEM><ITEM><ITEMKEY></ITEMKEY><ITEMNRSUPPL></ITEMNRSUPPL><ITEMNRINT>ART-10046</ITEMNRINT><EAN></EAN><INTERNALITEMNUMBER></INTERNALITEMNUMBER></ITEM></ITEMS>]]></ItemXML> -->
<!-- <InternalItemNumber>INT-00045</InternalItemNumber> -->
<!-- <ConsiderFavouriteSupplier>0</ConsiderFavouriteSupplier> -->
</ns1:pixiGetItemInfo2>
</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:pixiGetItemInfo2>
<!-- <ItemKey>4711</ItemKey> -->
<!-- <ItemNrInt>ART-10045</ItemNrInt> -->
<!-- <EANUPC>4006381333931</EANUPC> -->
<!-- <ItemNrSuppl>SUP-998877</ItemNrSuppl> -->
<!-- <LocID>001</LocID> -->
<!-- <ItemXML><![CDATA[<ITEMS><ITEM><ITEMKEY>4711</ITEMKEY><ITEMNRSUPPL>SUP-998877</ITEMNRSUPPL><ITEMNRINT>ART-10045</ITEMNRINT><EAN>4006381333931</EAN><INTERNALITEMNUMBER>INT-00045</INTERNALITEMNUMBER></ITEM><ITEM><ITEMKEY></ITEMKEY><ITEMNRSUPPL></ITEMNRSUPPL><ITEMNRINT>ART-10046</ITEMNRINT><EAN></EAN><INTERNALITEMNUMBER></INTERNALITEMNUMBER></ITEM></ITEMS>]]></ItemXML> -->
<!-- <InternalItemNumber>INT-00045</InternalItemNumber> -->
<!-- <ConsiderFavouriteSupplier>0</ConsiderFavouriteSupplier> -->
</ns1:pixiGetItemInfo2>
</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' => '4711',
// 'ItemNrInt' => 'ART-10045',
// 'EANUPC' => '4006381333931',
// 'ItemNrSuppl' => 'SUP-998877',
// 'LocID' => '001',
// 'ItemXML' => '<ITEMS><ITEM><ITEMKEY>4711</ITEMKEY><ITEMNRSUPPL>SUP-998877</ITEMNRSUPPL><ITEMNRINT>ART-10045</ITEMNRINT><EAN>4006381333931</EAN><INTERNALITEMNUMBER>INT-00045</INTERNALITEMNUMBER></ITEM><ITEM><ITEMKEY></ITEMKEY><ITEMNRSUPPL></ITEMNRSUPPL><ITEMNRINT>ART-10046</ITEMNRINT><EAN></EAN><INTERNALITEMNUMBER></INTERNALITEMNUMBER></ITEM></ITEMS>',
// 'InternalItemNumber' => 'INT-00045',
// 'ConsiderFavouriteSupplier' => '0',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetItemInfo2', $soapArguments);
Tables used
- SQL object:
- dbo.pipiGetItemInfo2