# Driving License Check

## Run a driving license check

To run a Driving License Check, you must [create a check ](https://docs.complycube.com/documentation/api-reference/core-resources/checks/create-a-check)with `type` set to `driving_license_check`.

This check can only be performed on a [client](https://docs.complycube.com/documentation/api-reference/core-resources/clients) of type `person`.&#x20;

The `documentId` provided must meet the following conditions:

* It must be of type `driving_license`.
* It must include a valid  `documentNumber`, which represents the driving licence number.

[Learn more about Driving License Checks.](https://app.gitbook.com/s/KyFKMqftsmT6qln9zo5y/identity-verification/driving-license-check)

## Check request

<table><thead><tr><th width="262.4">Attribute</th><th width="93">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>clientId</code></td><td>string</td><td>The ID of the client associated with this check. (<strong>Required</strong>)</td></tr><tr><td><code>type</code></td><td>string</td><td>This must be set to <code>driving_license_check</code>. (<strong>Required</strong>)</td></tr><tr><td><code>documentId</code></td><td>string</td><td>The ID of the document. (<strong>Required</strong>)</td></tr></tbody></table>

## Example requests

#### Simple request

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api.complycube.com/v1/checks \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
          "clientId":"CLIENT_ID",
          "documentId":"DOCUMENT_ID",
          "type": "driving_license_check"
        }'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const check = await complycube.check.create("CLIENT_ID", {
        documentId: "DOCUMENT_ID",
        type: "driving_license_check"
});
```

{% endtab %}

{% tab title="Python" %}

```python
check = cc_api.check.create(
    'CLIENT_ID', 
    'driving_license_check', 
    documentId='DOCUMENT_ID'
)
```

{% endtab %}

{% tab title="PHP" %}

```php
$result = $ccapi->checks()->create('CLIENT_ID',
                                   ['type' => 'driving_license_check',
                                   'documentId' => 'DOCUMENT_ID']);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
var checkRequest = new CheckRequest {
  clientId = "CLIENT_ID",
  documentId = "DOCUMENT_ID",
  type = "driving_license_check"
};

