Skip to main content

POST /api/transacciones/:id/reabrir

Reopens a transaction that is in the cerrado state, setting its status back to abierto. The existing monto_pagado is preserved so that previously paid amounts are not charged again — only the new monto_pendiente will need to be settled. Authentication: Required Required role: Any authenticated user
You can only reopen transactions whose estado is cerrado. Calling this endpoint on an abierto or pendiente transaction returns a 400 error.

Request

Headers

HeaderValueRequired
AuthorizationBearer <token>Yes

Path parameters

ParameterTypeDescription
idnumberThe transaction ID

Response

Success (200)

Returns the updated transaction object with estado set to abierto.
id
number
Transaction ID.
estado
string
Updated status — always abierto after a successful reopen.
monto_pagado
string
Preserved amount from previous payments — not reset.
monto_total
string
Total amount (unchanged until new items are added).
actualizado_en
string
Timestamp of the reopen action.

Error responses

StatusDescription
400Transaction is not in cerrado state
401Unauthorized
404Transaction not found

Example

curl -X POST http://localhost:3000/api/transacciones/42/reabrir \
  -H "Authorization: Bearer $TOKEN"
{
  "id": 42,
  "concepto": "Pedido mesa 5",
  "estado": "abierto",
  "monto_total": "85.00",
  "monto_pagado": "85.00",
  "actualizado_en": "2026-03-18T15:30:00.000Z"
}
After reopening, add new items with Add item. The new items will increase monto_total and create a fresh monto_pendiente that needs to be paid.

Build docs developers (and LLMs) love