Megaventory API v2017a

<back to all web services

InventoryLocationStockProductStockUpdate

The following routes are available for this service:
POST/InventoryLocationStock/ProductStockUpdateUpdates Product Stock for given locations and products.Update stock levels for the specified products in the specified locations.

"ProductID" or "ProductSKU" : Specify the product for which the stock should be adjusted.
"InventoryLocationID" : Specify the location in which the adjustment will take place (If only one location exists, you can leave this empty).
"ProductQuantity" : Specify the actual physical quantity currently in stock.
"ProductUnitCost" : Specify the unit cost to be used in the adjustment (leave empty to use the default unit cost of the specified product)
"AdjustmentPlusDocumentTypeID" : The ID of the document type to be used in case of an Adjustment Plus (leave empty to use default).
"AdjustmentMinusDocumentTypeID" : The ID of the document type to be used in case of an Adjustment Minus (leave empty to use default).

Examples:



A.

Adjust stock for product "Product_1" to 800 in Location 1, and "Product_2" to 500 in Location 2, using the default document types and unit costs.

Value:

 {
    "mvProductStockUpdateList": [
        {     
          "ProductSKU" : "Product_1",
          "ProductQuantity": 800,
          "InventoryLocationID": 1
        },
        {     
          "ProductSKU" : "Product_2",
          "ProductQuantity": 500,
          "InventoryLocationID": 2
        }
    ]
}

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/InventoryLocationStockProductStockUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/xml
Content-Length: length

<InventoryLocationStockProductStockUpdate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <mvProductStockUpdateList xmlns:d2p1="http://schemas.datacontract.org/2004/07/Megaventory.Models.DTOs.mvInventoryLocationStockDTOs">
    <d2p1:ProductStockUpdate>
      <d2p1:ProductID>0</d2p1:ProductID>
      <d2p1:ProductSKU>String</d2p1:ProductSKU>
      <d2p1:ProductQuantity>0</d2p1:ProductQuantity>
      <d2p1:ProductUnitCost>0</d2p1:ProductUnitCost>
      <d2p1:InventoryLocationID>0</d2p1:InventoryLocationID>
      <d2p1:AdjustmentPlusDocumentTypeID>0</d2p1:AdjustmentPlusDocumentTypeID>
      <d2p1:AdjustmentMinusDocumentTypeID>0</d2p1:AdjustmentMinusDocumentTypeID>
    </d2p1:ProductStockUpdate>
  </mvProductStockUpdateList>
</InventoryLocationStockProductStockUpdate>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<InventoryLocationStockProductStockUpdateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvProductStockUpdateList xmlns:d2p1="http://schemas.datacontract.org/2004/07/Megaventory.Models.DTOs.mvInventoryLocationStockDTOs">
    <d2p1:ProductStockUpdate>
      <d2p1:ProductID>0</d2p1:ProductID>
      <d2p1:ProductSKU>String</d2p1:ProductSKU>
      <d2p1:ProductQuantity>0</d2p1:ProductQuantity>
      <d2p1:ProductUnitCost>0</d2p1:ProductUnitCost>
      <d2p1:InventoryLocationID>0</d2p1:InventoryLocationID>
      <d2p1:AdjustmentPlusDocumentTypeID>0</d2p1:AdjustmentPlusDocumentTypeID>
      <d2p1:AdjustmentMinusDocumentTypeID>0</d2p1:AdjustmentMinusDocumentTypeID>
    </d2p1:ProductStockUpdate>
  </mvProductStockUpdateList>
  <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>
</InventoryLocationStockProductStockUpdateResponse>