> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Braian551/viax/llms.txt
> Use this file to discover all available pages before exploring further.

# Driver Documents

> Manage driver license and vehicle documents

## Update License Information

```
POST /conductor/update_license.php
```

Update driver's license information.

### Request Body

<ParamField body="conductor_id" type="integer" required>
  Driver ID
</ParamField>

<ParamField body="numero" type="string">
  License number
</ParamField>

<ParamField body="tipo" type="string">
  License type/category (e.g., "C1", "C2")
</ParamField>

<ParamField body="fecha_emision" type="string">
  Issue date (ISO 8601 format)
</ParamField>

<ParamField body="fecha_expiracion" type="string">
  Expiration date (ISO 8601 format)
</ParamField>

<ParamField body="imagen_frente" type="string">
  URL or base64 of license front image
</ParamField>

<ParamField body="imagen_reverso" type="string">
  URL or base64 of license back image
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Update success status
</ResponseField>

<ResponseField name="message" type="string">
  Success message
</ResponseField>

<ResponseField name="license" type="object">
  Updated license data
</ResponseField>

### Request Example

<CodeGroup>
  ```bash cURL theme={null}
  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"
    }'
  ```

  ```dart Dart theme={null}
  await http.post(
    Uri.parse('https://76.13.114.194/conductor/update_license.php'),
    headers: {'Content-Type': 'application/json'},
    body: jsonEncode({
      'conductor_id': 25,
      'numero': '87654321',
      'tipo': 'C1',
      'fecha_emision': '2021-06-15T00:00:00.000Z',
      'fecha_expiracion': '2031-06-15T00:00:00.000Z',
    }),
  );
  ```
</CodeGroup>

### Response Example

```json Success theme={null}
{
  "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

<Note>
  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.
</Note>

### Upload Flow

<Steps>
  <Step title="Upload Image">
    Upload the image file to the document upload endpoint
  </Step>

  <Step title="Receive URL">
    Get the uploaded image URL from the response
  </Step>

  <Step title="Update Record">
    Save the URL to the license or vehicle record using update endpoints
  </Step>
</Steps>

### 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:

<Warning>
  **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
</Warning>

### Check License Expiry

```dart theme={null}
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

<Note>
  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
</Note>

## Error Responses

<ResponseField name="400" type="Bad Request">
  Invalid license data or expired license
</ResponseField>

<ResponseField name="404" type="Not Found">
  Driver not found
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Server error during update
</ResponseField>

## See Also

* [Driver Profile](/api/drivers/profile) - Manage driver profile
* [Driver Vehicle](/api/drivers/vehicle) - Manage vehicle information
