POST /conductor/update_vehicle.php
Update vehicle information for a driver.
Request Body
Vehicle brand/make (e.g., “Yamaha”, “Honda”)
Vehicle model (e.g., “FZ-16”, “CBR250”)
License plate number (Colombian format)
Vehicle type: moto, auto, or mototaxi
Transport company ID (for company-affiliated drivers)
SOAT expiration date (ISO 8601)
Tecnomecánica certificate number
tecnomecanica_vencimiento
Tecnomecánica expiration date (ISO 8601)
Vehicle ownership card number
Response
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": 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);
}
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:
SOAT
Mandatory traffic accident insurance (Seguro Obligatorio de Accidentes de Tránsito)
Tecnomecánica
Technical-mechanical inspection certificate
Tarjeta de Propiedad
Vehicle ownership card
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
Invalid vehicle data or expired documents
Server error during update
See Also