Skip to main content
Calculate the fare for a taxi trip between two neighborhoods in Duitama. The server automatically determines the current time using Colombia time (UTC-5) — you do not pass a time in the request.

Pricing logic

Fare calculation follows a strict priority order:
  1. Special route — If either neighborhood belongs to a special route zone, a fixed fare applies (overrides everything else).
  2. Terminal table — If either end is Terminal de Transporte or Carrera 42, the terminal fare table is used for the other neighborhood.
  3. General table — All other trips use the highest sector between origin and destination.
A surcharge of $600 COP is added on Jueves/Viernes Santo and December 16–31 (not stackable with itself).
Nighttime rates apply from 7:00 p.m. to 5:59 a.m. Colombia time (UTC-5). The API reads the server clock automatically — callers never pass a time.

Endpoint

POST /api/v2026/calculate-fare

Request

Content-Type: application/json is required. Omitting this header returns 415 UNSUPPORTED_MEDIA_TYPE.

Body parameters

origen
string
required
Origin neighborhood name. Matching is exact after normalizing accents and casing (e.g., "san fernando" and "San Fernando" resolve the same).
destino
string
required
Destination neighborhood name. Same normalization rules as origen.

Response

200 — Fare calculated

success
boolean
required
Always true on a successful response.
timestamp
string
required
ISO 8601 UTC timestamp of the request (e.g., "2026-03-10T14:30:00.000Z").
request_id
string
required
UUID v4 unique identifier for this request.
data
object
required

Error responses

success
boolean
Always false on error.
error
object
HTTP statusError codeCause
400VALIDATION_ERRORorigen or destino is missing or not a string.
415UNSUPPORTED_MEDIA_TYPEContent-Type header is not application/json.
422SECTOR_NOT_FOUNDNeither neighborhood was found in any sector or special route.

Examples

curl -X POST http://localhost:3000/api/v2026/calculate-fare \
  -H "Content-Type: application/json" \
  -d '{"origen":"San Fernando","destino":"Centro"}'

Sample response — day fare, primer sector

{
  "success": true,
  "timestamp": "2026-03-10T14:30:00.000Z",
  "request_id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
  "data": {
    "origen": "San Fernando",
    "destino": "Centro",
    "hora_consulta": "09:30",
    "fecha_consulta": "2026-03-10",
    "fuente": "barrios.json → primer_sector",
    "tarifa": 7000,
    "tipo": "diurna",
    "sector_aplicado": "primer sector",
    "detalle": "Tarifa base primer sector diurna",
    "recargos": []
  }
}

Sample response — special route

{
  "success": true,
  "timestamp": "2026-03-10T14:30:00.000Z",
  "request_id": "b2c3d4e5-f6a7-4890-bcde-f12345678901",
  "data": {
    "origen": "Terminal de Transporte",
    "destino": "Cogollo",
    "hora_consulta": "09:30",
    "fecha_consulta": "2026-03-10",
    "fuente": "rutas_especiales.json → ruta_1",
    "tarifa": 15000,
    "tipo": "diurna",
    "sector_aplicado": "ruta especial única",
    "detalle": "Ruta del Mundial / Cogollo / Campohermoso (zona: Cogollo)",
    "recargos": []
  }
}

Sample error — missing field

{
  "success": false,
  "timestamp": "2026-03-10T14:30:00.000Z",
  "request_id": "c3d4e5f6-a7b8-4901-cdef-012345678902",
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Datos de entrada inválidos",
    "details": {
      "destino": ["El destino es requerido"]
    }
  }
}

Build docs developers (and LLMs) love