Megaventory API v2017a

<back to all web services

ProductBOMDelete

Deletes a finished Good's bill of materials. Uses your API Key and the ID of the Finished Good, whose Bill of Materials you want to delete.

Examples:



A.

Delete a Bill of Materials.

To begin with, we use ProductBOMGet to see all of our existing Finished Goods and their respective Bill Of Materials as shown below:

Value:

{}


Response:

    {
        "mvProductBOMs":
        [
            {
            "ProductID": 61310,
            "ProductSKU": "prod2",
            "mvRawMaterials":
                [
                    {
                    "ProductID": 59304,
                    "ProductSKU": "prod7",
                    "ProductDescription": "prod7",
                    "RawMaterialQuantity": 2
                    }
                ]
            },
            {
            "ProductID": 61309,
            "ProductSKU": "prod3",
            "mvRawMaterials":
                [
                    {
                    "ProductID": 59302,
                    "ProductSKU": "prod1",
                    "ProductDescription": "product 1",
                    "RawMaterialQuantity": 2
                    },
                    {
                    "ProductID": 60378,
                    "ProductSKU": "prod4",
                    "ProductDescription": "prod4",
                    "RawMaterialQuantity": 1
                    }
                ]
            },
            {
            "ProductID": 59303,
            "ProductSKU": "prod5",
            "mvRawMaterials":
                [
                    {
                    "ProductID": 59308,
                    "ProductSKU": "prod9",
                    "ProductDescription": "prod9",
                    "RawMaterialQuantity": 5
                    }
                ]
            }
        ],
        "ResponseStatus":
        {
            "ErrorCode": "0"
        }
    }
    


Then we decide to delete the Bill of Materials for Finished Good prod2 from our list of Finished Goods.

Value:

 {
   "FinishedGoodIDToDeleteItsBOM": 61310
}


Response:

 {
   "result": true,
   "ResponseStatus": {
      "ErrorCode": "0"
   }
}

B.

Trying to delete the Bill Of Materials for a Finished Good that does not exist.

Value:

 {
   "FinishedGoodIDToDeleteItsBOM": 20
}


Response:

{
  "ResponseStatus": {
    "ErrorCode": "500",
    "Message": "The Product with Id [20] does not exist. Update failed."
  },
  "entityID": 20,
  "InternalErrorCode": ""
} 

To override the Content-type in your clients HTTP Accept Header, append the .soap12 suffix or ?format=soap12

HTTP + SOAP12

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

POST /soap12 HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>

<ProductBOMDelete xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <FinishedGoodIDToDeleteItsBOM>0</FinishedGoodIDToDeleteItsBOM>
  <mvInsertUpdateDeleteSourceApplication>String</mvInsertUpdateDeleteSourceApplication>
</ProductBOMDelete>

    </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>

<ProductBOMDeleteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <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>
  <result>false</result>
  <InternalErrorCode>String</InternalErrorCode>
</ProductBOMDeleteResponse>

    </soap12:Body>
</soap12:Envelope>