Skip to main content

Update License Information

POST /conductor/update_license.php
Update driver’s license information.

Request Body

conductor_id
integer
required
Driver ID
numero
string
License number
tipo
string
License type/category (e.g., “C1”, “C2”)
fecha_emision
string
Issue date (ISO 8601 format)
fecha_expiracion
string
Expiration date (ISO 8601 format)
imagen_frente
string
URL or base64 of license front image
imagen_reverso
string
URL or base64 of license back image

Response

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

Request Example

curl -X POST https://76.13.114.194/conductor/update_license.php \
  -H "Content-Type: application/json" \
  -d '{
    "conductor_id": 25,
    "numero": "87654321",
    "tipo": "C1",
    "fecha_emision": "2021-06-15",
    "fecha_expiracion": "2031-06-15"
  }'

Response Example

Success
{
  "success": true,
  "message": "Licencia actualizada exitosamente",
  "license": {
    "numero": "87654321",
    "tipo": "C1",
    "fecha_emision": "2021-06-15T00:00:00.000Z",
    "fecha_expiracion": "2031-06-15T00:00:00.000Z"
  }
}

Upload Document Images

Document images are typically uploaded separately using a file upload endpoint (e.g., /conductor/upload_documents.php). The upload returns URLs that are then saved using the update endpoints.

Upload Flow

1

Upload Image

Upload the image file to the document upload endpoint
2

Receive URL

Get the uploaded image URL from the response
3

Update Record

Save the URL to the license or vehicle record using update endpoints

License Document Types

For Colombian driver’s licenses, the following document categories are common:
  • C1: Motorcycles, motor tricycles, and quad bikes
  • C2: Cars, station wagons, vans, motocarros
  • C3: Heavy vehicles (trucks, buses)
  • A1: Motorcycles for public service
  • A2: Cars for public service

License Validation

The API validates license information:
Validation Rules:
  • License number must be unique
  • Expiration date must be in the future
  • Issue date must be before expiration date
  • License type must be valid for the vehicle type

Check License Expiry

bool isLicenseExpired(DateTime? expirationDate) {
  if (expirationDate == null) return true;
  return DateTime.now().isAfter(expirationDate);
}

bool isLicenseExpiringSoon(DateTime? expirationDate, {int days = 30}) {
  if (expirationDate == null) return false;
  final warningDate = DateTime.now().add(Duration(days: days));
  return expirationDate.isBefore(warningDate);
}

Document Verification

Uploaded documents are reviewed by administrators during the driver approval process. Ensure all documents are:
  • Clear and legible
  • Valid and not expired
  • Match the driver’s information

Error Responses

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

See Also

Build docs developers (and LLMs) love