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:
Special route — If either neighborhood belongs to a special route zone, a fixed fare applies (overrides everything else).
Terminal table — If either end is Terminal de Transporte or Carrera 42, the terminal fare table is used for the other neighborhood.
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
Origin neighborhood name. Matching is exact after normalizing accents and casing (e.g., "san fernando" and "San Fernando" resolve the same).
Destination neighborhood name. Same normalization rules as origen.
Response
200 — Fare calculated
Always true on a successful response.
ISO 8601 UTC timestamp of the request (e.g., "2026-03-10T14:30:00.000Z").
UUID v4 unique identifier for this request.
Origin neighborhood as provided in the request.
Destination neighborhood as provided in the request.
Time of the query in Colombia time (UTC-5), formatted as HH:MM (e.g., "09:30").
Date of the query in Colombia time, formatted as YYYY-MM-DD (e.g., "2026-03-10").
Traceability field indicating which data file and sector produced the fare (e.g., "barrios.json → primer_sector" or "rutas_especiales.json → ruta_1").
Fare in Colombian pesos (COP), including any applicable surcharge.
Fare type: "diurna" (daytime) or "nocturna" (nighttime).
Human-readable sector name used to calculate the fare (e.g., "primer sector", "cuarto sector", "ruta especial única").
Human-readable description of how the fare was determined.
List of applied surcharges. Empty array when no surcharges apply. Example entry: "Recargo especial: +$600".
Error responses
Machine-readable error code. See table below.
Human-readable error description.
Additional context, present on VALIDATION_ERROR (contains field-level errors).
HTTP status Error code Cause 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
Day fare (primer sector)
Night fare (cuarto sector)
Special route (ruta 1)
Highest sector (primer + cuarto → cuarto)
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" ]
}
}
}