Overview
The Clients API provides endpoints for creating, updating, searching, and deleting client records. All endpoints require authentication via session.Create Client
Client name
Client phone number (up to 30 characters)
Client email address (up to 64 characters)
Client address (up to 255 characters)
Client status:
1 for active, 0 for inactiveReturns HTML alert with success message: “Cliente ha sido ingresado satisfactoriamente.”
Returns HTML alert with error message if validation fails
Update Client
Client ID to update
Updated client name
Updated phone number
Updated email address
Updated address
Updated status:
1 for active, 0 for inactiveReturns HTML alert with message: “Cliente ha sido actualizado satisfactoriamente.”
Returns HTML alert with error message if validation fails
Search Clients
Must be set to
"ajax" to trigger searchSearch term to filter clients by name. Leave empty to return all clients.
Page number for pagination (default: 1, 10 results per page)
Returns HTML table with client data including:
id_cliente- Client IDnombre_cliente- Client nametelefono_cliente- Phone numberemail_cliente- Email addressdireccion_cliente- Addressstatus_cliente- Status (1 = Active, 0 = Inactive)date_added- Date added (formatted as d/m/Y)
Delete Client
Client ID to delete
Returns success alert if client is deleted successfully
Returns error alert if:
- Client has associated invoices (foreign key constraint)
- Database error occurs
Clients cannot be deleted if they have associated invoices in the system.
Autocomplete Clients
Search term for autocomplete (partial client name)
Returns JSON array (max 50 results) with objects containing:
value- Client nameid_cliente- Client IDnombre_cliente- Client nametelefono_cliente- Phone numberemail_cliente- Email address
