SetLocationBatches

This function allows you to set the stock balance at a single location for several articles and batches, at the same time. The way it works is:

  1. You specify a single location, and a list of articles, batch numbers (optional), and quantities.
  2. Ongoing WMS compares your list to what exists in Ongoing WMS.
  3. If there are differences, Ongoing WMS attempts to execute inventory transactions so that the quantities in Ongoing WMS will match the ones which you specified.
  4. Ongoing WMS returns the differences between our stock balance and your stock balance.

Essentially, this allows an external system to "own" the stock balance at a particular location.

If you specify DryRun = true, then Ongoing WMS will not actually perform any inventory transactions. We will simply return the stock balance differences.

By default, any article or batch which is not included in your list, will be set to quantity 0. If don't want this to happen, specify RemoveByInventoryBatchesNotSpecified = false.

Tags: SetLocationBatches, Operation, LocationBatch, Handling, SetLocationBatchesResponse, SetLocationBatchesError, LocationBatchDifference

Request XML

POST /xxx/automation.asmx HTTP/1.1
Host: api.ongoingsystems.se
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ongoingsystems.se/Automation/SetLocationBatches"

<?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>
    <SetLocationBatches xmlns="http://ongoingsystems.se/Automation">
      <UserName>string</UserName>
      <Password>string</Password>
      <Operation>
        <Location>string</Location>
        <InventoryNumber>string</InventoryNumber>
        <InventoryAdjustmentCause>
          <Code>string</Code>
        </InventoryAdjustmentCause>
        <Batches>
          <LocationBatch>
            <ArticleDefId>int</ArticleDefId>
            <Batch>string</Batch>
            <NumberOfItems>decimal</NumberOfItems>
          </LocationBatch>
          <LocationBatch>
            <ArticleDefId>int</ArticleDefId>
            <Batch>string</Batch>
            <NumberOfItems>decimal</NumberOfItems>
          </LocationBatch>
        </Batches>
        <Handling>
          <AllowDeAllocationOfOrders>boolean</AllowDeAllocationOfOrders>
          <RemoveByInventoryBatchesNotSpecified>boolean</RemoveByInventoryBatchesNotSpecified>
          <AllowIncreaseNumberOfItems>boolean</AllowIncreaseNumberOfItems>
        </Handling>
        <GoodsOwnerId>int</GoodsOwnerId>
        <DryRun>boolean</DryRun>
      </Operation>
    </SetLocationBatches>
  </soap:Body>
</soap:Envelope>

Request specification

SetLocationBatches
UserName str(50) Req. Your username
Password str(50) Req. Your password
Operation object Req. An element of type Operation.
Operation
Location str(50) Req. The location where you want to set the article quantities.
InventoryNumber str(50) A reference number for the inventory transactions which may be made to fulfil the API call.
InventoryAdjustmentCause object If you want the inventory transactions to have a specific adjustment cause, send it in this field.
Batches object[] Req. A list of LocationBatches. Each location batch contains information about the article, batch number (if any), and the quantity.
Handling object An object of type Handling. Allows you to customize how you want to Ongoing WMS to handle your request.
GoodsOwnerId int Goods owner id.
DryRun bool If true, then Ongoing WMS will perform a dry run, that is, Ongoing WMS will compute the necessary inventory transactions which need to be performed, and return them to you, but Ongoing WMS will not actually execute the inventory transactions.
LocationBatch
ArticleDefId int Req. Ongoing WMS internal id for the article.
Batch str(50) Batch number.
NumberOfItems decimal Number of items.
Handling
AllowDeAllocationOfOrders bool If the location contains items which are allocated, is Ongoing WMS allowed to deallocate them? This may be necessary in order to fulfil the API call. Default: true
RemoveByInventoryBatchesNotSpecified bool If the location contains a batch number which was not sent in LocationBatches, should Ongoing WMS remove it from the location? Default: true.
AllowIncreaseNumberOfItems bool Is Ongoing WMS allowed to increase the number of items in stock? Default: true

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>
    <SetLocationBatchesResponse xmlns="http://ongoingsystems.se/Automation">
      <SetLocationBatchesResult>
        <SetLocationBatchesErrors>
          <SetLocationBatchesError>
            <Message>string</Message>
            <ErrorType>UnknownError or LogonError or LocationNotFound or InventoryNumberAlreadyExists or ArticleNotFound or ErrorSavingInventory or BelowZeroTransaction or ArticleIsDeleted or GoodsOwnerIsDeleted or BatchNumberOfItemsWouldBeIncreased or GoodsOwerIdNotFound</ErrorType>
          </SetLocationBatchesError>
          <SetLocationBatchesError>
            <Message>string</Message>
            <ErrorType>UnknownError or LogonError or LocationNotFound or InventoryNumberAlreadyExists or ArticleNotFound or ErrorSavingInventory or BelowZeroTransaction or ArticleIsDeleted or GoodsOwnerIsDeleted or BatchNumberOfItemsWouldBeIncreased or GoodsOwerIdNotFound</ErrorType>
          </SetLocationBatchesError>
        </SetLocationBatchesErrors>
        <Success>boolean</Success>
        <DryRun>boolean</DryRun>
        <BatchDifferences>
          <LocationBatchDifference>
            <OngoingNumberOfItems>decimal</OngoingNumberOfItems>
            <ExternalNumberOfItems>decimal</ExternalNumberOfItems>
            <ArticleDefId>int</ArticleDefId>
            <GoodsOwnerId>int</GoodsOwnerId>
            <Batch>string</Batch>
          </LocationBatchDifference>
          <LocationBatchDifference>
            <OngoingNumberOfItems>decimal</OngoingNumberOfItems>
            <ExternalNumberOfItems>decimal</ExternalNumberOfItems>
            <ArticleDefId>int</ArticleDefId>
            <GoodsOwnerId>int</GoodsOwnerId>
            <Batch>string</Batch>
          </LocationBatchDifference>
        </BatchDifferences>
      </SetLocationBatchesResult>
    </SetLocationBatchesResponse>
  </soap:Body>
</soap:Envelope>

Response specification

SetLocationBatchesResponse
SetLocationBatchesErrors object A list of SetLocationBatchesError objects
Success bool True if successful, false otherwise.
DryRun bool True if this was only a dry run, false otherwise.
BatchDifferences object[] A list of LocationBatchDifference objects, specifying what differences were found between Ongoing WMS and the list which was sent in the API call.
SetLocationBatchesError
Message str(*) Message explaining the error.
ErrorType string The type of error:
- UnknownError
- LogonError
- LocationNotFound
- InventoryNumberAlreadyExists
- ArticleNotFound
- ErrorSavingInventory
- BelowZeroTransaction
- ArticleIsDeleted
- GoodsOwnerIsDeleted
- BatchNumberOfItemsWouldBeIncreased
- GoodsOwerIdNotFound
LocationBatchDifference
OngoingNumberOfItems decimal The number of items in Ongoing WMS.
ExternalNumberOfItems decimal The number of items which was specified in the API call.
ArticleDefId int Ongoing WMS internal id of the article.
GoodsOwnerId int Goods owner id.
Batch str(50) Batch number.