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

> Get and update driver profile information

## Get Driver Profile

```
GET /conductor/get_profile.php
```

Retrieve complete driver profile including license and vehicle information.

### Query Parameters

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

### Response

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

<ResponseField name="profile" type="object">
  Complete driver profile

  <Expandable title="profile structure">
    <ResponseField name="id" type="integer">
      Profile record ID
    </ResponseField>

    <ResponseField name="conductor_id" type="integer">
      Driver user ID
    </ResponseField>

    <ResponseField name="nombre_completo" type="string">
      Driver's full name
    </ResponseField>

    <ResponseField name="telefono" type="string">
      Contact phone number
    </ResponseField>

    <ResponseField name="direccion" type="string">
      Home address
    </ResponseField>

    <ResponseField name="aprobado" type="boolean">
      Whether driver is approved to operate
    </ResponseField>

    <ResponseField name="motivo_rechazo" type="string">
      Rejection reason if not approved
    </ResponseField>

    <ResponseField name="fecha_aprobacion" type="string">
      Approval timestamp (ISO 8601)
    </ResponseField>

    <ResponseField name="licencia" type="object">
      Driver's license information
    </ResponseField>

    <ResponseField name="vehiculo" type="object">
      Vehicle information
    </ResponseField>
  </Expandable>
</ResponseField>

### Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://76.13.114.194/conductor/get_profile.php?conductor_id=25" \
    -H "Accept: application/json"
  ```

  ```dart Dart theme={null}
  final conductorId = 25;
  final response = await http.get(
    Uri.parse('https://76.13.114.194/conductor/get_profile.php?conductor_id=$conductorId'),
    headers: {'Accept': 'application/json'},
  );

  final data = jsonDecode(response.body);
  if (data['success']) {
    final profile = data['profile'];
    print('Driver: ${profile['nombre_completo']}');
    print('Approved: ${profile['aprobado']}');
  }
  ```
</CodeGroup>

### Response Example

```json Success theme={null}
{
  "success": true,
  "profile": {
    "id": 10,
    "conductor_id": 25,
    "nombre_completo": "Juan Carlos Martínez",
    "telefono": "+573101234567",
    "direccion": "Carrera 50 #30-20",
    "aprobado": true,
    "motivo_rechazo": null,
    "fecha_aprobacion": "2024-02-10T09:00:00.000Z",
    "fecha_creacion": "2024-02-01T14:30:00.000Z",
    "fecha_actualizacion": "2024-03-15T10:15:00.000Z",
    "licencia": {
      "numero": "12345678",
      "tipo": "C1",
      "fecha_emision": "2020-05-15T00:00:00.000Z",
      "fecha_expiracion": "2030-05-15T00:00:00.000Z",
      "imagen_frente": "https://example.com/licenses/front_12345.jpg",
      "imagen_reverso": "https://example.com/licenses/back_12345.jpg"
    },
    "vehiculo": {
      "marca": "Yamaha",
      "modelo": "FZ-16",
      "anio": 2022,
      "placa": "ABC123",
      "color": "Negro",
      "capacidad_pasajeros": 1,
      "tipo": "moto"
    }
  }
}
```

***

## Update Driver Profile

```
POST /conductor/update_profile.php
```

Update driver profile information.

### Request Body

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

<ParamField body="nombre_completo" type="string">
  Full name
</ParamField>

<ParamField body="telefono" type="string">
  Phone number
</ParamField>

<ParamField body="direccion" type="string">
  Home address
</ParamField>

### Response

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

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

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

### Request Example

```bash cURL theme={null}
curl -X POST https://76.13.114.194/conductor/update_profile.php \
  -H "Content-Type: application/json" \
  -d '{
    "conductor_id": 25,
    "nombre_completo": "Juan Carlos Martínez López",
    "telefono": "+573109876543",
    "direccion": "Calle 40 #25-10"
  }'
```

***

## Submit for Approval

```
POST /conductor/submit_for_approval.php
```

Submit driver profile for admin approval after completing all required information.

### Request Body

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

### Response

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

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

### Request Example

```bash cURL theme={null}
curl -X POST https://76.13.114.194/conductor/submit_for_approval.php \
  -H "Content-Type: application/json" \
  -d '{"conductor_id": 25}'
```

### Response Example

```json Success theme={null}
{
  "success": true,
  "message": "Perfil enviado para aprobación"
}
```

<Note>
  The driver profile must be complete (personal info, license, and vehicle) before submission.
</Note>

***

## Get Verification Status

```
GET /conductor/verification_status.php
```

Check the current verification/approval status of a driver.

### Query Parameters

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

### Response

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

<ResponseField name="status" type="object">
  Verification status details

  <Expandable title="status fields">
    <ResponseField name="aprobado" type="boolean">
      Approval status
    </ResponseField>

    <ResponseField name="motivo_rechazo" type="string">
      Rejection reason if rejected
    </ResponseField>

    <ResponseField name="fecha_aprobacion" type="string">
      Approval date if approved
    </ResponseField>
  </Expandable>
</ResponseField>

### Request Example

```bash cURL theme={null}
curl -X GET "https://76.13.114.194/conductor/verification_status.php?conductor_id=25" \
  -H "Accept: application/json"
```

### Response Example

<CodeGroup>
  ```json Approved theme={null}
  {
    "success": true,
    "status": {
      "aprobado": true,
      "motivo_rechazo": null,
      "fecha_aprobacion": "2024-02-10T09:00:00.000Z"
    }
  }
  ```

  ```json Pending theme={null}
  {
    "success": true,
    "status": {
      "aprobado": false,
      "motivo_rechazo": null,
      "fecha_aprobacion": null
    }
  }
  ```

  ```json Rejected theme={null}
  {
    "success": true,
    "status": {
      "aprobado": false,
      "motivo_rechazo": "Licencia de conducción vencida",
      "fecha_aprobacion": null
    }
  }
  ```
</CodeGroup>

## Error Responses

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

<ResponseField name="400" type="Bad Request">
  Invalid parameters
</ResponseField>

## See Also

* [Driver Documents](/api/drivers/documents) - Manage driver documents
* [Driver Vehicle](/api/drivers/vehicle) - Manage vehicle information
* [Driver Earnings](/api/drivers/earnings) - View earnings data
