Megaventory API v2017a

<back to all web services

InventoryLocationGet

The following routes are available for this service:
GET POST/InventoryLocation/InventoryLocationGetGets information on existing inventory locationsUses your API Key and some Filters in an array format and returns the search results using the given filters. Optionally, you can use ReturnTopNRecords to limit the number of the results to the specified number (omit, or add ReturnTopNRecords = -1 to get all the available results). The ReturnTopNRecords chooses the top records in a InventoryLocationID descending order.

Examples:



A.

Get all the existing locations (as mvInventoryLocation objects).

Value:

{}


Response:

{
   "mvInventoryLocations": [
      {
         "InventoryLocationID": 3409,
         "InventoryLocationName": "Dropshipping",
         "InventoryLocationAbbreviation": "Dr-Sh",
         "InventoryLocationAddress": "",
         "InventoryLocationCurrencyCode": "USD"
      },
      {
         "InventoryLocationID": 3408,
         "InventoryLocationName": "xss",
         "InventoryLocationAbbreviation": "xss",
         "InventoryLocationAddress": "",
         "InventoryLocationCurrencyCode": ""
      },
      {
         "InventoryLocationID": 3407,
         "InventoryLocationName": "van1",
         "InventoryLocationAbbreviation": "van1",
         "InventoryLocationAddress": "",
         "InventoryLocationCurrencyCode": "EUR"
      },
      {
         "InventoryLocationID": 3406,
         "InventoryLocationName": "outlet 1",
         "InventoryLocationAbbreviation": "OL1",
         "InventoryLocationAddress": "",
         "InventoryLocationCurrencyCode": "EUR"
      },
      {
         "InventoryLocationID": 3405,
         "InventoryLocationName": "location",
         "InventoryLocationAbbreviation": "loca",
         "InventoryLocationAddress": "",
         "InventoryLocationCurrencyCode": "EUR"
      }
   ],
   "ResponseStatus": {
      "ErrorCode": "0"
   }
} 


B.

Returns the first 2 mvInventoryLocation objects whose ID is greater than 3406 and whose address is empty.
We can add two Filters by using the AndOr operator as shown below:

Value:

{
   "Filters": [
      {
         "FieldName": "InventoryLocationAddress",
         "SearchOperator": "Equals",
         "SearchValue": ""
      },
      {
         "AndOr": "And",
         "FieldName": "InventoryLocationID",
         "SearchOperator": "GreaterThan",
         "SearchValue": 3406
      }
   ],
   "ReturnTopNRecords": 2
}


Response:

{
   "mvInventoryLocations": [
      {
         "InventoryLocationID": 3409,
         "InventoryLocationName": "Dropshipping",
         "InventoryLocationAbbreviation": "Dr-Sh",
         "InventoryLocationAddress": "",
         "InventoryLocationCurrencyCode": "USD"
      },
      {
         "InventoryLocationID": 3408,
         "InventoryLocationName": "xss",
         "InventoryLocationAbbreviation": "xss",
         "InventoryLocationAddress": "",
         "InventoryLocationCurrencyCode": ""
      }  ],
   "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/InventoryLocationGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/csv
Content-Length: length

AndOr,Group,FieldName,SearchOperator,SearchValue
And,Undefined,String,Undefined,String

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

InventoryLocationID,InventoryLocationName,InventoryLocationAbbreviation,InventoryLocationAddress,Address,InventoryLocationCurrencyCode,InventoryLocationCompanyId,InventoryLocationIsDeleted,InventoryLocationIsTransit
0,String,String,String,"{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}",String,0,False,False