Megaventory API v2017a

<back to all web services

InventoryLocationUpdate

Inserts an inventory location or updates a current inventory location.Uses your API Key and applies a mvRecordAction value on an mvInventoryLocation object. We can insert the mvInventoryLocation object we specified using "Insert" as our mvRecordAction. We can update a current inventory location object using "Update", we can insert 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 object using "InsertOrUpdateNonEmptyFields". Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external application ( eg WooCommerce ) is the one that triggers the InventoryLocationUpdate call. InventoryLocationId cannot be updated.

Examples:



A.

Insert a new inventory location.

Value:

 {
   "mvInventoryLocation": {
      "InventoryLocationName": "Megaventory Warehouse",
      "InventoryLocationAbbreviation": "MWH"
   },
   "mvRecordAction": "Insert",
   "mvInsertUpdateDeleteSourceApplication": "WooCommerce"
} 


Response:

 {
   "mvInventoryLocation": {
      "InventoryLocationID": 3410,
      "InventoryLocationName": "Megaventory Warehouse",
      "InventoryLocationAbbreviation": "MWH",
      "InventoryLocationAddress": "",
      "InventoryLocationCurrencyCode": ""
   },
   "ResponseStatus": {
      "ErrorCode": "0"
   },
   "entityID": 3410
}

B.



Update the above inventory location by adding an InventoryLocationCurrencyCode, an address and updating its location abbreviation.

Value:

 {
   "mvInventoryLocation": {
      "InventoryLocationID": 3410,
      "InventoryLocationName": "Megaventory Warehouse",
      "InventoryLocationAbbreviation": "MVWH",
      "InventoryLocationAddress": "Megaventory Central Warehouse, Texas, USA",
      "InventoryLocationCurrencyCode": "USD"
   },
   "mvRecordAction": "InsertOrUpdateNonEmptyFields",
   "mvInsertUpdateDeleteSourceApplication": "Magento"
} 


Response:

 {
   "mvInventoryLocation": {
      "InventoryLocationID": 3410,
      "InventoryLocationName": "Megaventory Warehouse",
      "InventoryLocationAbbreviation": "MVWH",
      "InventoryLocationAddress": "Megaventory Central Warehouse, Texas, USA",
      "InventoryLocationCurrencyCode": "USD"
   },
   "ResponseStatus": {
      "ErrorCode": "0"
   },
   "entityID": 3410
} 

To override the Content-type in your clients HTTP Accept Header, append the .soap12 suffix or ?format=soap12

HTTP + SOAP12

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

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

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

<InventoryLocationUpdate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <mvInventoryLocation xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:InventoryLocationID>0</d2p1:InventoryLocationID>
    <d2p1:InventoryLocationName>String</d2p1:InventoryLocationName>
    <d2p1:InventoryLocationAbbreviation>String</d2p1:InventoryLocationAbbreviation>
    <d2p1:InventoryLocationAddress>String</d2p1:InventoryLocationAddress>
    <d2p1:Address>
      <d2p1:AddressType>General</d2p1:AddressType>
      <d2p1:AddressLine1>String</d2p1:AddressLine1>
      <d2p1:AddressLine2>String</d2p1:AddressLine2>
      <d2p1:AddressLine3>String</d2p1:AddressLine3>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:Phone>String</d2p1:Phone>
      <d2p1:Email>String</d2p1:Email>
      <d2p1:TaxIdNumber>String</d2p1:TaxIdNumber>
      <d2p1:Organization>String</d2p1:Organization>
      <d2p1:City>String</d2p1:City>
      <d2p1:State>String</d2p1:State>
      <d2p1:Country>NONE</d2p1:Country>
      <d2p1:CountryName>String</d2p1:CountryName>
      <d2p1:Longitude>String</d2p1:Longitude>
      <d2p1:Latitude>String</d2p1:Latitude>
      <d2p1:ZipCode>String</d2p1:ZipCode>
    </d2p1:Address>
    <d2p1:InventoryLocationCurrencyCode>String</d2p1:InventoryLocationCurrencyCode>
    <d2p1:InventoryLocationCompanyId>0</d2p1:InventoryLocationCompanyId>
    <d2p1:InventoryLocationIsDeleted>false</d2p1:InventoryLocationIsDeleted>
    <d2p1:InventoryLocationIsTransit>false</d2p1:InventoryLocationIsTransit>
  </mvInventoryLocation>
  <mvRecordAction>Insert</mvRecordAction>
  <mvInsertUpdateDeleteSourceApplication>String</mvInsertUpdateDeleteSourceApplication>
</InventoryLocationUpdate>

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

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

<InventoryLocationUpdateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvInventoryLocation xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:InventoryLocationID>0</d2p1:InventoryLocationID>
    <d2p1:InventoryLocationName>String</d2p1:InventoryLocationName>
    <d2p1:InventoryLocationAbbreviation>String</d2p1:InventoryLocationAbbreviation>
    <d2p1:InventoryLocationAddress>String</d2p1:InventoryLocationAddress>
    <d2p1:Address>
      <d2p1:AddressType>General</d2p1:AddressType>
      <d2p1:AddressLine1>String</d2p1:AddressLine1>
      <d2p1:AddressLine2>String</d2p1:AddressLine2>
      <d2p1:AddressLine3>String</d2p1:AddressLine3>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:Phone>String</d2p1:Phone>
      <d2p1:Email>String</d2p1:Email>
      <d2p1:TaxIdNumber>String</d2p1:TaxIdNumber>
      <d2p1:Organization>String</d2p1:Organization>
      <d2p1:City>String</d2p1:City>
      <d2p1:State>String</d2p1:State>
      <d2p1:Country>NONE</d2p1:Country>
      <d2p1:CountryName>String</d2p1:CountryName>
      <d2p1:Longitude>String</d2p1:Longitude>
      <d2p1:Latitude>String</d2p1:Latitude>
      <d2p1:ZipCode>String</d2p1:ZipCode>
    </d2p1:Address>
    <d2p1:InventoryLocationCurrencyCode>String</d2p1:InventoryLocationCurrencyCode>
    <d2p1:InventoryLocationCompanyId>0</d2p1:InventoryLocationCompanyId>
    <d2p1:InventoryLocationIsDeleted>false</d2p1:InventoryLocationIsDeleted>
    <d2p1:InventoryLocationIsTransit>false</d2p1:InventoryLocationIsTransit>
  </mvInventoryLocation>
  <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>
  <entityID>0</entityID>
  <InternalErrorCode>String</InternalErrorCode>
</InventoryLocationUpdateResponse>

    </soap12:Body>
</soap12:Envelope>