List All Services
Retrieve a paginated list of service records.
Query Parameters
Page number for pagination
Number of records per page (max 100)
Filter by driver name (partial match, case-insensitive)
Filter by vehicle plate (partial match, case-insensitive)
Filter by operational area (partial match, case-insensitive)
Start date filter (YYYY-MM-DD format)
End date filter (YYYY-MM-DD format)
Field to sort by: fecha, suma, placa, conductor
Sort direction: asc or desc (default: desc for fecha)
Response
Array of service recordsShow EngraseRelacion properties
Sequential index for display
Service date (YYYY-MM-DD)
Total cost (lavado + engrase + otros)
Additional notes or comments
Pagination metadataShow pagination properties
Total number of records matching filters
Example Request
curl -X GET "https://api.example.com/api/engrases?page=1&limit=10&fecha_inicio=2024-01-01&fecha_fin=2024-01-31" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Response
{
"data": [
{
"idx": 1,
"id": 101,
"fecha": "2024-01-15",
"conductor_id": 5,
"conductor": "Juan Pérez",
"placa_id": 23,
"placa": "ABC-123",
"area_operacion_id": 2,
"area_operacion": "Zona Norte",
"lavado": 25000,
"engrase": 45000,
"otros": 10000,
"suma": 80000,
"observaciones": "Servicio completo"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 45,
"totalPages": 5
}
}
Get Service by ID
Retrieve a specific service record.
Path Parameters
Example Request
curl -X GET "https://api.example.com/api/engrases/101" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Get Filter Options
Retrieve unique values for filter dropdowns.
GET /api/engrases/filter-options
Response
{
"conductores": ["Juan Pérez", "María García"],
"placas": ["ABC-123", "DEF-456"],
"areas_operacion": ["Zona Norte", "Zona Sur"]
}
Financial Report
Generate a detailed financial report with totals.
GET /api/engrases/reportes/financiero
Supports the same filters as the list endpoint.
The financial report includes subtotals by area and service type.