Return

Ongoing WMS has functionality which allows users to return items using the outbound order which was originally used to ship the items to the end-customer. This function allows you to perform this kind of return using the API.

Tags: Return, ReturnOperation, ReturnToLocation, ByUser, ReturnOperationReturnOrder, ReturnOperationReturnCause, ReturnOperationRemoveByInventory, ReturnResponse, ReturnResult, ReturnError

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

<?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>
    <Return xmlns="http://ongoingsystems.se/Automation">
      <UserName>string</UserName>
      <Password>string</Password>
      <Operation>
        <OrderId>int</OrderId>
        <ArticleDefId>int</ArticleDefId>
        <OrderLineId>int</OrderLineId>
        <OriginalArticleItemId>int</OriginalArticleItemId>
        <Batch>string</Batch>
        <ReturnToLocation>
          <Location>string</Location>
        </ReturnToLocation>
        <NumberOfItemsToReturn>decimal</NumberOfItemsToReturn>
        <ReturnedByUser>
          <UserName>string</UserName>
        </ReturnedByUser>
        <ReturnOrder>
          <ReturnOrderLineId>int</ReturnOrderLineId>
        </ReturnOrder>
        <AllowReturnLessThanNumberOfItemsToReturn>boolean</AllowReturnLessThanNumberOfItemsToReturn>
        <ReturnComment>string</ReturnComment>
        <ReturnCause>
          <ReturnCauseId>int</ReturnCauseId>
        </ReturnCause>
        <RemoveByInventory>
          <RemoveByInventory>Yes or No</RemoveByInventory>
        </RemoveByInventory>
      </Operation>
    </Return>
  </soap:Body>
</soap:Envelope>

Request specification

Return
UserName string(50) Req. Your username
Password string(50) Req. Your password
Operation ReturnOperation Req. The operation object
ReturnOperation
OrderId int Req. Ongoing WMS internal id of the order.
ArticleDefId int Req. Ongoing WMS internal id of the article which is being returned.
OrderLineId int Ongoing WMS internal id of the specific order line which you want to perform the return against. This field is not mandatory. If you don't specify it, the system will choose a suitable order line itself.
OriginalArticleItemId int The original article item id of the item you are returning. Not mandatory.
Batch string(50) The batch number of the article you are returning. Not mandatory.
ReturnToLocation ReturnToLocation An element of type ReturnToLocation.
NumberOfItemsToReturn decimal The number of items you want to return.
ReturnedByUser ByUser An element of type ByUser.
ReturnOrder ReturnOperationReturnOrder An element of type ReturnOperationReturnOrder.
AllowReturnLessThanNumberOfItemsToReturn boolean In Ongoing WMS, the maximum quantity which can be returned of a particular article is the quantity which was originally sent to the consignee.

Say the consignee was sent C items and you are trying to return R items, and R > C.

If you set AllowReturnLessThanNumberOfItemsToReturn = true, then the API call will fail.

If you set AllowReturnLessThanNumberOfItemsToReturn = false, then the API will instead try to return as much as possible.
ReturnComment string(200) Return comment.
ReturnCause ReturnOperationReturnCause An element of type ReturnOperationReturnCause.
RemoveByInventory ReturnOperationRemoveByInventory An element of type ReturnOperationRemoveByInventory.
ReturnToLocation
Location string(50) The location where you want the returned item to be placed. If you don't specify this, the system will return the item to location it was picked from.
ByUser
UserName string(50) Req. The name of the user. Must be an actual user in Ongoing WMS. Will be set as the user that performed the packing.
ReturnOperationReturnOrder
ReturnOrderLineId int Ongoing WMS has entities called return orders which are used to advise the warehouse that returns are coming. If you wish to perform the return against a particular return order line, specify the return order line id in this field.
ReturnOperationReturnCause
ReturnCauseId int The return cause id.
ReturnOperationRemoveByInventory
RemoveByInventory enum If Yes, then the system will first perform the return operation and then immediately afterwards remove the item from stock (in other words: the item will be scrapped). If No, then the system will keep the item in stock.

Response XML

<?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>
    <ReturnResponse xmlns="http://ongoingsystems.se/Automation">
      <ReturnResult>
        <Errors>
          <ReturnError>
            <Message>string</Message>
            <ErrorType>UnknownError or LogonError or LocationNotFound or ArticleNotFound or ArticleNotOnOrder or GoodsOwnerIsDeleted or OrderIdNotFound or OrderLineIdMissMatch or NumberOfItemsToReturnGreaterThanLeftToReturnOnOrder or ErrorWhileSaving or ReturnedByUserError or NothingFoundToReturn or ReturnOrderLineNotFound or ReturnOrderLineNotMatchingArticle or ReturnOrderNotMatchingOrder or ReturnCauseNotMatchingGoodsOwner or ReturnCauseNotFound</ErrorType>
          </ReturnError>
          <ReturnError>
            <Message>string</Message>
            <ErrorType>UnknownError or LogonError or LocationNotFound or ArticleNotFound or ArticleNotOnOrder or GoodsOwnerIsDeleted or OrderIdNotFound or OrderLineIdMissMatch or NumberOfItemsToReturnGreaterThanLeftToReturnOnOrder or ErrorWhileSaving or ReturnedByUserError or NothingFoundToReturn or ReturnOrderLineNotFound or ReturnOrderLineNotMatchingArticle or ReturnOrderNotMatchingOrder or ReturnCauseNotMatchingGoodsOwner or ReturnCauseNotFound</ErrorType>
          </ReturnError>
        </Errors>
        <Success>boolean</Success>
        <ReturnedNumberOfItems>decimal</ReturnedNumberOfItems>
      </ReturnResult>
    </ReturnResponse>
  </soap:Body>
</soap:Envelope>

Response specification

ReturnResponse
ReturnResult ReturnResult
ReturnResult
Errors ReturnError[]
Success boolean True if successful, false otherwise.
ReturnedNumberOfItems decimal The total number of items which were successfully returned.
ReturnError
Message string Message explaining the error.
ErrorType enum The type of error:

- UnknownError
- LogonError
- LocationNotFound
- ArticleNotFound
- ArticleNotOnOrder
- GoodsOwnerIsDeleted
- OrderIdNotFound
- OrderLineIdMissMatch
- NumberOfItemsToReturnGreaterThanLeftToReturnOnOrder
- ErrorWhileSaving
- ReturnedByUserError
- NothingFoundToReturn
- ReturnOrderLineNotFound
- ReturnOrderLineNotMatchingArticle
- ReturnOrderNotMatchingOrder
- ReturnCauseNotMatchingGoodsOwner
- ReturnCauseNotFound