Megaventory API v2017a

<back to all web services

InventoryLocationStockAlertAndSublocationsUpdate

Inserts or updates information about stock on existing inventory locations.Insert or update stock alert levels for products specified locations. Select the product you want to set the alert level for by providing either the "productId" or the "productSku". You can specify the location to which the alert level should be applied with the "InventoryLocationID" and optional "SubLocation" name. Use mvInsertUpdateDeleteSourceApplication when an external application (e.g. Magento) triggers the InventoryLocationStockUpdate call.

Examples:



A.

Insert a new stock alert level for product 27412 and location 4.

Value:

 {
    "mvProductStockAlertsAndSublocationsList": [
        {
            "productId": 27412,
            "mvInventoryLocationStockAlertAndSublocations": [
                {
                    "InventoryLocationID": 4,
                    "StockAlertLevel": 10
                }
            ]
        }
    ]
}

Response:

 {
    "mvProductStockAlertsAndSublocationsList": [
        {
            "productID": 27412,
            "productSKU": "prod111",
            "mvInventoryLocationStockAlertAndSublocations": [
                {
                    "InventoryLocationID": 4,
                    "StockAlertLevel": 10,
                    "SubLocation": ""
                }
            ]
        }
    ],
    "ResponseStatus": {
        "ErrorCode": "0"
    }
}

To override the Content-type in your clients HTTP Accept Header, append the .soap11 suffix or ?format=soap11

HTTP + SOAP11

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /soap11 HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: InventoryLocationStockAlertAndSublocationsUpdate

<?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>

<InventoryLocationStockAlertAndSublocationsUpdate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <mvProductStockAlertsAndSublocationsList xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:mvProductStockAlertsAndSublocations>
      <d2p1:productID>0</d2p1:productID>
      <d2p1:productSKU>String</d2p1:productSKU>
      <d2p1:mvInventoryLocationStockAlertAndSublocations>
        <d2p1:mvInventoryLocationStockAlertAndSublocation>
          <d2p1:InventoryLocationID>0</d2p1:InventoryLocationID>
          <d2p1:StockAlertLevel>0</d2p1:StockAlertLevel>
          <d2p1:SubLocation>String</d2p1:SubLocation>
        </d2p1:mvInventoryLocationStockAlertAndSublocation>
      </d2p1:mvInventoryLocationStockAlertAndSublocations>
    </d2p1:mvProductStockAlertsAndSublocations>
  </mvProductStockAlertsAndSublocationsList>
  <mvInsertUpdateDeleteSourceApplication>String</mvInsertUpdateDeleteSourceApplication>
</InventoryLocationStockAlertAndSublocationsUpdate>

    </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: application/xml
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>

<InventoryLocationStockAlertAndSublocationsUpdateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvProductStockAlertsAndSublocationsList xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:mvProductStockAlertsAndSublocations>
      <d2p1:productID>0</d2p1:productID>
      <d2p1:productSKU>String</d2p1:productSKU>
      <d2p1:mvInventoryLocationStockAlertAndSublocations>
        <d2p1:mvInventoryLocationStockAlertAndSublocation>
          <d2p1:InventoryLocationID>0</d2p1:InventoryLocationID>
          <d2p1:StockAlertLevel>0</d2p1:StockAlertLevel>
          <d2p1:SubLocation>String</d2p1:SubLocation>
        </d2p1:mvInventoryLocationStockAlertAndSublocation>
      </d2p1:mvInventoryLocationStockAlertAndSublocations>
    </d2p1:mvProductStockAlertsAndSublocations>
  </mvProductStockAlertsAndSublocationsList>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <InternalErrorCode>String</InternalErrorCode>
</InventoryLocationStockAlertAndSublocationsUpdateResponse>

    </soap:Body>
</soap:Envelope>