Megaventory API v2017a

<back to all web services

SupplierStockUpdate

The following routes are available for this service:
POST/SupplierStock/SupplierStockUpdateInserts a supplierStockList or updates a current supplierStockList.Uses your API Key and applies a mvRecordAction value on an mvSupplierStockList object. We can insert the mvSupplierStockList object we specified using "Insert" as our mvRecordAction. We can update a current supplierStockList using "Update". We can insert to it if it doesn't already exist, update it if it does using "InsertOrUpdate" and we can insert new fields or update non-empty fields of the supplierStockList using "InsertOrUpdateNonEmptyFields". Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external application ( eg Magento ) is the one that triggers the SupplierStockUpdate call.

Examples:



A.

Update the one of your mvSupplierStockList objects to have the ProductStockChoise as "StockRange".

Value:

 {
   "mvSupplierStockUpdate": {
      "ProductID": "27388",
      "ProductMainSupplierSKU": "ssku",
      "ProductMainSupplierID": "5357",
      "ProductLeadTimeChoice": "DayRange",
      "ProductLeadTimeExactDate": "/Date(-62135596800000-0000)/",
      "ProductLeadTimeRangeInDays": "0",
      "ProductStockChoice": "StockRange",
      "ProductAvailabilityExactStock": "32",
      "ProductAvailabilityStockRange": "54",
      "ProductSupplierPrice": "10"
   },
   "mvInsertUpdateDeleteSourceApplication": "Magento",
   "mvRecordAction": "Update"
}


Response:

{
   "mvSupplierStock": true,
   "ResponseStatus": {
      "ErrorCode": "0"
   }
}


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/SupplierStockUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/jsv
Content-Length: length

{
	APIKEY: String,
	mvSupplierStockUpdate: 
	{
		ProductID: 0,
		ProductMainSupplierSKU: String,
		ProductMainSupplierID: 0,
		ProductLeadTimeChoice: UseExactDateOrDayRange,
		ProductLeadTimeExactDate: 0001-01-01,
		ProductLeadTimeRangeInDays: 0,
		ProductStockChoice: UseExactStockOrStockRangeOrNotAvailable,
		ProductAvailabilityExactStock: 0,
		ProductAvailabilityStockRange: 0,
		ProductSupplierPrice: 0
	},
	mvRecordAction: Insert,
	mvInsertUpdateDeleteSourceApplication: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	mvSupplierStock: False,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	InternalErrorCode: String
}