curl --request DELETE \
--url https://api.example.com/sales/:idDelete a sale order with automatic stock restoration and cascading detail deletion
curl --request DELETE \
--url https://api.example.com/sales/:idThis endpoint deletes a complete sale order, including all associated sale details. The system automatically restores the product stock for all items in the sale.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/andreguti9190/Sistema-de-gestion-de-ventas--Nodejs/llms.txt
Use this file to discover all available pages before exploring further.
idSales from GET responses)sale_details table). This is a cascading delete operation that cannot be undone.sale_details records linked to the sale are removed{
"error": false,
"msg": "Sale deleted successfully"
}
4e42fc03-edf3-4212-afb5-47e9ae8400a4
Before deletion - GET /sales
{
"error": false,
"data": [
{
"idSales": "4e42fc03-edf3-4212-afb5-47e9ae8400a4",
"idSalesDetails": "1b71fff6-ca67-424d-a391-f14b0a63d8ec",
"clientsId": "036c71c5-14e0-11f1-9fcd-2418c6c96a00",
"clientsName": "Mark Zuckemberg",
"idProduct": "1373fe00-14e4-11f1-9fcd-2418c6c96a00",
"nameProduct": "Coca cola",
"quantity": 20,
"price": "3000.00",
"total": "60000.00"
},
{
"idSales": "878d89a7-a1a1-4411-a359-1ad08965fb30",
"idSalesDetails": "4033e9a1-5858-44c9-b1d7-39c718933372",
"clientsId": "036c71c5-14e0-11f1-9fcd-2418c6c96a00",
"clientsName": "Mark Zuckemberg",
"idProduct": "1373fe00-14e4-11f1-9fcd-2418c6c96a00",
"nameProduct": "Coca cola",
"quantity": 10,
"price": "3000.00",
"total": "30000.00"
},
{
"idSales": "4e42fc03-edf3-4212-afb5-47e9ae8400a4",
"idSalesDetails": "bc7ff6f2-d092-46fa-a893-71c860c2a69d",
"clientsId": "036c71c5-14e0-11f1-9fcd-2418c6c96a00",
"clientsName": "Mark Zuckemberg",
"idProduct": "2cfba483-14e6-11f1-9fcd-2418c6c96a00",
"nameProduct": "Pepsi",
"quantity": 50,
"price": "5000.00",
"total": "250000.00"
}
]
}
GET /sales
{
"error": false,
"data": [
{
"idSales": "878d89a7-a1a1-4411-a359-1ad08965fb30",
"idSalesDetails": "4033e9a1-5858-44c9-b1d7-39c718933372",
"clientsId": "036c71c5-14e0-11f1-9fcd-2418c6c96a00",
"clientsName": "Mark Zuckemberg",
"idProduct": "1373fe00-14e4-11f1-9fcd-2418c6c96a00",
"nameProduct": "Coca cola",
"quantity": 10,
"price": "3000.00",
"total": "30000.00"
}
]
}
4e42fc03-edf3-4212-afb5-47e9ae8400a4 were removed:
{
"error": true,
"msg": "the id is invalid"
}