Megaventory API v2017a

<back to all web services

ProductBOMGet

The following routes are available for this service:
GET POST/ProductBOM/ProductBOMGetGets information on a product's bill of materials.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:



A.

Return the first two mvProductBOMs objects whose product SKU contains the the characters "11". The results are returned as mvProductBOMs objects.

Value:

{
   "Filters": [
      {
         "FieldName": "Productsku",
         "SearchOperator": "Contains",
         "SearchValue": "11"
      }
   ],
   "ReturnTopNRecords": 2
}

Response:

{
   "mvProductBOMs": [
      {
         "ProductID": 27412,
         "ProductSKU": "prod111",
         "mvRawMaterials": [
            {
               "ProductID": 27396,
               "ProductSKU": "PROD11",
               "ProductDescription": "PROD11",
               "RawMaterialQuantity": 2
            }
         ]
      }
   ],
   "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/ProductBOMGet 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","ProductSKU":"String","ProductCategoryID":0,"includeReferencedObjects":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvProductBOMs":[{"ProductID":0,"ProductSKU":"String","mvRawMaterials":[{}]}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"InternalErrorCode":"String"}