Skip to main content

Update Vehicle Information

POST /conductor/update_vehicle.php
Update vehicle information for a driver.

Request Body

conductor_id
integer
required
Driver ID
vehiculo_marca
string
Vehicle brand/make (e.g., “Yamaha”, “Honda”)
vehiculo_modelo
string
Vehicle model (e.g., “FZ-16”, “CBR250”)
vehiculo_anio
integer
Manufacturing year
vehiculo_placa
string
License plate number (Colombian format)
vehiculo_color
string
Vehicle color
vehiculo_tipo
string
Vehicle type: moto, auto, or mototaxi
empresa_id
integer
Transport company ID (for company-affiliated drivers)
soat_numero
string
SOAT insurance number
soat_vencimiento
string
SOAT expiration date (ISO 8601)
tecnomecanica_numero
string
Tecnomecánica certificate number
tecnomecanica_vencimiento
string
Tecnomecánica expiration date (ISO 8601)
tarjeta_propiedad_numero
string
Vehicle ownership card number

Response

success
boolean
Update success status
message
string
Success message
vehicle
object
Updated vehicle data

Request Example

curl -X POST https://76.13.114.194/conductor/update_vehicle.php \
  -H "Content-Type: application/json" \
  -d '{
    "conductor_id": 25,
    "vehiculo_marca": "Yamaha",
    "vehiculo_modelo": "FZ-16",
    "vehiculo_anio": 2022,
    "vehiculo_placa": "ABC123",
    "vehiculo_color": "Negro",
    "vehiculo_tipo": "moto",
    "soat_numero": "SOAT123456",
    "soat_vencimiento": "2025-12-31",
    "tecnomecanica_numero": "TM789012",
    "tecnomecanica_vencimiento": "2025-06-30",
    "tarjeta_propiedad_numero": "TP345678"
  }'

Response Example

Success
{
  "success": true,
  "message": "Vehículo actualizado exitosamente",
  "vehicle": {
    "marca": "Yamaha",
    "modelo": "FZ-16",
    "anio": 2022,
    "placa": "ABC123",
    "color": "Negro",
    "tipo": "moto",
    "soat_numero": "SOAT123456",
    "soat_vencimiento": "2025-12-31T23:59:59.000Z",
    "tecnomecanica_numero": "TM789012",
    "tecnomecanica_vencimiento": "2025-06-30T23:59:59.000Z",
    "tarjeta_propiedad_numero": "TP345678"
  }
}

Vehicle Types

Viax supports three vehicle types:

Moto

Standard motorcycles for single passenger

Auto

Cars for multiple passengers

Mototaxi

Motorcycle taxis with passenger cabin

Vehicle Type Enum

enum VehicleType {
  moto('moto', 'Moto'),
  auto('auto', 'Auto'),
  mototaxi('mototaxi', 'Mototaxi');
  
  final String value;
  final String label;
  
  const VehicleType(this.value, this.label);
}

License Plate Format

Colombian license plates follow specific formats:
  • Standard Format: ABC123 (3 letters + 3 numbers)
  • Motorcycles: May use 6 characters alphanumeric

Plate Normalization

The API normalizes license plates to uppercase without spaces:
String normalizePlate(String plate) {
  return plate.toUpperCase().replaceAll(RegExp(r'[^A-Z0-9]'), '');
}

// Example:
normalizePlate('abc-123')  // Returns: 'ABC123'
normalizePlate('abc 123')  // Returns: 'ABC123'

Required Documents

For vehicle registration in Colombia, drivers must provide:
1

SOAT

Mandatory traffic accident insurance (Seguro Obligatorio de Accidentes de Tránsito)
2

Tecnomecánica

Technical-mechanical inspection certificate
3

Tarjeta de Propiedad

Vehicle ownership card
4

Vehicle Photos

Photos of the vehicle (front, side, interior)

Document Expiration Validation

Important: SOAT and Tecnomecánica must be valid (not expired) for the driver to be approved and remain active.

Check Document Validity

bool isDocumentValid(DateTime? expirationDate) {
  if (expirationDate == null) return false;
  return DateTime.now().isBefore(expirationDate);
}

bool isSOATExpiringSoon(DateTime? expirationDate) {
  if (expirationDate == null) return true;
  final warningDate = DateTime.now().add(Duration(days: 30));
  return expirationDate.isBefore(warningDate);
}

Completeness Check

The vehicle model includes helper methods to check if all required information is complete:
class VehicleModel {
  // Check if basic vehicle info is complete
  bool get isBasicComplete {
    return placa.isNotEmpty &&
        marca != null && marca!.isNotEmpty &&
        modelo != null && modelo!.isNotEmpty &&
        anio != null &&
        color != null && color!.isNotEmpty;
  }
  
  // Check if all documents are complete
  bool get isDocumentsComplete {
    return soatNumero != null && soatNumero!.isNotEmpty &&
        soatVencimiento != null &&
        tecnomecanicaNumero != null && tecnomecanicaNumero!.isNotEmpty &&
        tecnomecanicaVencimiento != null &&
        tarjetaPropiedadNumero != null && tarjetaPropiedadNumero!.isNotEmpty;
  }
  
  // Check if all required photos are uploaded
  bool get isPhotosComplete {
    return fotoVehiculo != null && fotoVehiculo!.isNotEmpty &&
        fotoTarjetaPropiedad != null && fotoTarjetaPropiedad!.isNotEmpty &&
        fotoSoat != null && fotoSoat!.isNotEmpty &&
        fotoTecnomecanica != null && fotoTecnomecanica!.isNotEmpty;
  }
}

Error Responses

400
Bad Request
Invalid vehicle data or expired documents
404
Not Found
Driver not found
500
Internal Server Error
Server error during update

See Also

Build docs developers (and LLMs) love