pixiGetItemStock
Recommended
API call returns the current stock of the item, based on the provided parameters.
Since pixi version: LOU Official (6.3.0.4452) Additional notes: Select multiple items with one call:
When using **ItemXML** parameter one can get the item info for **multiple items** with one call.
Sample XML structure:
<ITEMS>
<ITEM><ITEMKEY>365</ITEMKEY></ITEM>
<ITEM><EAN>2000000000091</EAN></ITEM>
<ITEM><ITEMNRINT>54e46dd1dc2c30a39.01766786</ITEMNRINT></ITEM>
<ITEM><ITEMNRSUPPL>mg316</ITEMNRSUPPL></ITEM>
</ITEMS>
Only if parameter "LocationStock" is provided with value "1", column "Locations" is shown in the result set.
You need to provide one of these parameters for the call to return data:
- ItemKey
- EAN
- ItemNrSuppl
- ItemNrInt
- The supplier price shown in "SupplPrice" in the result set is taken from the item info.
This call recalculates the stock for the item when executed and updates "LastCalculationDate" for this item.
If you execute the API call pixiGetChangedItemStock, this item is also shown because for pixi* this item has changed.
----------
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
EAN | string | false | Filter: Item barcode. Type: varchar(50) Default value: NULL Example: 12345 Available from: LOU Official (6.3.0.4452) |
ItemKey | integer | false | Filter: Item ID. Type: int Default value: NULL Example: 12345 Available from: LOU Official (6.3.0.4452) |
ItemXML | string | false | Filter: See additional information for XML structure Type: varchar(-1) Default value: NULL Example: Available from: 18.04 (8.4.40.34047) |
ItemNrInt | string | false | Filter: Item shop number. Type: varchar(50) Default value: NULL Example: 12345 Available from: LOU Official (6.3.0.4452) |
ItemNrSuppl | string | false | Filter: Item supplier number. Type: varchar(50) Default value: NULL Example: 12345 Available from: LOU Official (6.3.0.4452) |
LocationStock | boolean | false | Return stock per location. Type: bit Default value: NULL Example: 1 Available from: LOU Official - Update 46 (6.9.46.27927) |
ExcludeBinGroups | string | false | Exclude bin groups when calculating the stock. Type: varchar(-1) Default value: NULL Example: GroupX, GroupY, GroupZ Available from: AVA Official - Update 23 (8.4.23.27873) |
OnlyEnabledItems | boolean | false | Return only if item is enabled. Type: bit Default value: 0 Example: 0 Available from: LOU Official - Update 46 (6.9.46.27927) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiGetItemStock>
<ItemKey>0</ItemKey>
<EAN>string</EAN>
<ItemNrSuppl>string</ItemNrSuppl>
<ItemNrInt>string</ItemNrInt>
<LocationStock>true</LocationStock>
<OnlyEnabledItems>true</OnlyEnabledItems>
<ExcludeBinGroups>string</ExcludeBinGroups>
<ItemXML>string</ItemXML>
</pixiGetItemStock>
</Body>
</Envelope>
Response
1. Item stock data. (parameter @LocationStock = 0)
Name | Type | Description |
---|---|---|
EANUPC | string | Item barcode. Type: varchar Available from: 25.06 (25.6.0.58802) |
ItemKey | integer | Item ID. Type: int Available from: 25.06 (25.6.0.58802) |
ItemNrInt | string | Item shop number. Type: varchar Available from: 25.06 (25.6.0.58802) |
SupplPrice | number | Supplier price of the item. Type: money Available from: 25.06 (25.6.0.58802) |
ItemNrSuppl | string | Item supplier number. Type: varchar Available from: 25.06 (25.6.0.58802) |
PhysicalStock | integer | Current physical stock (without stock on locations marked as "special location".) Type: int Available from: 25.06 (25.6.0.58802) |
AvailableStock | integer | Current available stock considering settings: "Enable reservations", "Export Physical Stock for items (not bundles)" and "Export available stock - reservations are enabled". Type: int Available from: 25.06 (25.6.0.58802) |
OpenOrderlineSum | integer | Sum of open orderline quantities for item Type: int Available from: 25.06 (25.6.0.58802) |
PhysicalStockAllLocations | integer | Current physical stock (with stock on locations marked as "special location".) Type: int Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiGetItemStockPost200TextXmlResponse>
<AvailableStock>0</AvailableStock>
<PhysicalStock>0</PhysicalStock>
<PhysicalStockAllLocations>0</PhysicalStockAllLocations>
<SupplPrice>0</SupplPrice>
<ItemKey>0</ItemKey>
<EANUPC>string</EANUPC>
<ItemNrSuppl>string</ItemNrSuppl>
<ItemNrInt>string</ItemNrInt>
<OpenOrderlineSum>0</OpenOrderlineSum>
</PixiGetItemStockPost200TextXmlResponse>
2. Extended item stock data. (parameter @LocationStock = 1)
Name | Type | Description |
---|---|---|
EANUPC | string | Item barcode. Type: varchar Available from: 25.06 (25.6.0.58802) |
ItemKey | integer | Item ID. Type: int Available from: 25.06 (25.6.0.58802) |
ItemNrInt | string | Item shop number. Type: varchar Available from: 25.06 (25.6.0.58802) |
Locations | string | Detail stock information per location. Only if parameter "LocationStock" is provided with value=1 Type: varchar Available from: 25.06 (25.6.0.58802) |
SupplPrice | number | Supplier price of the item. Type: money Available from: 25.06 (25.6.0.58802) |
ItemNrSuppl | string | Item supplier number. Type: varchar Available from: 25.06 (25.6.0.58802) |
PhysicalStock | integer | Current physical stock (without stock on locations marked as "special location".) Type: int Available from: 25.06 (25.6.0.58802) |
AvailableStock | integer | Current available stock considering settings: "Enable reservations", "Export Physical Stock for items (not bundles)" and "Export available stock - reservations are enabled". Type: int Available from: 25.06 (25.6.0.58802) |
OpenOrderlineSum | integer | Sum of open orderline quantities for item Type: int Available from: 25.06 (25.6.0.58802) |
OpenOrderlineSumLocations | string | Sum of open orderline quantities for item per location Type: varchar Available from: 25.06 (25.6.0.58802) |
PhysicalStockAllLocations | integer | Current physical stock (with stock on locations marked as "special location".) Type: int Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiGetItemStockPost200TextXmlResponse>
<AvailableStock>0</AvailableStock>
<PhysicalStock>0</PhysicalStock>
<PhysicalStockAllLocations>0</PhysicalStockAllLocations>
<SupplPrice>0</SupplPrice>
<ItemKey>0</ItemKey>
<EANUPC>string</EANUPC>
<ItemNrSuppl>string</ItemNrSuppl>
<ItemNrInt>string</ItemNrInt>
<OpenOrderlineSum>0</OpenOrderlineSum>
</PixiGetItemStockPost200TextXmlResponse>
3. Error response.
Name | Type | Description |
---|---|---|
Status | string | Status of the error response. (normaly: "Error") Type: varchar Available from: 25.06 (25.6.0.58802) |
Message | string | Error description. Type: varchar Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiGetItemStockPost400TextXmlResponse>
<Status>string</Status>
<Message>string</Message>
</PixiGetItemStockPost400TextXmlResponse>
HTTP Example
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
# echo -n '{{username}}:{{password}}' | base64 | pbcopy
Authorization: Basic {{token}}
<?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/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:pixiGetItemStock>
<EAN xsi:type="xsd:string">12345</EAN>
<ItemKey xsi:type="xsd:integer">12345</ItemKey>
<ItemXML xsi:type="xsd:string"></ItemXML>
<ItemNrInt xsi:type="xsd:string">12345</ItemNrInt>
<ItemNrSuppl xsi:type="xsd:string">12345</ItemNrSuppl>
<LocationStock xsi:type="xsd:boolean">1</LocationStock>
<ExcludeBinGroups xsi:type="xsd:string">GroupX, GroupY, GroupZ</ExcludeBinGroups>
<OnlyEnabledItems xsi:type="xsd:boolean">0</OnlyEnabledItems>
</ns1:pixiGetItemStock>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiGetItemStock', [
'EAN' => '12345', // string
'ItemKey' => '12345', // integer
'ItemXML' => '', // string
'ItemNrInt' => '12345', // string
'ItemNrSuppl' => '12345', // string
'LocationStock' => '1', // boolean
'ExcludeBinGroups' => 'GroupX, GroupY, GroupZ', // string
'OnlyEnabledItems' => '0', // boolean
]);
function getPixiSoapClientResponse(string $method, array $arguments = [])
{
$soapArguments = [];
foreach ($arguments as $key => $value) {
$soapArguments[] = new SoapVar($value, null, '', '', $key);
}
$soapClient = new SoapClient(null, [
'login' => '...',
'password' => '...',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
]);
return $soapClient->__call($method, $soapArguments);
}