# Proof of Address Check

## Run a proof of address check

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

This check can only be performed on a [client](https://docs.complycube.com/documentation/api-reference/core-resources/clients) of type `person`. Furthermore, the `documentId` provided must have associated image attachments that adhere to our [image specifications](https://docs.complycube.com/documentation/api-reference/document-check#image-specifications).

[Learn more about Proof of Address Checks](https://app.gitbook.com/s/KyFKMqftsmT6qln9zo5y/kyc-automation-services/proof-of-address-check).

{% hint style="info" %}
We will use the **front side** of the document for the Proof of Address Check.
{% endhint %}

## Check request

<table><thead><tr><th width="283.4">Attribute</th><th width="91">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>proof_of_address_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 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": "proof_of_address_check"
        }'
```

{% endtab %}

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

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

{% endtab %}

{% tab title="Python" %}

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

{% endtab %}

{% tab title="PHP" %}

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

{% endtab %}

{% tab title=".NET" %}

```csharp
var checkRequest = new CheckRequest {
  clientId = "CLIENT_ID",
  documentId = "DOCUMENT_ID",
  addressId = "ADDRESS_ID",
  type = "proof_of_address_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 conducted returned a successful result, and hence the proof of address document is valid.
2. `attention`: Indicates at least one of the analysis results requires attention.

### Breakdown

The breakdown comprises the following objects:

#### `extractedData` object

The data extracted using [Optical Character Recognition (OCR)](https://en.wikipedia.org/wiki/Optical_character_recognition). It has the following constituents:

* `documentDetails`: Data relating to the document.

  * `documentType`: The detected document type. Values include:&#x20;

    * `bank_statement`
    * `driving_license`
    * `utility_bill`
    * `tax_document`

  * `issuer`: The document issuing vendor.

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

* `holderDetails` : Data relating to the document holder.

  * `entityName`: The full extracted name of the document holder.

* `addressDetails` : Data relating to the extracted address.
  * `addressLine`: The extracted address line as a string.
  * `addressCountry`: The address country. This will be the [two-letter country ISO code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
  * `address`: This will be the structured address, which includes the following:
    * `propertyNumber`: The property number.
    * `building`: The building name.
    * `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).
    * `latLong`: The address latitude and longitude geographic coordinates.

#### Analysis

For each conducted analysis, the returned values include:

1. `clear`: Indicates the analysis returned a successful result.
2. `attention`: Indicates a potential falsified or fraudulent document.&#x20;
3. `not_processed`: Returned when ComplyCube is not able to process the document. This can occur due to a number of reasons, including:
   * The document image is invalid
   * The document image is of poor quality and therefor unreadable

#### `clientValidation` object

The client validation results. It has the following constituents::

* `firstName`: Indicates whether the client provided first name matches the extracted entity name.
* `lastName`: Indicates whether the client provided last name matches the extracted entity name.
* `address`: Indicates whether any of the client provided addresses match the extracted address.

#### `contentAnalysis` object

The content analysis results. It has the following constituents:

* `documentAge`: Indicates the document had expired (when it's a Driving License) or is older than 3 months when it's a Bank Statement, Utility Bill, or Tax Document.

#### `geolocationAnalysis` object

The geolocation analysis results. It has the following constituents:

* `ipInAddressCountry`: Indicates the geolocation of the client IP address resides in the extracted address country.&#x20;
* `ipProximityToAddress`: Indicates the geolocation of the client IP address is within a reasonable distance from the extracted address country.&#x20;

## Sample Response

```javascript
{
   "id": "614cfa9460fe4700098f3af9",
   "entityName": "John Doe",
   "type": "proof_of_address_check",
   "clientId": "5e94b75d01bce00008c86f02",
   "documentId": "6149f415cb31190008991526",
   "status": "complete",
   "result": {
      "outcome": "clear",
      "breakdown": {
         "extractedData": {
            "holderDetails": {
               "entityName": "John Doe"
            },
            "documentDetails": {
               "documentType": "bank_statement",
               "issuer": "Barclays Bank",
               "issuingDate": {
                  "day": 25,
                  "month": 1,
                  "year": 2021
               }
            },
            "addressDetails": {
               "address": {
                  "propertyNumber": "323",
                  "line": "Common street",
                  "city": "Aldgate",
                  "state": "London",
                  "postalCode": "W99 0RD",
                  "country": "GB",
                  "latLong": "51.5136,-0.077188"
               },
               "addressLine": "323 Common Street Aldgate London W99 0RD",
               "addressCountry": "GB"
            }
         },
         "clientValidation": {
            "firstName": "clear",
            "lastName": "clear",
            "address": "clear"
         },
         "contentAnalysis": {
            "documentAge": "clear"
         },
         "geoLocationAnalysis": {
            "ipInAddressCountry": "clear",
            "ipProximityToAddress": "clear"
         }
      }
   },
   "createdAt": "2021-04-04T17:25:21.116Z",
   "updatedAt": "2021-04-04T17:25:33.116Z"
}
```
