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 .jsv suffix or ?format=jsv

HTTP + JSV

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

POST /jsv/reply/InventoryLocationStockProductStockUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/jsv
Content-Length: length

{
	APIKEY: String,
	mvProductStockUpdateList: 
	[
		{
			ProductID: 0,
			ProductSKU: String,
			ProductQuantity: 0,
			ProductUnitCost: 0,
			InventoryLocationID: 0,
			AdjustmentPlusDocumentTypeID: 0,
			AdjustmentMinusDocumentTypeID: 0
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	mvProductStockUpdateList: 
	[
		{
			ProductID: 0,
			ProductSKU: String,
			ProductQuantity: 0,
			ProductUnitCost: 0,
			InventoryLocationID: 0,
			AdjustmentPlusDocumentTypeID: 0,
			AdjustmentMinusDocumentTypeID: 0
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	InternalErrorCode: String
}