Megaventory API v2017a

<back to all web services

InventoryLocationUpdate

The following routes are available for this service:
POST/InventoryLocation/InventoryLocationUpdateInserts 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 .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/InventoryLocationUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/json
Content-Length: length

{"APIKEY":"String","mvInventoryLocation":{"InventoryLocationID":0,"InventoryLocationName":"String","InventoryLocationAbbreviation":"String","InventoryLocationAddress":"String","Address":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"InventoryLocationCurrencyCode":"String","InventoryLocationCompanyId":0,"InventoryLocationIsDeleted":false,"InventoryLocationIsTransit":false},"mvRecordAction":"Insert","mvInsertUpdateDeleteSourceApplication":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvInventoryLocation":{"InventoryLocationID":0,"InventoryLocationName":"String","InventoryLocationAbbreviation":"String","InventoryLocationAddress":"String","Address":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"InventoryLocationCurrencyCode":"String","InventoryLocationCompanyId":0,"InventoryLocationIsDeleted":false,"InventoryLocationIsTransit":false},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"entityID":0,"InternalErrorCode":"String"}