The Customers API manages client profiles for your tenant. Each customer can be linked to sales (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juadariasmar/inventory_project/llms.txt
Use this file to discover all available pages before exploring further.
Venta) and quotations (Cotizacion), enabling you to track purchase history per client. The documento field is enforced as unique within a tenant, preventing duplicate client records. A dedicated /historial sub-resource returns the client’s most recent sales and active quotations in a single request, suitable for driving a customer detail panel.
All customer endpoints require an active authenticated session. No ADMIN role is required — any active tenant member can create and manage customers.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/clientes | List customers for the tenant |
| POST | /api/clientes | Create a new customer |
| GET | /api/clientes/[id] | Get a customer by ID |
| PUT | /api/clientes/[id] | Update a customer |
| GET | /api/clientes/[id]/historial | Get purchase history for a customer |
GET /api/clientes
Returns all customers belonging to the authenticated user’s tenant. Supports an optional text search across name, document number, email, and phone. Results are ordered by ID descending (newest first). The default limit is 200 records; passlimite to adjust it up to a maximum of 500.
Query parameters
Case-insensitive search string. Matched against
nombre, documento, email, and telefono fields.Maximum number of results to return. Defaults to
200; capped at 500.Response fields
Returns an array ofCliente objects.
Unique customer ID.
Customer full name.
National ID or tax document number. Unique within the tenant.
Customer email address.
Contact phone number.
Physical address.
Free-text notes about the customer.
ISO 8601 timestamp of when the customer was created.
POST /api/clientes
Creates a new customer record scoped to the tenant. Returns the createdCliente (HTTP 201). If documento is provided and a customer with the same document already exists in the tenant, the request returns 409 Conflict.
Request body
Customer full name. Cannot be empty.
National ID or tax document number. Must be unique within the tenant.
Email address.
Phone number.
Physical address.
Free-text internal notes.
Response fields
Assigned customer ID.
Customer name.
Document number.
Email address.
Phone number.
Address.
Notes.
Creation timestamp (ISO 8601).
GET /api/clientes/[id]
Returns a single customer by numeric ID. The lookup is scoped to the tenant; a valid ID belonging to a different company returns404.
Path parameters
Numeric customer ID.
Response fields
Customer ID.
Customer name.
Document number.
Email address.
Phone number.
Address.
Notes.
Creation timestamp (ISO 8601).
PUT /api/clientes/[id]
Updates a customer record. Only fields included in the request body are changed. Ifdocumento is updated, uniqueness within the tenant is re-validated; providing a document already in use by another customer returns 409 Conflict.
Path parameters
Numeric customer ID.
Request body
Updated customer name.
Updated document number. Must remain unique within the tenant.
Updated email address. Pass
"" or null to clear.Updated phone number. Pass
"" or null to clear.Updated address. Pass
"" or null to clear.Updated notes. Pass
"" or null to clear.GET /api/clientes/[id]/historial
Returns the customer’s purchase history — the 20 most recent sales and up to 10 active (PENDIENTE) quotations — alongside aggregate counts of their total sales and quotations. All data is scoped to the tenant.Path parameters
Numeric customer ID.
Response fields
Customer ID.
Customer name.
Document number.
Email address.
Phone number.
Array of the 20 most recent
Venta records for this customer, ordered newest first. Each entry includes id, total, notas, creadoEn, and canceladaEn.Array of up to 10 active (
PENDIENTE) Cotizacion records, ordered newest first.Total number of sales linked to this customer (across all time).
Total number of quotations linked to this customer.