Megaventory API v2017a

<back to all web services

InventoryLocationStockAlertAndSublocationsUpdate

The following routes are available for this service:
POST/InventoryLocationStock/InventoryLocationStockUpdateInserts 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 .xml suffix or ?format=xml

HTTP + XML

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

POST /xml/reply/InventoryLocationStockAlertAndSublocationsUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/xml
Content-Length: length

<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>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

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