ingrediente_id) or be entered as free text (descripcion). Each extra has a price and quantity, and its cost is rolled up into the parent item’s subtotal.
POST /api/transacciones/:id/items/:itemId/extras
Adds an extra to an item. You must supply either ingrediente_id or descripcion — not both, not neither.
Authentication: Required
Required role: Any authenticated user
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer <token> | Yes |
| Content-Type | application/json | Yes |
Path parameters
| Parameter | Type | Description |
|---|---|---|
| id | number | The transaction ID |
| itemId | number | The item ID |
Body
ID of a known inventory ingredient. Mutually exclusive with
descripcion.Free-text description of the extra (e.g.
"Extra queso"). Mutually exclusive with ingrediente_id.Price of the extra. Must be ≥ 0.
Quantity of the extra. Defaults to
1. Must be ≥ 0.01.Response
Success (201)
Auto-generated extra ID.
Parent item ID.
Associated ingredient ID, if provided.
Free-text description, if provided.
Price as a decimal string.
Quantity as a decimal string.
Error responses
| Status | Description |
|---|---|
| 400 | Neither ingrediente_id nor descripcion provided |
| 401 | Unauthorized |
| 404 | Transaction, item, or ingredient not found |
GET /api/transacciones/:id/items/:itemId/extras
Returns all active extras for the specified item, enriched with the ingredient name when an ingrediente_id is present.
Authentication: Required
Required role: Any authenticated user
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer <token> | Yes |
Path parameters
| Parameter | Type | Description |
|---|---|---|
| id | number | The transaction ID |
| itemId | number | The item ID |
Response
Success (200)
An array of extra objects:Extra ID.
Parent item ID.
Ingredient ID.
Free-text description.
Resolved ingredient name, or the
descripcion value if no ingredient.Price as a decimal string.
Quantity as a decimal string.
DELETE /api/transacciones/:id/items/:itemId/extras/:extraId
Soft-deletes an extra. The parent item’s subtotal and the transaction’s monto_total are recalculated automatically.
Authentication: Required
Required role: Any authenticated user
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer <token> | Yes |
Path parameters
| Parameter | Type | Description |
|---|---|---|
| id | number | The transaction ID |
| itemId | number | The item ID |
| extraId | number | The extra ID |
Response
Success (200)
Confirmation message.
Error responses
| Status | Description |
|---|---|
| 401 | Unauthorized |
| 404 | Transaction, item, or extra not found |