You can delete the detail line of an item by setting the delete property of the detail entity to true. This can be done with any endpoint and here is how:
First retrieve the record with the detail you want to remove:
GET : https://localhost/MyStoreInstance/entity/Default/18.200.001/SalesOrder?$expand=Details&$select=OrderNbr,OrderType,Details/InventoryID,Details/
WarehouseID&$filter=OrderType eq 'SO' and CustomerOrder eq
'SO248-563-06'
You should get a similar result:
[
{
"id": "c52bd7ac-c715-4ce3-8565-50463570b7d9",
"rowNumber": 1,
"note": "",
"CustomerOrder": {
"value": "SO248-563-06"
},
"Details":
[
{
"id": "988988a5-3bc0-4645-a884-8a9ba6a400b4",
"rowNumber": 1,
"note": "",
"InventoryID": {
"value": "AALEGO500"},
"WarehouseID": {"value": "MAIN"},
"custom": {},
"files": []
},
{
"id": "983f9831-b139-489c-8ad0-86d50f6e535d",
"rowNumber": 2,
"note": "",
"InventoryID": {"value": "CONTABLE1"},
"WarehouseID": {"value": "MAIN"},
"custom": {},
"files": []
},
{
"id": "19193380-63b2-445c-a50b-fd6d57f176a0",
"rowNumber": 3,
"note": "",
"InventoryID": {"value": "CONGRILL"},
"WarehouseID": {"value": "MAIN"},
"custom": {},
"files": []
}
],
"OrderNbr": {"value": "000003"},
"OrderType": {"value": "SO"},
"custom": {},
"files": []
}
]
You can then resent in a PUT request with the following body in order to delete the corresponding detail line
{
"OrderType":{"value":"SO"},
"OrderNbr":{"value":"000003"},
"Hold":{"value":false},
"Details":
[
{
"id":"19193380-63b2-445c-a50b-fd6d57f176a0",
"delete":true
}
]
}