The comprobantes endpoints serve two purposes: listing previously issued vouchers (used by the Comprobantes history page) and providing the metadata the register screen needs before a new sale — the available document types and the next correlative number.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/15aozzz/Lab-Nova-Salud/llms.txt
Use this file to discover all available pages before exploring further.
All routes require a valid JWT in the
Authorization: Bearer <token> header.GET /api/comprobantes
Returns the list of all issued sales vouchers. Supports filtering by date range, document type, and search text. Callssp_listar_comprobantes.
Query parameters
Start date for filtering results (ISO date string, e.g.,
"2024-01-01"). Optional.End date for filtering results (ISO date string, e.g.,
"2024-01-31"). Optional.Document type filter (e.g.,
"BOLETA", "FACTURA"). Pass "TODOS" or omit to return all types.Text search matched against client name or voucher number. Optional.
Response
200 OK — returns an array of voucher records.Internal sale ID. Use with
GET /api/ventas/:id for full detail.Document series (e.g.,
"B001").Correlative document number.
Document type (e.g.,
"BOLETA DE VENTA").ISO timestamp of the sale.
Sale total amount.
Client name recorded on the voucher.
Errors
| Status | Condition | Body |
|---|---|---|
500 | Database or server error | { "error": "<message>" } |
Example
GET /api/comprobantes/tipos
Returns the list of active document types configured for this pharmacy (e.g., Boleta de Venta, Factura). Callssp_get_tipos_comprobante. The IDs returned here are what you pass as id_tipo_comprobante when registering a sale.
Parameters
No parameters required.Response
200 OK — returns an array of document type records.Document type ID. Use this as
id_tipo_comprobante in POST /api/ventas/registrar.Human-readable document type name (e.g.,
"BOLETA DE VENTA", "FACTURA").Series prefix letter used for numbering (e.g.,
"B" for Boleta, "F" for Factura).Errors
| Status | Condition | Body |
|---|---|---|
500 | Database or server error | { "error": "<message>" } |
Example
Response
GET /api/comprobantes/serie/:id_tipo
Returns the series string and the next correlative number for a given document type. Callssp_get_serie_correlativo. Call this endpoint after the cashier selects a document type so the register can display the document number that will be issued.
Path parameters
Document type ID. Obtain valid IDs from
GET /api/comprobantes/tipos.Response
200 OKCurrent series assigned to this document type (e.g.,
"B001").Next sequential number, zero-padded to 8 digits (e.g.,
"00000042"). This is the number that will appear on the next issued document.Errors
| Status | Condition | Body |
|---|---|---|
404 | No series configured for the given document type ID | { "error": "Tipo de comprobante no encontrado" } |
500 | Database or server error | { "error": "<message>" } |
Example
Response