Megaventory API v2017a

<back to all web services

InventoryLocationStockGet

The following routes are available for this service:
GET POST/InventoryLocationStock/InventoryLocationStockGetGets information about stock on existing inventory locations.Uses 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 ProductId descending order.

Examples:



We can add more than two Filters by using the Group ("StartGroup" and "EndGroup" are used to group parts of the filter expression and create a priority sequence for the filter expression. For example: XYZ (SQL) is the equivalent of XYZ (MV API)) and then an AndOr operator as shown below:

A.

Return the first 3 out of all inventory location stocks of products with ID equal to 51 or 53, whose description contains the word "NBA". The results will be returned as an mvProductStockList object which is an Array of mvStocks objects.

Value:

 {
   "Filters": [
      {
         "Group": "StartGroup",
         "FieldName": "productid",
         "SearchOperator": "Equals",
         "SearchValue": "54"
      },
      {
         "AndOr": "Or",
         "Group": "EndGroup",
         "FieldName": "productid",
         "SearchOperator": "Equals",
         "SearchValue": "51"
      },
      {
         "AndOr": "And",
         "FieldName": "productdescription",
         "SearchOperator": "Contains",
         "SearchValue": "NBA"
      }
   ],
   "showDeleted": "showAllDeletedAndUndeleted",
   "ReturnTopNRecords": "3"
}

Response:

 {
   "mvProductStockList": [
      {
         "productID": 51,
         "mvStock": [
            {
               "InventoryLocationID": 4,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176817-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176817-0000)/"
            },
            {
               "InventoryLocationID": 5,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176817-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176817-0000)/"
            },
            {
               "InventoryLocationID": 6,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176817-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176817-0000)/"
            },
            {
               "InventoryLocationID": 7,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176817-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176817-0000)/"
            },
            {
               "InventoryLocationID": 8,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1505221877037-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1505221877037-0000)/"
            }
         ],
         "StockPhysicalTotal": 0,
         "StockOnHoldTotal": 0,
         "StockNonShippedTotal": 0,
         "StockNonAllocatedWOsTotal": 0,
         "StockNonReceivedPOsTotal": 0,
         "StockNonReceivedWOsTotal": 0,
         "StockOnHandTotal": 0,
         "StockAlertLevelTotal": 0
      },
      {
         "productID": 54,
         "mvStock": [
            {
               "InventoryLocationID": 4,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176863-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176863-0000)/"
            },
            {
               "InventoryLocationID": 5,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176863-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176863-0000)/"
            },
            {
               "InventoryLocationID": 6,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176863-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176863-0000)/"
            },
            {
               "InventoryLocationID": 7,
               "StockPhysical": 0,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 0,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1504777176897-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1504777176897-0000)/"
            },
            {
               "InventoryLocationID": 8,
               "StockPhysical": 1,
               "StockOnHold": 0,
               "StockNonShipped": 0,
               "StockNonAllocatedWOs": 0,
               "StockNonReceivedPOs": 0,
               "StockNonReceivedWOs": 0,
               "StockOnHand": 1,
               "StockAlertLevel": 0,
               "SubLocation": "",
               "InventoryLocationStockCreationDate": "/Date(1505221877050-0000)/",
               "InventoryLocationStockLastUpdatedDate": "/Date(1505728795243-0000)/"
            }
         ],
         "StockPhysicalTotal": 1,
         "StockOnHoldTotal": 0,
         "StockNonShippedTotal": 0,
         "StockNonAllocatedWOsTotal": 0,
         "StockNonReceivedPOsTotal": 0,
         "StockNonReceivedWOsTotal": 0,
         "StockOnHandTotal": 1,
         "StockAlertLevelTotal": 0
      }
   ],
   "ResponseStatus": {
      "ErrorCode": "0"
   }
}

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/InventoryLocationStockGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/json
Content-Length: length

