Skip to main content

Get Vehicle Plates

curl https://api.example.com/api/catalogos/placas \
  -H "Authorization: Bearer <your-token>"
Retrieves a list of active vehicle license plates ordered alphabetically.

HTTP Request

GET /api/catalogos/placas

Authentication

This endpoint requires authentication via Bearer token.

Headers

Authorization
string
required
Bearer token for authentication

Response

id
number
Unique identifier for the vehicle
placa
string
Vehicle license plate number

Example Response

[
  {
    "id": 1,
    "placa": "ABC123"
  },
  {
    "id": 2,
    "placa": "XYZ789"
  }
]

Get Fuel Pumps

curl https://api.example.com/api/catalogos/bombas \
  -H "Authorization: Bearer <your-token>"
Retrieves a list of active fuel pumps ordered by pump identifier.

HTTP Request

GET /api/catalogos/bombas

Authentication

This endpoint requires authentication via Bearer token.

Headers

Authorization
string
required
Bearer token for authentication

Response

id
number
Unique identifier for the pump
bomba
string
Pump identifier/name

Example Response

[
  {
    "id": 1,
    "bomba": "Bomba 1"
  },
  {
    "id": 2,
    "bomba": "Bomba 2"
  }
]

Implementation Details

  • Data is fetched from the areas_bombas table
  • Only pumps with estado = 'ACTIVADA' are returned
  • Results are ordered by bomba field

Get Pump Balance

curl "https://api.example.com/api/catalogos/saldo-bomba?bombaId=1&fecha=2026-03-04" \
  -H "Authorization: Bearer <your-token>"
Retrieves the available balance for a specific pump on a given date.

HTTP Request

GET /api/catalogos/saldo-bomba

Authentication

This endpoint requires authentication via Bearer token.

Headers

Authorization
string
required
Bearer token for authentication

Query Parameters

bombaId
number
required
ID of the pump to query
fecha
string
required
Date in YYYY-MM-DD format to check balance for

Response

saldo
number
Available balance for the pump. Returns 0 if no records found.

Example Response

{
  "saldo": 1500.50
}

Error Response

{
  "error": "Bomba ID y fecha son requeridos"
}

Implementation Details

  • Queries the tanqueo_relaciones table for the most recent balance
  • Finds the last record where bomba_id matches and fecha <= provided date
  • Returns the saldo_disponible from that record
  • If no records are found, returns saldo: 0
  • Results are ordered by date descending to get the most recent balance

Build docs developers (and LLMs) love