All consolidation endpoints require a valid JWT token in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Medinaallan/ContabilidadISV/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header (Bearer <token>). Consolidations represent monthly double-entry ledger records for a client. Each record is stored in either consolidaciones_generales or consolidaciones_hoteles depending on the value of tipoRubro supplied in the request. Non-admin users can only retrieve their own records; admin users receive records across all users. Every write operation is automatically registered in the system audit log (Audit Logs).
POST /api/consolidaciones
Create a new consolidation record. ThetipoRubro field determines which database table is targeted: HOTELES writes to consolidaciones_hoteles; any other value (including omission) defaults to consolidaciones_generales. usuario_id is automatically set from the authenticated JWT — it is not accepted from the request body.
Auth: Bearer token required.
Request Body
Determines the target table. Accepted values:
GENERALES (default) or HOTELES.ID of the client company this consolidation belongs to. Must reference an existing, active client. See Clientes API.
Period start date in
YYYY-MM-DD format (e.g. "2024-01-01").Period end date in
YYYY-MM-DD format (e.g. "2024-01-31").Optional free-text remarks for this consolidation period.
Accounting Fields — 55 Accounts × Debe + Haber
Each of the 55 chart-of-accounts entries has two numeric fields: one suffixed_debe (debit) and one suffixed _haber (credit). All default to 0 if omitted. Values are stored as DECIMAL(18,2).
Cash and bank accounts — debit side.
Cash and bank accounts — credit side.
Sales taxable at 15% ISV — debit side.
Sales taxable at 15% ISV — credit side.
ISV collected on 15% sales — debit side.
ISV collected on 15% sales — credit side.
Sales taxable at 18% ISV (alcoholic beverages / tobacco) — debit side.
Sales taxable at 18% ISV — credit side.
ISV collected on 18% sales — debit side.
ISV collected on 18% sales — credit side.
Exempt sales — debit side.
Exempt sales — credit side.
Zero-rated (exonerated) sales — debit side.
Zero-rated sales — credit side.
Fee / professional services income — debit side.
Fee / professional services income — credit side.
Purchases taxable at 15% ISV — debit side.
Purchases taxable at 15% ISV — credit side.
ISV paid on 15% purchases — debit side.
ISV paid on 15% purchases — credit side.
Purchases taxable at 18% ISV — debit side.
Purchases taxable at 18% ISV — credit side.
ISV paid on 18% purchases — debit side.
ISV paid on 18% purchases — credit side.
Exempt purchases — debit side.
Exempt purchases — credit side.
Zero-rated purchases — debit side.
Zero-rated purchases — credit side.
ISV withholdings — debit side.
ISV withholdings — credit side.
Wages and salaries — debit side.
Wages and salaries — credit side.
Thirteenth-month bonus (aguinaldo) — debit side.
Thirteenth-month bonus — credit side.
Fourteenth-month bonus — debit side.
Fourteenth-month bonus — credit side.
Severance and labor benefits — debit side.
Severance and labor benefits — credit side.
IHSS (Instituto Hondureño de Seguridad Social) contributions — debit side.
IHSS contributions — credit side.
INFOP (vocational training fund) contributions — debit side.
INFOP contributions — credit side.
RAP (housing pension fund) contributions — debit side.
RAP contributions — credit side.
Electricity expense — debit side.
Electricity expense — credit side.
Water supply expense — debit side.
Water supply expense — credit side.
Hondutel (telephone) expense — debit side.
Hondutel expense — credit side.
Internet service expense — debit side.
Internet service expense — credit side.
Rent expense — debit side.
Rent expense — credit side.
Fuel and lubricants — debit side.
Fuel and lubricants — credit side.
Insurance premiums — debit side.
Insurance premiums — credit side.
Municipal taxes — debit side.
Municipal taxes — credit side.
Central government taxes — debit side.
Central government taxes — credit side.
Professional service fees — debit side.
Professional service fees — credit side.
Accounting fees — debit side.
Accounting fees — credit side.
Legal fees — debit side.
Legal fees — credit side.
Miscellaneous expenses — debit side.
Miscellaneous expenses — credit side.
The remaining accounts follow the same
_debe / _haber pattern: compra_medicamentos_insumos, equipo_material_laboratorio, equipo_material_odontologico, honorarios_medicos, mobiliario_equipo, pagos_conatel_fitt, papeleria_utiles, viaticos_gastos_viaje, reparaciones_mantenimiento, insumos_aseo, seguridad_vigilancia, materiales_suministros, publicidad_propaganda, obligaciones_bancarias_cooperativas, intereses_financieros, tasa_seguridad_poblacional, adquisicion_vehiculos, mantenimiento_vehiculos, fletes_encomiendas. All 110 fields (55 × 2) are accepted but optional; they default to 0.Response
Human-readable confirmation:
"Consolidación creada exitosamente".The newly created consolidation record as persisted in the database, including the server-assigned
id, the calculated total_debe, total_haber, diferencia, balanceado, and an injected tipo field ("GENERALES" or "HOTELES").Example
GET /api/consolidaciones
List consolidation records from bothconsolidaciones_generales and consolidaciones_hoteles (or either table when tipo is specified). Results are sorted by fecha_creacion descending. Non-admin users receive only their own records.
Auth: Bearer token required.
Query Parameters
Filter records to a specific client ID.
Inclusive lower bound on
fecha_inicio (YYYY-MM-DD).Inclusive upper bound on
fecha_fin (YYYY-MM-DD).Restrict results to one table. Accepted values:
GENERALES or HOTELES. Omit to return records from both tables.Response
"Consolidaciones obtenidas exitosamente"Array of consolidation objects. Each element contains all 110 account fields plus joined columns
cliente_nombre, cliente_rtn, usuario_nombre, computed total_debe, total_haber, and the injected tipo discriminator.Total number of records in the response array.
Example
GET /api/consolidaciones/summary
Returns an aggregate summary across both tables, including record counts, total debit/credit sums, total IST collected (hoteles only), and count of balanced entries. Useful for dashboard widgets. Auth: Bearer token required.Query Parameters
Scope the summary to a single client.
Filter on
fecha_inicio ≥ fecha_desde (YYYY-MM-DD).Filter on
fecha_fin ≤ fecha_hasta (YYYY-MM-DD).Response
"Resumen obtenido exitosamente"Aggregate summary object.
GET /api/consolidaciones/ist-statistics
Returns I.S.T. (Impuesto Sobre Turismo) statistics derived exclusively fromconsolidaciones_hoteles. Useful for tourism-tax reporting dashboards. See Features — Consolidations for details on the hotel accounting schema.
Auth: Bearer token required.
Query Parameters
Scope statistics to a single hotel client.
Start of date range (
YYYY-MM-DD).End of date range (
YYYY-MM-DD).Response
"Estadísticas de I.S.T. obtenidas exitosamente"I.S.T. statistics object as returned by
ConsolidacionHoteles.getISTStatistics(). Shape varies by implementation but typically includes totals per IST account, period breakdowns, and per-client aggregates.GET /api/consolidaciones/cliente/:clienteId
Retrieve all consolidations (from both tables, or filtered bytipo) for a specific client. The client record is validated to exist before querying consolidations.
Auth: Bearer token required.
Path Parameters
The numeric ID of the client.
Query Parameters
Restrict to one table:
GENERALES or HOTELES. Omit to return records from both.Response
"Consolidaciones del cliente obtenidas exitosamente"GET /api/consolidaciones/:id
Fetch a single consolidation by its numeric ID. Thetipo query parameter is required because the record can exist in either table and there is no cross-table ID lookup.
Auth: Bearer token required.
Path Parameters
Numeric primary key of the consolidation record.
Query Parameters
Which table to query. Must be
GENERALES or HOTELES.Response
"Consolidación obtenida exitosamente"Full consolidation record including all 110 account fields, joined
cliente_nombre, cliente_rtn, usuario_nombre, computed total_debe, total_haber, diferencia, balanceado, and the echoed tipo discriminator.PUT /api/consolidaciones/:id
Update an existing consolidation. BothtipoRubro and motivo are required in the request body. The server compares each submitted field against the current database value and rejects the request if no actual changes are detected. Every changed field is individually logged to BitacoraCambios (see Audit Logs).
Auth: Bearer token required.
Path Parameters
Numeric ID of the consolidation to update.
Request Body
Must be
GENERALES or HOTELES — identifies the target table.Free-text reason for the edit. Stored verbatim in the audit log entry for each changed field.
New period start date. Optional — only include fields you want to change.
New period end date.
Updated remarks.
Updated debit value for any of the 55 account fields. Fields ending in
_debe or _haber are coerced to DECIMAL(18,2); empty strings and null are treated as 0.Updated credit value for any of the 55 account fields.
Response
"Consolidación actualizada exitosamente"Full updated consolidation record as re-fetched from the database after the update.
Number of individual fields that were changed. Each changed field generates one
BitacoraCambios record.DELETE /api/consolidaciones/:id
Soft-delete a consolidation record. The row is not removed from the database — instead,activo is set to 0 and fecha_actualizacion is stamped with the current server time (GETDATE()). The record will no longer appear in any GET responses, but all data is preserved for audit purposes.
Auth: Bearer token required.
This is a soft delete. Data is preserved in the database with
activo = 0. There is no hard-delete endpoint for consolidations. To recover a soft-deleted record, contact your database administrator.Path Parameters
Numeric ID of the consolidation to deactivate.
Query Parameters
Which table to target:
GENERALES or HOTELES. This parameter is required — the endpoint returns 400 if omitted.Response
"Consolidación eliminada exitosamente"Confirmation object returned by the model’s
delete() method: { "message": "Consolidación eliminada exitosamente" }.Error Responses
All endpoints return a consistent error envelope on failure:| HTTP Status | Meaning |
|---|---|
400 | Missing or invalid request parameters (e.g. missing tipo, no changes detected) |
404 | Consolidation or referenced client not found |
500 | Unhandled server error; details field contains the original error message |
Related Pages
- Authentication — Obtain a JWT token
- Clientes API — Manage client companies referenced by
cliente_id - Audit Logs API — View per-field change history written on every
PUT - Reports API — Generate PDF/Excel reports from consolidation data
- Features — Consolidations — Business logic and account schema overview