{"Filters":[{"AndOr":"And","Group":"Undefined","FieldName":"String","SearchOperator":"Undefined","SearchValue":"String"}],"ReturnTopNRecords":0,"APIKEY":"String","ProductID":[0],"ProductSKU":"String","ProductCategoryID":[0],"InventoryLocationID":[0],"ProductMainSupplierID":[0],"includeReferencedObjects":false,"ShowOnlyProductsWithPositiveQty":false,"ShowOnlyProductsThanNeedToBeOrdered":false,"showDeleted":"showOnlyUndeleted"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvProductStockList":[{"productID":0,"mvProduct":{"ProductID":0,"ProductType":"BuyFromSupplier","ProductSKU":"String","ProductEAN":"String","ProductDescription":"String","ProductVersion":"String","ProductLongDescription":"String","ProductCategoryID":0,"mvProductCategory":{"ProductCategoryID":0,"ProductCategoryName":"String","ProductCategoryDescription":"String"},"ProductUnitOfMeasurement":"String","ProductSellingPrice":0,"ProductPurchasePrice":0,"ProductUnitCost":[{}],"ProductWeight":0,"ProductWeightUnitID":0,"mvProductWeightUnit":{"WeightUnitID":0,"WeightUnitAbbrev":"String","WeightUnitName":"String","WeightUnitConversionToGrams":0},"ProductLength":0,"ProductBreadth":0,"ProductHeight":0,"ProductImageURL":"String","ProductComments":"String","ProductCustomField1":"String","ProductCustomField2":"String","ProductCustomField3":"String","ProductCustomField4":"String","ProductCustomField5":"String","ProductCustomField6":"String","ProductCustomField7":"String","ProductCustomField8":"String","ProductCustomField9":"String","ProductCustomField10":"String","ProductCustomField11":"String","ProductCustomField12":"String","ProductCustomField13":"String","ProductCustomField14":"String","ProductCustomField15":"String","ProductCustomField16":"String","ProductCustomField17":"String","ProductCustomField18":"String","ProductCustomField19":"String","ProductCustomField20":"String","ProductMainSupplierID":0,"mvProductMainSupplier":{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"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"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"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"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"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"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"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"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"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"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"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"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{}]}],"SupplierClientTaxID":"String"}]}],"SupplierClientTaxID":"String"}]}],"SupplierClientTaxID":"String"},"ProductMainSupplierPrice":0.00,"ProductMainSupplierSKU":"String","ProductMainSupplierDescription":"String","ProductCreationDate":"\/Date(-62135596800000-0000)\/","ProductOption1":false,"ProductOption2":false,"ProductOption3":false,"ProductOption4":false,"ProductOption5":false,"ProductOption6":false,"ProductOption7":false,"ProductOption8":false,"ProductOption9":false,"ProductOption10":false,"IsInventorySerialised":false,"IsBatchNumbersEnabled":false,"SerialNumberPrefix":"String","IsPurchasable":false,"PurchasableStartDate":"\/Date(-62135596800000-0000)\/","PurchasableEndDate":"\/Date(-62135596800000-0000)\/","IsSellable":false,"SellableStartDate":"\/Date(-62135596800000-0000)\/","SellableEndDate":"\/Date(-62135596800000-0000)\/"},"mvStock":[{"InventoryLocationID":0,"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},"StockPhysical":0,"StockOnHold":0,"StockNonShipped":0,"StockNonAllocatedWOs":0,"StockNonReceivedPOs":0,"StockNonReceivedWOs":0,"StockOnHand":0,"StockAlertLevel":0,"SubLocation":"String","InventoryLocationStockCreationDate":"\/Date(-62135596800000-0000)\/","InventoryLocationStockLastUpdatedDate":"\/Date(-62135596800000-0000)\/"}],"StockPhysicalTotal":0,"StockOnHoldTotal":0,"StockNonShippedTotal":0,"StockNonAllocatedWOsTotal":0,"StockNonReceivedPOsTotal":0,"StockNonReceivedWOsTotal":0,"StockOnHandTotal":0,"StockAlertLevelTotal":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"InternalErrorCode":"String"}