Ongoing Warehouse logo
Ongoing Warehouse Developer

GetInventoryByQuery

This function returns two things:

The difference between this function and GetInventory, is that this function allows you to specify which article numbers you are interested in.

See also our article Stock balances and inventory for more information on how to interpret the stock balance numbers returned by this function.

Tags: GetInventoryByQuery, GetInventoryQuery

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>
         </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)[] Req.* 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, 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.

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.