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

HTTP + CSV

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

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

ProductID,ProductMainSupplierSKU,ProductMainSupplierID,ProductLeadTimeChoice,ProductLeadTimeExactDate,ProductLeadTimeRangeInDays,ProductStockChoice,ProductAvailabilityExactStock,ProductAvailabilityStockRange,ProductSupplierPrice
0,String,0,UseExactDateOrDayRange,0001-01-01,0,UseExactStockOrStockRangeOrNotAvailable,0,0,0

HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

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