Hi Friends ,
We have the JSON Data coming in this format,
$invoice_data = {
"CONTACT_ID": "1",
"INV_SERIAL_NO": "100",
"NAME": "baby",
"INV_DATE": "2018-06-27",
"DUE_DATE": "2018-06-27",
"CURRENCY": "KD",
"SUBTOTAL": "143",
"TAX_TOTAL": "13",
"shipment_data": [
{
"SHIP_SERIAL_NO": "44",
"MASTER_NO": "55",
"HOUSE_NO": "88",
"cost_revenue_items": [
{
"CHARGE_REF": "tt",
"CURRENCY": "INR",
"QUANTITY": "2",
"SELLING_RATE": "45",
"EXCHANGE_RATE": "987"
},{
"CHARGE_REF": "ii",
"CURRENCY": "INR",
"QUANTITY": "2",
"SELLING_RATE": "45",
"EXCHANGE_RATE": "456"
},{
"CHARGE_REF": "op",
"CURRENCY": "INR",
"QUANTITY": "2",
"SELLING_RATE": "45",
"EXCHANGE_RATE": "456"
}
]
}
]
}
How to write DELETE End-point for child data-set “cost_revenue_items”. What I mean to say is how to handle the request to delete one of item from “cost_revenue_items”.
When “cost_revenue_items” will be deleted ,master “invoice_data” will be updated. This update , we can handle by PUT, but how do we know under that PUT, we have to
DELETE one of “cost_revenue_items”. Like how the JSON request to only delete one of “cost_revenue_items” will look like.
Will JSON request to delete “cost_revenue_items” looks like this ,if it want to delete last record :
$invoice_data = {
"CONTACT_ID": "1",
"INV_SERIAL_NO": "100",
"NAME": "baby",
"INV_DATE": "2018-06-27",
"DUE_DATE": "2018-06-27",
"CURRENCY": "KD",
"SUBTOTAL": "143",
"TAX_TOTAL": "13",
"shipment_data": [
{
"SHIP_SERIAL_NO": "44",
"MASTER_NO": "55",
"HOUSE_NO": "88",
"cost_revenue_items": [
{
"CHARGE_REF": "tt",
"CURRENCY": "INR",
"QUANTITY": "2",
"SELLING_RATE": "45",
"EXCHANGE_RATE": "987"
},{
"CHARGE_REF": "ii",
"CURRENCY": "INR",
"QUANTITY": "2",
"SELLING_RATE": "45",
"EXCHANGE_RATE": "456"
}
]
}
]
}
Kindly help me to know , how JSON request will look like ?
Thanks a lot