pixiSetStock
API call to set stock of item in bin.
Since pixi version: LOU Official (6.3.0.4452) Additional notes: Parameters "BatchNumber" and "BestBeforeDate" are mandatory if items are tagged with those tags. If parameter "Username" is not provided at all, "pipiSetStock" is used by default. If it is provided but it is empty, the "Updated By" column in the Bin History stays empty.
Use the following API calls to get information about possible values for:
- SMORef = pixiGetStockMovementOperations (SMOKey)
- SMTref = pixiGetStockMovementTypes (SMTKey) or pixiGetStockMovementTypesForOperation (SMTKey)
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
LocId | string | true | Bin location(in case of same binnames on locations). Type: varchar(3) Default value: Example: abcdefg Available from: LOU Official (6.3.0.4452) |
EanUpc | string | true | EAN of the updated item. Type: varchar(13) Default value: Example: abcdefg Available from: LOU Official (6.3.0.4452) |
SMORef | integer | true | Stock movement operation key. Type: int Default value: Example: 123 Available from: LOU Official - Update 46 (6.9.46.27927) |
SMTref | integer | true | Stock movement type key. Type: int Default value: Example: 123 Available from: LOU Official - Update 46 (6.9.46.27927) |
BinName | string | true | Name of the updated bin. Type: varchar(50) Default value: Example: abcdefg Available from: LOU Official (6.3.0.4452) |
Username | string | false | User Type: varchar(50) Default value: Example: abcdefg Available from: LOU Official - Update 46 (6.9.46.27927) |
BatchNumber | string | false | Batch number for items tagged with Batch Number Type: varchar(50) Default value: Example: abcdefg Available from: AVA Official - Update 7 (8.4.7.23158) |
NewStockQty | integer | true | New quantity on bin. Type: int Default value: Example: 123 Available from: LOU Official - Update 46 (6.9.46.27927) |
BestBeforeDate | string | false | Best before date for items tagged with Best Before Date Type: datetime Default value: Example: YYYY-MM-DD hh:mm:ss Available from: AVA Official - Update 7 (8.4.7.23158) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiSetStock>
<EanUpc>string</EanUpc>
<BinName>string</BinName>
<LocId>string</LocId>
<NewStockQty>0</NewStockQty>
<Username>string</Username>
<SMORef>0</SMORef>
<SMTref>0</SMTref>
<BatchNumber>string</BatchNumber>
<BestBeforeDate>string</BestBeforeDate>
</pixiSetStock>
</Body>
</Envelope>
Response
1. Status output
Name | Type | Description |
---|---|---|
Status | string | Execution status (OK/ERROR) Type: varchar (20) Available from: 25.06 (25.6.0.58802) |
StatusMessage | string | Description of the status Type: varchar (200) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSetStockPost200TextXmlResponse>
<Status>string</Status>
<StatusMessage>string</StatusMessage>
</PixiSetStockPost200TextXmlResponse>
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:pixiSetStock>
<LocId xsi:type="xsd:string">abcdefg</LocId> <!-- required -->
<EanUpc xsi:type="xsd:string">abcdefg</EanUpc> <!-- required -->
<SMORef xsi:type="xsd:integer">123</SMORef> <!-- required -->
<SMTref xsi:type="xsd:integer">123</SMTref> <!-- required -->
<BinName xsi:type="xsd:string">abcdefg</BinName> <!-- required -->
<Username xsi:type="xsd:string">abcdefg</Username>
<BatchNumber xsi:type="xsd:string">abcdefg</BatchNumber>
<NewStockQty xsi:type="xsd:integer">123</NewStockQty> <!-- required -->
<BestBeforeDate xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</BestBeforeDate>
</ns1:pixiSetStock>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiSetStock', [
'LocId' => 'abcdefg', // string (required)
'EanUpc' => 'abcdefg', // string (required)
'SMORef' => '123', // integer (required)
'SMTref' => '123', // integer (required)
'BinName' => 'abcdefg', // string (required)
'Username' => 'abcdefg', // string
'BatchNumber' => 'abcdefg', // string
'NewStockQty' => '123', // integer (required)
'BestBeforeDate' => 'YYYY-MM-DD hh:mm:ss', // 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);
}