Megaventory API v2017a

<back to all web services

InventoryLocationGet

Gets 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 .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: InventoryLocationGet

<?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>

<InventoryLocationGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <Filters xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">
    <Filter>
      <AndOr>And</AndOr>
      <FieldName>String</FieldName>
      <Group>Undefined</Group>
      <SearchOperator>Undefined</SearchOperator>
      <SearchValue>String</SearchValue>
    </Filter>
  </Filters>
  <ReturnTopNRecords xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">0</ReturnTopNRecords>
  <APIKEY>String</APIKEY>
  <showDeleted>showOnlyUndeleted</showDeleted>
  <IncludeTransit>false</IncludeTransit>
</InventoryLocationGet>

    </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>

<InventoryLocationGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvInventoryLocations xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:mvInventoryLocation>
      <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>
    </d2p1:mvInventoryLocation>
  </mvInventoryLocations>
  <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>
</InventoryLocationGetResponse>

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