curl --request POST \
--url https://api.example.com/sales \
--header 'Content-Type: application/json' \
--data '
{
"clientId": "<string>",
"ordenDetails": [
{
"productId": "<string>",
"quantity": 123
}
]
}
'Create a new sale order with automatic stock deduction
curl --request POST \
--url https://api.example.com/sales \
--header 'Content-Type: application/json' \
--data '
{
"clientId": "<string>",
"ordenDetails": [
{
"productId": "<string>",
"quantity": 123
}
]
}
'This endpoint creates a sale order by associating a client with one or more products. The system automatically deducts the ordered quantity from the product stock.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.
{
"clientId": "036c71c5-14e0-11f1-9fcd-2418c6c96a00",
"ordenDetails": [
{
"productId": "1373fe00-14e4-11f1-9fcd-2418c6c96a00",
"quantity": 10
}
]
}
/products/1373fe00-14e4-11f1-9fcd-2418c6c96a00
{
"error": false,
"msg": "Product got sucessfully",
"product": {
"id": "b6da7bbc-14b9-11f1-9fcd-2418c6c96a00",
"name": "Coca cola",
"description": "Bebida gasificada de 2ltr",
"price": "3000.00",
"stock": 40,
"category_id": 1,
"created_at": "2026-02-28T15:25:29.000Z",
"updated_at": "2026-02-28T15:25:29.000Z"
}
}
{
"error": false,
"msg": "Product got sucessfully",
"product": {
"id": "1373fe00-14e4-11f1-9fcd-2418c6c96a00",
"name": "Coca cola",
"description": "Bebida gasificada de 2ltr",
"price": "3000.00",
"stock": 30,
"category_id": 1,
"created_at": "2026-02-28T20:28:43.000Z",
"updated_at": "2026-02-28T20:31:28.000Z"
}
}
{
"error": true,
"msg": "the data is invalid"
}
clientId is not a valid UUIDordenDetails is empty or missingproductId is not a valid UUIDquantity is less than 0