Skip to main content
The Lubrication Services API (Engrases) allows you to manage and track all vehicle service expenses including lubrication, washing, and other maintenance costs.

Base URL

POST /api/engrases
All endpoints require authentication with a valid JWT token.

Available Endpoints

List Services

Get all service records with pagination and filtering

Create Service

Record a new service event

Update Service

Update an existing service record

Delete Service

Remove a service record

Dashboard Analytics

Get KPIs, trends, and analytics

Financial Reports

Generate detailed financial reports

Data Model

The Engrase model tracks service expenses:
interface Engrase {
  id?: number;
  fecha: string;
  conductor_id: number;
  placa_id: number;
  area_operacion_id: number;
  lavado: number;        // Washing cost
  engrase: number;       // Lubrication cost
  otros: number;         // Other services cost
  suma?: number;         // Total (calculated)
  observaciones?: string | null;
  creado_por?: string;
  actualizado_por?: string;
  actualizado_en?: string;
}

interface EngraseRelacion {
  idx: number;
  id: number;
  fecha: string;
  conductor_id: number;
  conductor: string;
  placa_id: number;
  placa: string;
  area_operacion_id: number;
  area_operacion: string;
  lavado: number;
  engrase: number;
  otros: number;
  suma: number;
  observaciones: string | null;
}

Common Parameters

Pagination

  • page - Page number (default: 1)
  • limit - Items per page (default: 20)

Filters

  • conductor - Filter by driver name
  • placa - Filter by vehicle plate
  • area_operacion - Filter by operational area
  • fecha_inicio - Start date (YYYY-MM-DD)
  • fecha_fin - End date (YYYY-MM-DD)

Sorting

  • sort_by - Field to sort by (fecha, suma, placa)
  • sort_order - Sort direction (asc, desc)

Authentication

All endpoints require a Bearer token:
curl https://api.example.com/api/engrases \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Error Responses

All endpoints follow standard HTTP status codes:
StatusDescription
200Success
400Bad request - Invalid parameters
401Unauthorized - Missing or invalid token
404Not found - Resource doesn’t exist
500Server error

Next Steps

Quick Start

Get started with the API

Authentication

Learn about authentication

Build docs developers (and LLMs) love