Megaventory API v2017a

<back to all web services

SupplierStockUpdate

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

HTTP + SOAP11

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

POST /soap11 HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: SupplierStockUpdate

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>

<SupplierStockUpdate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <mvSupplierStockUpdate xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:ProductID>0</d2p1:ProductID>
    <d2p1:ProductMainSupplierSKU>String</d2p1:ProductMainSupplierSKU>
    <d2p1:ProductMainSupplierID>0</d2p1:ProductMainSupplierID>
    <d2p1:ProductLeadTimeChoice>Use 'ExactDate' or 'DayRange'</d2p1:ProductLeadTimeChoice>
    <d2p1:ProductLeadTimeExactDate>0001-01-01T00:00:00</d2p1:ProductLeadTimeExactDate>
    <d2p1:ProductLeadTimeRangeInDays>0</d2p1:ProductLeadTimeRangeInDays>
    <d2p1:ProductStockChoice>Use 'ExactStock' or 'StockRange' or 'NotAvailable'</d2p1:ProductStockChoice>
    <d2p1:ProductAvailabilityExactStock>0</d2p1:ProductAvailabilityExactStock>
    <d2p1:ProductAvailabilityStockRange>0</d2p1:ProductAvailabilityStockRange>
    <d2p1:ProductSupplierPrice>0</d2p1:ProductSupplierPrice>
  </mvSupplierStockUpdate>
  <mvRecordAction>Insert</mvRecordAction>
  <mvInsertUpdateDeleteSourceApplication>String</mvInsertUpdateDeleteSourceApplication>
</SupplierStockUpdate>

    </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>

<SupplierStockUpdateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvSupplierStock>false</mvSupplierStock>
  <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>
</SupplierStockUpdateResponse>

    </soap:Body>
</soap:Envelope>