Megaventory API v2017a

<back to all web services

ProductBOMDelete

The following routes are available for this service:
POST/ProductBOM/ProductBOMDeleteDeletes 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 .csv suffix or ?format=csv

HTTP + CSV

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

POST /csv/reply/ProductBOMDelete HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/csv
Content-Length: length

APIKEY,FinishedGoodIDToDeleteItsBOM,mvInsertUpdateDeleteSourceApplication
String,0,String

HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

result,ResponseStatus,InternalErrorCode
False,"{ErrorCode:String,Message:String,StackTrace:String,Errors:[{ErrorCode:String,FieldName:String,Message:String}]}",String