curl --request PUT \
--url https://api.example.com/api/detalles/{detalleId}{
"200": {},
"204": {},
"400": {},
"401": {},
"403": {},
"404": {}
}Update the quantity of a specific order line item
curl --request PUT \
--url https://api.example.com/api/detalles/{detalleId}{
"200": {},
"204": {},
"400": {},
"401": {},
"403": {},
"404": {}
}curl -X PUT "http://localhost:8080/api/detalles/45?cantidad=3" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
// Update quantity
const response = await fetch(
'http://localhost:8080/api/detalles/45?cantidad=3',
{
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`
}
}
);
if (response.status === 204) {
console.log('Item removed from order');
} else {
const updatedDetail = await response.json();
console.log('New subtotal:', updatedDetail.subtotal);
}
import requests
headers = {
'Authorization': f'Bearer {token}'
}
# Update quantity to 5
response = requests.put(
'http://localhost:8080/api/detalles/45',
params={'cantidad': 5},
headers=headers
)
if response.status_code == 204:
print('Item removed')
else:
detail = response.json()
print(f'Updated quantity: {detail["cantidad"]}')
{
"detalle_id": 45,
"producto_id": 5,
"nombre": "Sofá Klippan 2 plazas",
"cantidad": 3,
"precioUnitario": 299.00,
"subtotal": 897.00
}