GetInventoryByQuery
This function returns two things:
- The total stock values for each article.
- Article definitions for the requested articles (i.e. the basic article data such as weight)
See also our article Stock balances and inventory for more information on how to interpret the stock balance numbers returned by this function.
If you have many articles and most them are not in stock, and you wish to reduce the number of articles which the API returns, you can specify OnlyArticlesInStock = true. This will cause the API to only return those articles which actually are in stock.
Request XML
POST /xxx/service.asmx HTTP/1.1
Host: api.ongoingsystems.se
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ongoingsystems.se/WSI/GetInventoryByQuery"
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetInventoryByQuery xmlns="http://ongoingsystems.se/WSI">
<GoodsOwnerCode>string</GoodsOwnerCode>
<UserName>string</UserName>
<Password>string</Password>
<GetInventoryQuery>
<ArticleNumbersToGet>
<string>string</string>
<string>string</string>
</ArticleNumbersToGet>
<StockInfoChangedFrom>dateTime</StockInfoChangedFrom>
<ArticlesBelowStockLimit>boolean</ArticlesBelowStockLimit>
<MaxArticlesToGet>int</MaxArticlesToGet>
<ArticleSystemIdFrom>int</ArticleSystemIdFrom>
<SpecialFilters>
<OnlyArticlesInStock>bool</OnlyArticlesInStock>
</SpecialFilters>
<ProductCodesToGet>
<string>string</string>
<string>string</string>
</ProductCodesToGet>
<CreatedTimeFrom>dateTime</CreatedTimeFrom>
<BarCodesToGet>
<string>string</string>
<string>string</string>
</BarCodesToGet>
<ArticleNameContains>
<string>string</string>
<string>string</string>
</ArticleNameContains>
</GetInventoryQuery>
</GetInventoryByQuery>
</soap:Body>
</soap:Envelope>
Request specification
GetInventoryByQuery | |||
---|---|---|---|
GoodsOwnerCode | str(400) | Req. | The name/code of your client |
UserName | str(50) | Req. | Your username |
Password | str(50) | Req. | Your password |
GetInventoryQuery | object | Req. | Defines the query, what to filter for |
GetInventoryQuery | |||
---|---|---|---|
ArticleNumbersToGet | object | Containing elements of string, defining which article numbers to get | |
string | str(50)[] | Article number to get | |
StockInfoChangedFrom | datetime | Only return articles where the stock balance has changed after this date | |
ArticlesBelowStockLimit | bool | If True, only return articles where a "stock limit" has been specified for the articles in Ongoing WMS, and where the stock balance is below the stock limit. The intended usage for this is to get a list of articles where there is a need to refill the warehouse. | |
MaxArticlesToGet | int | Max number of articles to return in response | |
ArticleSystemIdFrom | int | If specified, the API will only respond with articles whose system Ids are greater than or equal to (>=) the specified id. In conjunction with MaxArticlesToGet this allows you to request articles in batches of e.g. 100, rather than having to request all articles at once. | |
SpecialFilters | object | An element of type SpecialFilters. | |
ProductCodesToGet | object | Containing elements of string, defining which product codes to get | |
CreatedTimeFrom | dateTime | Only return articles which have been created after this time | |
BarCodesToGet | object | Containing elements of string, defining which barcodes to get. | |
ArticleNameContains | object | Containing elements of string, defining which article names to get |
SpecialFilters | |||
---|---|---|---|
OnlyArticlesInStock | bool | If True, then the API will only return articles which actually are in stock (that is, where NumberOfItemsDecimal > 0). |
Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetInventoryByQueryResponse xmlns="http://ongoingsystems.se/WSI">
<GetInventoryByQueryResult>
<InventoryLines>
<InventoryLine>
<Article xsi:nil="true" />
<NumberOfBookedItems>int</NumberOfBookedItems>
<NumberOfItems>int</NumberOfItems>
<NumberOfLockedItems>decimal</NumberOfLockedItems>
<LastInDate>dateTime</LastInDate>
<ToReceiveNumberOfItems>decimal</ToReceiveNumberOfItems>
<AllocatedNumberOfItems>decimal</AllocatedNumberOfItems>
<LockedForSaleNumberOfItems>decimal</LockedForSaleNumberOfItems>
<NumberOfItemsDecimal>decimal</NumberOfItemsDecimal>
<NumberOfBookedItemsDecimal>decimal</NumberOfBookedItemsDecimal>
<PickedToBeCollectedNumberOfItems>decimal</PickedToBeCollectedNumberOfItems>
<ReceivedToBeFinishedNumberOfItems>decimal</ReceivedToBeFinishedNumberOfItems>
</InventoryLine>
<InventoryLine>
<Article xsi:nil="true" />
<NumberOfBookedItems>int</NumberOfBookedItems>
<NumberOfItems>int</NumberOfItems>
<NumberOfLockedItems>decimal</NumberOfLockedItems>
<LastInDate>dateTime</LastInDate>
<ToReceiveNumberOfItems>decimal</ToReceiveNumberOfItems>
<AllocatedNumberOfItems>decimal</AllocatedNumberOfItems>
<LockedForSaleNumberOfItems>decimal</LockedForSaleNumberOfItems>
<NumberOfItemsDecimal>decimal</NumberOfItemsDecimal>
<NumberOfBookedItemsDecimal>decimal</NumberOfBookedItemsDecimal>
<PickedToBeCollectedNumberOfItems>decimal</PickedToBeCollectedNumberOfItems>
<ReceivedToBeFinishedNumberOfItems>decimal</ReceivedToBeFinishedNumberOfItems>
</InventoryLine>
</InventoryLines>
<GoodsOwnerId>int</GoodsOwnerId>
</GetInventoryByQueryResult>
</GetInventoryByQueryResponse>
</soap:Body>
</soap:Envelope>
Response specification
GetInventoryByQueryResult has the same specification as GetInventoryResult in GetInventory.