var check = await checkApi.CreateAsync(checkRequest);
```

{% endtab %}
{% endtabs %}

## Result object

The `result` object is only returned when the status of the check is `complete` . It has two components - `outcome` and `breakdown`.

### Outcome

The outcome attribute represents the overall check result. Returned values include:

1. `clear`: Indicates every analysis type conducted returned a successful result.
2. `attention`: Indicates at least one of the analysis results requires attention.

### Breakdown

The breakdown comprises the following objects:

#### `documentData` object

This represents the data retrieved from the **issuing authority**. It has the following constituents:

* `documentDetails`: Data relating to the driving license.

  * `licenseType`: The detected driving license type. Values include `full` and `provisional`.

  * `issuingCountry`: The issuing country of the document. This will be the [two-letter country ISO code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).

  * `expirationDate`: The expiry date of the driving license. This will be a [structured date](https://docs.complycube.com/documentation/api-reference/core-resources/checks#structured-date-format).

  * `documentNumber`: The driving license number.

  * `points`: The number of active penalty points currently associated with the driving license.

  * `issuingDate`: The issuing date of the driving license. This will be a [structured date](https://docs.complycube.com/documentation/api-reference/core-resources/checks#structured-date-format).

  * `entitlements`:  An array of driving entitlements associated with the licence. Each object represents a specific category or class of vehicle the licence holder is permitted to drive. It includes:
    * `code`: The entitlement category code.
    * `description`: A detailed explanation of the entitlement.
    * `type`: The type of entitlement (e.g. `full`, `provisional`).
    * `issuingDate`: The date the entitlement was issued in `YYYY-MM-DD` format.
    * `expirationDate`: The date the entitlement expires in `YYYY-MM-DD` format.
    * `restrictions`: A list of restriction codes and their descriptions that apply to the entitlement.

  * `additionalDetails`: Any additional retrieved details, returned as an array of objects. Each object will contain a `key`, `value`, and `description`.

* `holderDetails` : Data relating to the driving license holder.
  * `firstName`: The list of first/given names as an array.
  * `lastName`: The list of last names as an array.
  * `dob`: The date of birth. This will be a [structured date](https://docs.complycube.com/documentation/api-reference/core-resources/checks#structured-date-format).
  * `nationality`: The nationality. This will be the [two-letter country ISO code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
  * `gender`:  The gender. Values include:&#x20;
    * `male`
    * `female`
    * `other`
  * `address` : This will be the structured address, which includes the following:
    * `propertyNumber`: The property number.
    * `line`: The address line.
    * `city`: The address city.
    * `state`: The address state.
    * `postalCode`: The address postal code.
    * `country`: The address country. This will be the [two-letter country ISO code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).

#### Analysis

For each conducted analysis, the returned values include:

1. `clear`: Indicates the analysis returned a successful result.
2. `attention`: Indicates the analysis returned a result that requires a review.&#x20;

#### `licenseVerification` object

The driving license verification results. It has the following constituents:

* `status`: Indicates whether the license has an active status.
* `infractions`: Indicates whether the license has any recorded infractions.
* `breakdown`: Breakdown related to license verification.
  * `infractionsBreakdown`: An array detailing recorded infractions associated with the driving licence. Each entry includes:
    * `offenseCode`: The official code assigned to the offence.
    * `offenseLegalDescription`: A legal description of the offence.
    * `offenseDate`: The date the offence occurred in `YYYY-MM-DD` format.
    * `penaltyPoints`: The number of penalty points applied to the licence as a result of the offence.

#### `clientDataConsistency` object

The client data consistency results. It has the following constituents::

* `name`: Indicates whether the client provided name matches the one retrieved.
* `dob`: Indicates whether the client’s provided date of birth matches the one retrieved.
* `nationality`: Indicates whether the client’s provided nationality matches the one retrieved.
* `address`: Indicates whether any of the client provided addresses match the one retrieved.

## Sample Response

{% code fullWidth="false" %}

```json
{
    "id": "688f1e2e37d2a9000202ad7f",
    "entityName": "John Doe",
    "type": "driving_license_check",
    "clientId": "688f1e2e37d2a9000202ad70",
    "documentId": "688f1e2e37d2a9000202ad76",
    "status": "complete",
    "result": {
        "outcome": "attention",
        "breakdown": {
            "clientDataConsistency": {
                "name": "clear",
                "dob": "clear",
                "nationality": "clear",
                "gender": "clear",
                "address": "clear"
            },
            "licenseVerification": {
                "status": "clear",
                "infractions": "attention",
                "breakdown": {
                    "infractionsBreakdown": [
                        {
                            "offenseCode": "SP30",
                             "offenseLegalDescription": "Exceeding statutory speed limit on a public road",
                            "offenseDate": "2018-04-28",
                            "penaltyPoints": 3
                        }
                    ]
                }
            },
            "documentData": {
                "holderDetails": {
                    "firstName": [
                        "John",
                        "Johnson"
                    ],
                    "lastName": [
                        "Smith"
                    ],
                    "dob": {
                        "day": 31,
                        "month": 1,
                        "year": 1990
                    },
                    "nationality": "GB",
                    "gender": "male",
                    "address": {
                        "propertyNumber": "123",
                        "line": "Main road",
                        "city": "City",
                        "postalCode": "WC1H 0PW",
                        "country": "GB"
                    }
                },
                "documentDetails": {
                    "issuingCountry": "GB",
                    "licenseType": "full",
                    "issuingDate": {
                        "day": 6,
                        "month": 7,
                        "year": 2020
                    },
                    "expirationDate": {
                        "day": 5,
                        "month": 7,
                        "year": 2030
                    },
                    "documentNumber": "JOHNSO101099JJ7FM",
                    "points": "3",
                    "additionalDetails": [
                        {
                            "key": "lgvValidTo",
                            "value": "2019-12-31",
                            "description": "LGV license expiry"
                        },
                        {
                            "key": "pcvValidTo",
                            "value": "2019-12-31",
                            "description": "PCV license expiry"
                        },
                        {
                            "key": "dqcIssueDate",
                            "value": "2019-12-31",
                            "description": "DQC issue date"
                        }
                    ],
                    "entitlements": [
                        {
                            "code": "A",
                            "description": "A motorcycle of a power exceeding 35 kW or with a power to weight ratio exceeding 0.2 kW per kg, or A motorcycle of a power not exceeding 35 kW with a power to weight ratio not exceeding 0.2 kW per kg and derived from a vehicle of more than double its power. A motor tricycle with a power exceeding 15 kW",
                            "type": "full",
                            "issuingDate": "2013-01-19",
                            "expirationDate": "2037-10-25",
                            "restrictions": [
                                {
                                    "code": "79(03)",
                                    "description": "Restricted to tricycles"
                                }
                            ]
                        }
                    ]
                }
            }
        }
    },
    "updatedAt": "2025-01-01T08:30:40.334Z",
    "createdAt": "2025-01-01T08:30:38.527Z"
}
```

{% endcode %}
