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 .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /xml/reply/ProductBOMGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/xml
Content-Length: length

<ProductBOMGet 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>
  <ProductSKU>String</ProductSKU>
  <ProductCategoryID>0</ProductCategoryID>
  <includeReferencedObjects>false</includeReferencedObjects>
</ProductBOMGet>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ProductBOMGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvProductBOMs xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:mvProductBOM>
      <d2p1:ProductID>0</d2p1:ProductID>
      <d2p1:ProductSKU>String</d2p1:ProductSKU>
      <d2p1:mvRawMaterials>
        <d2p1:mvRawMaterialItem>
          <d2p1:ProductID>0</d2p1:ProductID>
          <d2p1:ProductSKU>String</d2p1:ProductSKU>
          <d2p1:ProductDescription>String</d2p1:ProductDescription>
          <d2p1:RawMaterialQuantity>0</d2p1:RawMaterialQuantity>
          <d2p1:RawMaterialQuantitySlackPercent>0.0</d2p1:RawMaterialQuantitySlackPercent>
          <d2p1:FinishedGoodQuantitySlackPercent>0.0</d2p1:FinishedGoodQuantitySlackPercent>
        </d2p1:mvRawMaterialItem>
      </d2p1:mvRawMaterials>
    </d2p1:mvProductBOM>
  </mvProductBOMs>
  <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>
</ProductBOMGetResponse>