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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

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

{"APIKEY":"String","mvSupplierStockUpdate":{"ProductID":0,"ProductMainSupplierSKU":"String","ProductMainSupplierID":0,"ProductLeadTimeChoice":"UseExactDateOrDayRange","ProductLeadTimeExactDate":"\/Date(-62135596800000-0000)\/","ProductLeadTimeRangeInDays":0,"ProductStockChoice":"UseExactStockOrStockRangeOrNotAvailable","ProductAvailabilityExactStock":0,"ProductAvailabilityStockRange":0,"ProductSupplierPrice":0},"mvRecordAction":"Insert","mvInsertUpdateDeleteSourceApplication":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

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