Ongoing Warehouse logo
Ongoing Warehouse Developer

GetHistoricalInventoryByQuery

This function returns stock information for a specified date. You will receive both the total stock balance for each article that was in stock, and additionally more detailed information concerning exactly which batches or serial numbers that were in stock.

Note that if an article was not in stock on the specified date, then it will not be returned in the response.

Tags: GetHistoricalInventoryByQuery, GetHistoricalInventoryQuery, GetHistoricalInventoryByQueryResult, HistoricalInventoryArticleRow, Article, Item

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/GetHistoricalInventoryByQuery"

<?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>
    <GetHistoricalInventoryByQuery xmlns="http://ongoingsystems.se/WSI">
      <GoodsOwnerCode>string</GoodsOwnerCode>
      <UserName>string</UserName>
      <Password>string</Password>
      <GetHistoricalInventoryQuery>
        <StockDate>dateTime</StockDate>
        <OutboundDateType>PickingTime</OutboundDateType>
      </GetHistoricalInventoryQuery>
    </GetHistoricalInventoryByQuery>
  </soap:Body>
</soap:Envelope>
+

Request specification

GetHistoricalInventoryByQuery
GoodsOwnerCode str(400) Req. The goods owner code.
UserName str(50) Req. Your username.
Password str(50) Req. Your password.
GetHistoricalInventoryQuery object Req. Defines the query, what to filter for.
GetHistoricalInventoryQuery
StockDate datetime Req. The date for which you want stock balance information.
OutboundDateType enum Req. Must be the fixed string "PickingTime".

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>
    <GetHistoricalInventoryByQueryResponse xmlns="http://ongoingsystems.se/WSI">
      <GetHistoricalInventoryByQueryResult>
        <Success>boolean</Success>
        <Message>string</Message>
        <Rows>
          <HistoricalInventoryArticleRow>
            <Article>
              <SystemId>int</SystemId>
              <ArticleNumber>string</ArticleNumber>
              <ArticleName>string</ArticleName>
              <ProductCode>string</ProductCode>
              <NumberOfItems>decimal</NumberOfItems>
              <Price>decimal</Price>
            </Article>
            <Items>
              <HistoricalInventoryArticleItem>
                <NumberOfItems>decimal</NumberOfItems>
                <Serial>string</Serial>
                <BatchNo>string</BatchNo>
                <InOrderId>int</InOrderId>
                <InOrderNumber>string</InOrderNumber>
                <InOrderLineUnitPrice>decimal</InOrderLineUnitPrice>
                <InDate>InDate</InDate>
              </HistoricalInventoryArticleItem>
              <HistoricalInventoryArticleItem>
                <NumberOfItems>decimal</NumberOfItems>
                <Serial>string</Serial>
                <BatchNo>string</BatchNo>
                <InOrderId>int</InOrderId>
                <InOrderNumber>string</InOrderNumber>
                <InOrderLineUnitPrice>decimal</InOrderLineUnitPrice>
                <InDate>InDate</InDate>
              </HistoricalInventoryArticleItem>
            </Items>
          </HistoricalInventoryArticleRow>
          <HistoricalInventoryArticleRow>
            <Article>
              <SystemId>int</SystemId>
              <ArticleNumber>string</ArticleNumber>
              <ArticleName>string</ArticleName>
              <ProductCode>string</ProductCode>
              <NumberOfItems>decimal</NumberOfItems>
              <Price>decimal</Price>
            </Article>
            <Items>
              <HistoricalInventoryArticleItem>
                <NumberOfItems>decimal</NumberOfItems>
                <Serial>string</Serial>
                <BatchNo>string</BatchNo>
                <InOrderId>int</InOrderId>
                <InOrderNumber>string</InOrderNumber>
                <InOrderLineUnitPrice>decimal</InOrderLineUnitPrice>
                <InDate>InDate</InDate>
              </HistoricalInventoryArticleItem>
              <HistoricalInventoryArticleItem>
                <NumberOfItems>decimal</NumberOfItems>
                <Serial>string</Serial>
                <BatchNo>string</BatchNo>
                <InOrderId>int</InOrderId>
                <InOrderNumber>string</InOrderNumber>
                <InOrderLineUnitPrice>decimal</InOrderLineUnitPrice>
                <InDate>InDate</InDate>
              </HistoricalInventoryArticleItem>
            </Items>
          </HistoricalInventoryArticleRow>
        </Rows>
      </GetHistoricalInventoryByQueryResult>
    </GetHistoricalInventoryByQueryResponse>
  </soap:Body>
</soap:Envelope>
+

Response specification

GetHistoricalInventoryByQueryResult
Success bool True if the call succeeded, false otherwise.
Message str(*) An error message (if applicable).
Rows object Containing elements of HistoricalInventoryArticleRow.
HistoricalInventoryArticleRow
Article object Contains elements of Article, which gives information about the article/SKU.
Items object Contains elements of Items, which gives detailed stock information for this particular article/SKU.
Article
SystemId int Ongoing's internal id for this article.
ArticleNumber str(100) Article number.
ArticleName str(200) Article name.
ProductCode str(200) Product code.
NumberOfItems dec Total stock balance for this article on the specified date.
Price dec The stock valuation price for the article.
Item
NumberOfItems dec The quantity contained in this item.
Serial str(128) The serial number of the item.
BatchNo str(50) The batch number of the item.
InOrderId int The id of the inorder which the item was received on (or null, if the item was not received on an inorder).
InOrderNumber str(50) The name of the inorder which the item was received on (or null, if the item was not received on an inorder).
InOrderLineUnitPrice dec The unit price of this particular item, computed from the unit price which was entered on the inorder line.
InDate datetime The time when the item was received.