pixiGetItemLogisticsStock
Returns the total bin stock of an item at one location and the quantity still available after subtracting open future (FUT) order lines.
Calculates the stock of a single item for direct fulfillment (DF) purposes, as stated in the code comment: stock based on open DF orders.
Steps:
- Sums
BinItemQtyof all bin entries inInvBinItemfor the item@ItemKeywhose bin (InvBin) belongs to the location@Location(BinLocId). This sum is returned asTotalQty(0 if there are no matching bins). - Sums
Qtyof all order lines inOrderlinesfor the item that- have status
FUT, - have
Qty > 0, and - have no entry in
OrderHistorywith statusFUTandClientNotified = 'N'.
- have status
- Returns
TotalQtyminus the order line sum asFulfillmentAvailableQty, together with the passed@Location.
The call always returns exactly one row, because the query aggregates without grouping.
Notes
- If
@Locationis omitted (NULL), the comparisonBinLocId = NULLnever matches, soTotalQtyis always 0 andFulfillmentAvailableQtyis 0 or negative. Always pass a location. - The open order line quantity is not filtered by location: FUT order lines of all locations are subtracted from the stock of the given location.
FulfillmentAvailableQtycan become negative when open FUT quantities exceed the bin stock.- An unknown
@ItemKeydoes not cause an error; the call returns a row with 0 values. - All tables are read with
NOLOCK, so the result may include uncommitted data.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ItemKey
Required
|
int | – |
Internal key of the item whose stock is calculated (matched against Example: |
Location
|
char(3) string |
NULL |
Location code ( Example: |
Result set 1 · Always (exactly one row)
Stock figures of the item at the requested location.
| Column | Type | Description |
|---|---|---|
FulfillmentAvailableQty
|
int |
Bin stock at the location minus the quantity of open FUT order lines of the item (all locations). Can be negative. |
TotalQty
|
int |
Sum of |
Location
Nullable |
char(3) string |
The location passed in |
Response example
<SqlRowSet1>
<row>
<FulfillmentAvailableQty>37</FulfillmentAvailableQty>
<TotalQty>45</TotalQty>
<Location>001</Location>
</row>
</SqlRowSet1>
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:pixiGetItemLogisticsStock>
<ItemKey>10452</ItemKey>
<!-- <Location>001</Location> -->
</ns1:pixiGetItemLogisticsStock>
</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:pixiGetItemLogisticsStock>
<ItemKey>10452</ItemKey>
<!-- <Location>001</Location> -->
</ns1:pixiGetItemLogisticsStock>
</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' => '10452',
// 'Location' => '001',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetItemLogisticsStock', $soapArguments);
- SQL object:
- dbo.pipiGetItemLogisticsStock