Clients
List All Clients
curl -X GET "${VITE_BASE_URL}/client" \
-H "Authorization: Bearer <token>"
Retrieves a list of all clients.
Authentication Required: Yes
Response
Array of client objectsClient name or business name
RFC (Tax ID) for Mexican clients
{
"data": [
{
"id": 1,
"name": "Empresa XYZ S.A. de C.V.",
"email": "[email protected]",
"phone": "+52 55 1234 5678",
"rfc": "EXY980101ABC",
"address": "Av. Reforma 123, CDMX",
"created_at": "2024-01-15T10:30:00Z"
}
]
}
Get Client by ID
curl -X GET "${VITE_BASE_URL}/client/1" \
-H "Authorization: Bearer <token>"
Retrieves a single client by ID.
Authentication Required: Yes
Path Parameters
Response
Additional client details
{
"id": 1,
"name": "Empresa XYZ S.A. de C.V.",
"email": "[email protected]",
"phone": "+52 55 1234 5678",
"rfc": "EXY980101ABC",
"address": "Av. Reforma 123, CDMX",
"regimen_fiscal_id": 601,
"cfdi_id": "G03",
"client_data": [
{
"id": 1,
"key": "industry",
"value": "Retail"
}
]
}
Create Client
curl -X POST "${VITE_BASE_URL}/client" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "New Client Company",
"email": "[email protected]",
"phone": "+52 55 9876 5432",
"rfc": "NCO240101XYZ",
"address": "Calle Principal 456",
"regimen_fiscal_id": 601,
"cfdi_id": "G03"
}'
Creates a new client.
Authentication Required: Yes
Request Body
Client name or business name
RFC (Tax ID) for Mexican clients
Response
{
"id": 42,
"message": "Client created successfully"
}
Update Client
curl -X PUT "${VITE_BASE_URL}/client/1" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Client Name",
"email": "[email protected]"
}'
Updates an existing client.
Authentication Required: Yes
Path Parameters
Request Body
Same fields as Create Client (all optional for updates)
Delete Client
curl -X DELETE "${VITE_BASE_URL}/client/1" \
-H "Authorization: Bearer <token>"
Deletes a client.
Authentication Required: Yes
Path Parameters
Client Details
List All Client Details
curl -X GET "${VITE_BASE_URL}/client_data" \
-H "Authorization: Bearer <token>"
Retrieves all client detail records (custom key-value pairs).
Authentication Required: Yes
Get Client Detail by ID
curl -X GET "${VITE_BASE_URL}/client_data/1" \
-H "Authorization: Bearer <token>"
Retrieves a specific client detail record.
Authentication Required: Yes
Path Parameters
Create Client Detail
curl -X POST "${VITE_BASE_URL}/client_data" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"client_id": 1,
"key": "payment_terms",
"value": "Net 30"
}'
Creates a new client detail record.
Authentication Required: Yes
Request Body
Client ID this detail belongs to
Detail key (e.g., “industry”, “payment_terms”)
Update Client Detail
curl -X PUT "${VITE_BASE_URL}/client_data/1" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"value": "Net 60"}'
Updates an existing client detail record.
Authentication Required: Yes
Path Parameters
Delete Client Detail
curl -X DELETE "${VITE_BASE_URL}/client_data/1" \
-H "Authorization: Bearer <token>"
Deletes a client detail record.
Authentication Required: Yes
Path Parameters
Client detail record ID to delete