POST | /ProductBOM/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.
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": ""
}
|
---|