pixiSetStockMultiple
Used for multiple stock operations with one call
Since pixi version: LOU Official (6.3.0.4452) Additional notes: Complete XML structure with default values
<ITEMSTOCK>
<ITEM>
<EANUPC></EANUPC>
<ITEMNRINT></ITEMNRINT>
<ITEMKEY></ITEMKEY>
<OVERWRITESTOCK></OVERWRITESTOCK>
<INVBINS>
<INVBIN>
<BINNAME></BINNAME>
<STOCK></STOCK> <!-- This tag should not be used! -->
<STOCKADD></STOCKADD>
<STOCKREMOVE></STOCKREMOVE>
<NEUTRALINVENTORY></NEUTRALINVENTORY>
<SMTREF>4/2</SMTREF>
<SMOREF>2/1 (TakeOut/PutToStock)</SMOREF>
<BATCHNUMBER></BATCHNUMBER>
<BESTBEFOREDATE></BESTBEFOREDATE>
</INVBIN>
</INVBINS>
</ITEM>
</ITEMSTOCK>
----------
XML tags used for **identifying the item**:
- **EANUPC** -- Item barcode (Only EANUPC from ITEMS (current supplier) can be used. The recommendation is to use some other item code/itemkey that is unique for the item.)
- **ITEMNRINT** -- Shop item number
- **ITEMKEY** -- pixi* item ID
- **BATCHNUMBER** -- Item batch number (mandatory when the item has tag "BN")
- **BESTBEFOREDATE** -- Item best before date (mandatory when the item has tag "BBD")
XML tags for performing the **stock operations**:
- **BINNAME** - Bin name
- **STOCKADD** - Add the stock for selected item on selected bin
- **STOCKREMOVE** - Remove the stock for selected item on selected bin
- **SMTREF** - Stock movement type ID
- **SMOREF** - Stock movement operation ID
XML tags to be used with **extreme caution**:
- **OVERWRITESTOCK** - Stock for selected item will be removed from all bins (0/1)
- **NEUTRALINVENTORY** - deprecated from pixi* ELI on
- ! **STOCK** ! - Set stock for selected item on selected bin to this exact number
- *Important*: As this tag might cause issues, we do not recommend using it at all! Instead, use STOCKADD or STOCKREMOVE.
*Important*: If same Bin name exists on two or more locations, do not use this API, since it will produce strange results with such Bins.
----------
**Samples**
**Put to stock:** quantity 5 for item (EAN:3184340092516) to bin "300"
<ITEMSTOCK>
<ITEM>
<EANUPC>3184340092516</EANUPC>
<INVBINS>
<INVBIN>
<BINNAME>300</BINNAME>
<STOCKADD>5</STOCKADD>
</INVBIN>
</INVBINS>
</ITEM>
</ITEMSTOCK>
**Take from stock:** quantity 2 for item (ITEMNRINT:2000040700005) from bin:"E-2-3" and quantity 3 from bin: "C-2-5"
<ITEMSTOCK>
<ITEM>
<ITEMNRINT>2000040700005</ITEMNRINT>
<INVBINS>
<INVBIN>
<BINNAME>E-2-3</BINNAME>
<STOCKREMOVE>2</STOCKREMOVE>
</INVBIN>
<INVBIN>
<BINNAME>C-2-5</BINNAME>
<STOCKREMOVE>3</STOCKREMOVE>
</INVBIN>
</INVBINS>
</ITEM>
</ITEMSTOCK>
**Relocate:** quantity 2 for item (ITEMKEY:364) with batch number:"BATCH 001" from bin: "E-1-2" to bin:"C-2-5"
<ITEMSTOCK>
<ITEM>
<ITEMKEY>364</ITEMKEY>
<INVBINS>
<INVBIN>
<BINNAME>E-1-2</BINNAME>
<STOCKREMOVE>2</STOCKREMOVE>
<BATCHNUMBER>BATCH 001</BATCHNUMBER>
</INVBIN>
<INVBIN>
<BINNAME>C-2-5</BINNAME>
<STOCKADD>2</STOCKADD>
<BATCHNUMBER>BATCH 001</BATCHNUMBER>
</INVBIN>
</INVBINS>
</ITEM>
</ITEMSTOCK>
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
XML | string | false | The same as ParameterXML Type: varchar(-1) Default value: NULL Example: Available from: LOU Official (6.3.0.4452) |
Username | string | false | User that executed the stock operation Type: varchar(50) Default value: pipiSetStock Example: API user Available from: LOU Official (6.3.0.4452) |
ParameterXML | string | false | XML with stock operation values Type: varchar(-1) Default value: NULL Example: Check Additional information Available from: LOU Official (6.3.0.4452) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiSetStockMultiple>
<XML>string</XML>
<ParameterXML>string</ParameterXML>
<Username>string</Username>
</pixiSetStockMultiple>
</Body>
</Envelope>
Response
1. Result set with row specific errors.
Name | Type | Description |
---|---|---|
EAN | string | Item barcode. Type: varchar Available from: 25.06 (25.6.0.58802) |
Error | string | Description of the error status. Type: varchar Available from: 25.06 (25.6.0.58802) |
STOCK | integer | XML input value for this item/bin Type: int Available from: 25.06 (25.6.0.58802) |
Reason | string | Always empty string Type: varchar Available from: 25.06 (25.6.0.58802) |
SMOREF | integer | Stock movement operation ID Type: int Available from: 25.06 (25.6.0.58802) |
SMTREF | integer | Stock movement type ID Type: int Available from: 25.06 (25.6.0.58802) |
status | integer | Execution status (1-OK/0-ERROR), on error (0) read message in Error field, on success (1) read message in SuccessMessage field Type: int Available from: 25.06 (25.6.0.58802) |
BINNAME | string | Bin name. Type: varchar Available from: 25.06 (25.6.0.58802) |
ITEMKEY | integer | pixi* item ID Type: int Available from: 25.06 (25.6.0.58802) |
STOCKADD | integer | XML input value for this item/bin Type: int Available from: 25.06 (25.6.0.58802) |
ITEMNRINT | string | Shop item number. Type: varchar Available from: 25.06 (25.6.0.58802) |
BATCHNUMBER | string | Item batch number Type: varchar Available from: 25.06 (25.6.0.58802) |
STOCKREMOVE | integer | XML input value for this item/bin Type: int Available from: 25.06 (25.6.0.58802) |
SuccessMessage | string | Description of the success status Type: datetime Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSetStockMultiplePost200TextXmlResponse>
<ITEMNRINT>string</ITEMNRINT>
<ITEMKEY>0</ITEMKEY>
<EAN>string</EAN>
<BINNAME>string</BINNAME>
<STOCK>0</STOCK>
<STOCKADD>0</STOCKADD>
<STOCKREMOVE>0</STOCKREMOVE>
<Error>string</Error>
<Reason>string</Reason>
<SMOREF>0</SMOREF>
<SMTREF>0</SMTREF>
<status>0</status>
<BATCHNUMBER>string</BATCHNUMBER>
<SuccessMessage>string</SuccessMessage>
</PixiSetStockMultiplePost200TextXmlResponse>
2. Status output
Name | Type | Description |
---|---|---|
Status | string | Execution status (OK/ERROR) Type: varchar Available from: 25.06 (25.6.0.58802) |
StatusMessage | string | Description of the status Type: varchar Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSetStockMultiplePost200TextXmlResponse>
<ITEMNRINT>string</ITEMNRINT>
<ITEMKEY>0</ITEMKEY>
<EAN>string</EAN>
<BINNAME>string</BINNAME>
<STOCK>0</STOCK>
<STOCKADD>0</STOCKADD>
<STOCKREMOVE>0</STOCKREMOVE>
<Error>string</Error>
<Reason>string</Reason>
<SMOREF>0</SMOREF>
<SMTREF>0</SMTREF>
<status>0</status>
<BATCHNUMBER>string</BATCHNUMBER>
<SuccessMessage>string</SuccessMessage>
</PixiSetStockMultiplePost200TextXmlResponse>
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:pixiSetStockMultiple>
<XML xsi:type="xsd:string"></XML>
<Username xsi:type="xsd:string">API user</Username>
<ParameterXML xsi:type="xsd:string">Check Additional information</ParameterXML>
</ns1:pixiSetStockMultiple>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiSetStockMultiple', [
'XML' => '', // string
'Username' => 'API user', // string
'ParameterXML' => 'Check Additional information', // string
]);
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);
}