The client endpoints let you manage the pharmacy’s customer directory. The list and search endpoints power the register screen’s client lookup; the create and update endpoints are used from the Clientes management page.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/clientes
Returns all client records. Accepts an optional search term to filter the results server-side. Callssp_get_todos_clientes.
Query parameters
Optional search term matched against the client’s document number or name. Omit or pass an empty string to return all clients.
Response
200 OK — returns an array of client records.Internal client ID.
Client’s DNI or RUC number.
Full name or business name.
Example
GET /api/clientes/buscar
Looks up a customer by their DNI (8 digits) or RUC (11 digits). Callssp_buscar_cliente and returns either the matching record or a { "encontrado": false } sentinel — it never returns a 404 for a missing customer, making it safe to call optimistically as the cashier types.
Query parameters
Customer document number. Accepts DNI (8 digits) or RUC (11 digits).
Response
200 OK — customer foundtrue when a matching customer record exists.Internal customer ID.
Stored document number.
Full name or business name on file.
false when no record matches the document number. No other fields are returned.Errors
| Status | Condition | Body |
|---|---|---|
400 | doc query parameter missing | { "error": "El parámetro \"doc\" es requerido" } |
500 | Database or server error | { "error": "<message>" } |
An unknown document number is not an error condition. The register allows sales to unregistered customers; when
encontrado is false the cashier can type the name manually.Example — found
Response (found)
Example — not found
Response (not found)
POST /api/clientes
Creates a new client record. Callssp_crear_cliente. Returns a conflict error if the document number already exists.
Request body
DNI (8 digits) or RUC (11 digits) of the new client. Must be unique.
Full name (individual) or registered business name.
Response
201 CreatedInternal ID of the newly created client.
Confirmation message (
"Cliente creado exitosamente").Errors
| Status | Condition | Body |
|---|---|---|
400 | numero_documento or nombres_razon_social missing | { "error": "Número de documento y nombre son obligatorios" } |
409 | Document number already exists | { "error": "Ya existe un cliente con ese número de documento" } |
500 | Database or server error | { "error": "<message>" } |
Example
Response
PUT /api/clientes/:id
Updates an existing client’s document number or name. Callssp_actualizar_cliente.
Path parameters
Internal client ID.
Request body
Updated DNI or RUC number.
Updated full name or business name.
Response
200 OKConfirmation message (
"Cliente actualizado exitosamente").Errors
| Status | Condition | Body |
|---|---|---|
400 | numero_documento or nombres_razon_social missing | { "error": "Número de documento y nombre son obligatorios" } |
500 | Database or server error | { "error": "<message>" } |
Example
Response