Introduction
The Fuel Tracking (Tanqueos) API provides comprehensive endpoints for managing fuel consumption records across your fleet. This module supports two types of operations:- TANQUEO: Regular fuel refills with vehicle and driver information
- ANTICIPO: Advance payments to fuel stations without specific vehicle assignment
Base URL
Core Endpoints
CRUD Operations
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tanqueos | List all fuel records with pagination and filters |
| GET | /api/tanqueos/:id | Get a specific fuel record by ID |
| POST | /api/tanqueos | Create a new fuel record |
| PUT | /api/tanqueos/:id | Update an existing fuel record |
| DELETE | /api/tanqueos/:id | Delete a fuel record |
| POST | /api/tanqueos/import | Bulk import fuel records from file |
Filter & Export
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tanqueos/filter-options | Get available filter options (conductors, plates, pumps, etc.) |
| GET | /api/tanqueos/reportes/general | Export filtered records for reporting |
| GET | /api/tanqueos/reportes/financiero | Get financial report view of fuel records |
| GET | /api/tanqueos/dashboard-link | Get dashboard link for user’s operational area |
Dashboard Analytics
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tanqueos/dashboard/kpis | Get executive KPIs and metrics |
| GET | /api/tanqueos/dashboard/saldos-bombas | Get fuel station balance information |
| GET | /api/tanqueos/dashboard/consumption-over-time | Get consumption trends over time |
| GET | /api/tanqueos/dashboard/fuel-distribution | Get fuel type distribution |
| GET | /api/tanqueos/dashboard/by-area | Get consumption by operational area |
| GET | /api/tanqueos/dashboard/top-vehicles | Get top 10 vehicles by consumption |
| GET | /api/tanqueos/dashboard/vehicles-by-area | Get vehicles grouped by area |
| GET | /api/tanqueos/dashboard/by-driver | Get consumption by driver |
| GET | /api/tanqueos/dashboard/by-pump | Get consumption by fuel station |
| GET | /api/tanqueos/dashboard/alerts | Get intelligent alerts for anomalies |
| GET | /api/tanqueos/dashboard/alerts/:alertType/records | Get detailed records for specific alert |
| GET | /api/tanqueos/dashboard/detailed-table | Get detailed table with flags |
Common Concepts
Authentication
All endpoints require authentication using JWT tokens. Include the token in the Authorization header:Pagination
List endpoints support pagination with the following query parameters:Page number (1-based)
Number of records per page
Filtering
Most endpoints support comprehensive filtering:Filter by driver name (partial match, case-insensitive)
Filter by vehicle plate (partial match, case-insensitive)
Filter by fuel station name (partial match, case-insensitive)
Filter by operational area name (partial match, case-insensitive)
Filter by fuel type (exact match): ACPM, GASOLINA, EXTRA
Filter by concept (exact match): OPERATIVO, ADMINISTRATIVO
Filter by operation type (exact match): TANQUEO, ANTICIPO
Filter by start date (format: YYYY-MM-DD)
Filter by end date (format: YYYY-MM-DD)
Sorting
Field to sort by (e.g., fecha, conductor, placa)
Sort order:
asc or desc. Default is descending by fecha if not specifiedData Models
Tanqueo
Core fuel record object:TanqueoRelacion
Expanded fuel record with joined relation names:Quick Start Examples
List All Fuel Records
Filter by Date Range and Area
Create a Fuel Record
Get Dashboard KPIs
Error Handling
All endpoints return standard HTTP status codes:- 200: Success
- 201: Created (for POST requests)
- 400: Bad request (validation errors)
- 401: Unauthorized (missing or invalid token)
- 404: Not found
- 500: Internal server error
Next Steps
- List Fuel Records - Detailed guide for listing and filtering
- Create Fuel Record - Create new fuel records
- Update Fuel Record - Update existing records
- Delete Fuel Record - Delete records
- Import Fuel Records - Bulk import from files
- Dashboard Analytics - Analytics and insights