> For the complete documentation index, see [llms.txt](https://docs.complycube.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.complycube.com/documentation/documentation/documentation-fr/guides-rapides/api-quick-guide/perform-proof-of-address-check.md).

# Effectuer une vérification de justificatif de domicile

### Vue d'ensemble <a href="#overview" id="overview"></a>

Ce guide vous montre comment exécuter une vérification de justificatif de domicile à l'aide de l'API ComplyCube.

{% hint style="success" %}
Vous pouvez essayer cette vérification dès maintenant en utilisant notre [collection Postman de démonstration](/documentation/documentation/documentation-fr/ressources-dintegration/postman.md#demo-collection). Elle est accessible publiquement et **ne nécessite aucun compte**.
{% endhint %}

### Étapes d'intégration <a href="#integration-steps" id="integration-steps"></a>

<figure><img src="/files/9cd1495e7d1af3d8d4f910c1a048cd8d78bae0f3" alt=""><figcaption><p>Guide de l'API de vérification de justificatif de domicile</p></figcaption></figure>

{% stepper %}
{% step %}

#### Créer un client <a href="#create-a-client" id="create-a-client"></a>

La première étape pour créer toute vérification consiste à ajouter un **client** depuis votre serveur backend. Un client peut représenter soit une **personne** ou une **entreprise**.

La réponse contiendra un `identifiant` (l'ID du client). Il est requis pour l'étape suivante.

**Exemple de requête pour créer un client**

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

```bash
curl -X POST https://api.complycube.com/v1/clients \
     -H 'Authorization: <YOUR_API_KEY>' \\
     -H 'Content-Type: application/json' \\
     -d '{
          "type": "person",
          "email": "john.doe@example.com",
          "personDetails":{
               "firstName": "John",
               "lastName" :"Doe",
               "dob": "1990-01-01"
          }
        }'
```

{% endtab %}

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

```javascript
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const client = await complycube.client.create({
  type: "person",
  email: "john.doe@example.com",
  personDetails: {
    firstName: "John",
    lastName: "Doe",
    dob: "1990-01-01"
  }
});
```

{% endtab %}

{% tab title="Python" %}

```python
from complycube import ComplyCubeClient

cc_api = ComplyCubeClient(api_key='<YOUR API KEY>')

new_client = {
    'type':'person',
    'email':'john.doe@example.com',
    'personDetails': {
        'firstName':'John',
        'lastName':'Doe',
        'dob':'1990-01-01'
    }
}

client = cc_api.clients.create(**new_client)
```

{% endtab %}

{% tab title="PHP" %}

```php
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$result = $ccapi->clients()->create([
    'type' => 'person',
    'email' => 'john.doe@example.com',
    'personDetails' => [
        'firstName' => 'John',
        'lastName' => 'Doe',
        'dob' => '1990-01-01'
    ]
]);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using ComplyCube.Net;
using ComplyCube.Net.Resources.Clients;

var clientApi = new ClientApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var newclient = new ClientRequest {
  type = "person",
    email = "john.doe@example.com",
    personDetails = new PersonDetails {
      firstName = "John",
        lastName = "Doe",
        dob = "1990-01-01"
    }
}

var client = await clientApi.CreateAsync(newclient);
```

{% endtab %}
{% endtabs %}

**Exemple de réponse**

```json
{
    "id": "5eb04fcd0f3e360008035eb1",
    "type": "person",
    "email": "john.doe@example.com",
    "personDetails": {
        "firstName": "John",
        "lastName": "Doe",
        "dob": "1990-01-01"
    },
    "createdAt": "2025-01-04T17:24:29.146Z",
    "updatedAt": "2025-01-04T17:24:29.146Z"
}
```

{% endstep %}

{% step %}

#### Créer une adresse

Créez une adresse en fournissant le **ID du client** et les détails de l’adresse.

La réponse contiendra un `identifiant` (l’ID de l’adresse). Il sera requis plus tard.

**Exemple de requête pour créer une adresse**

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

```bash
curl -X POST https://api.complycube.com/v1/addresses \
     -H 'Authorization: <YOUR_API_KEY>' \\
     -H 'Content-Type: application/json' \\
     -d '{
            "clientId":"5eb04fcd0f3e360008035eb1",
            "line": "47th Test Avenue 323",
            "city": "Manhattan",
            "postalCode": "10001",
            "state": "NY",
            "country": "US"
        }'
```

{% endtab %}

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

```javascript
const address = await complycube.address.create("5eb04fcd0f3e360008035eb1", {
  line: "47th Test Avenue 323",
  city: "Manhattan",
  postalCode: "10001",
  state: "NY",
  country: "US"
});
```

{% endtab %}

{% tab title="Python" %}

```python
new_address = {    
    'line': '47th Test Avenue 323',
    'city': 'Manhattan',
    'postalCode': '10001',
    'state': 'NY',
    'country': 'US'
}

address = cc_api.addresses.create('5eb04fcd0f3e360008035eb1',**new_address)
```

{% endtab %}

{% tab title="PHP" %}

```php
$address = $ccapi->address()->create(
    '5eb04fcd0f3e360008035eb1',
    [
        'line' => '47th Test Avenue 323',
        'city' => 'Manhattan',
        'postalCode' => '10001',
        'state' => 'NY',
        'country' => 'US'
    ]
);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
var addressRequest = new AddressRequest {
  clientId = "5eb04fcd0f3e360008035eb1",
  line = "47th Test Avenue 323",
  city = "Manhattan",
  postalCode = "10001",
  state = "NY",
  country = "US"
};

var address = await addressApi.CreateAsync(addressRequest);
```

{% endtab %}
{% endtabs %}

**Exemple de réponse**

```json
{
    "id": "5ebd40714f23960008c81528",
    "clientId":"5eb04fcd0f3e360008035eb1",
    "line": "47th Test Avenue 323",
    "city": "Manhattan",
    "postalCode": "10001",
    "state": "NY",
    "country": "US",
    "createdAt": "2021-01-04T17:25:21.116Z",
    "updatedAt": "2021-01-04T17:25:21.116Z"
}
```

{% endstep %}

{% step %}

#### Créer un document <a href="#create-a-document" id="create-a-document"></a>

Créer un document en fournissant le **ID client** et **type de document** (par ex. un relevé bancaire).

La réponse contiendra un `identifiant` (l'ID du document). Il est requis pour l'étape suivante.

**Exemple de requête pour créer un document**

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

```bash
curl -X POST https://api.complycube.com/v1/documents \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
          "clientId":"5eb04fcd0f3e360008035eb1",
          "type": "bank_statement"
        }'
```

{% endtab %}

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

```javascript
const document = await complycube.document.create("5eb04fcd0f3e360008035eb1", {
  type: "bank_statement"
});
```

{% endtab %}

{% tab title="Python" %}

```python
document = cc_api.documents.create(
    '5eb04fcd0f3e360008035eb1',
    type='bank_statement'
)
```

{% endtab %}

{% tab title="PHP" %}

```php
$doc = $ccapi->documents()->create(
    '5eb04fcd0f3e360008035eb1',
    ['type' => 'bank_statement']
);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
var docRequest = new DocumentRequest {
  clientId = "5eb04fcd0f3e360008035eb1",
  type = "bank_statement"
};

var document = await docApi.CreateAsync(docRequest);
```

{% endtab %}
{% endtabs %}

**Exemple de réponse**

La réponse contiendra un `identifiant` (l'ID du document). Il est requis pour l'étape suivante.

```json
{
    "id": "5ebd40714f23960008c81527",
    "type": "bank_statement",
    "createdAt": "2025-01-04T17:25:21.116Z",
    "updatedAt": "2025-01-04T17:25:21.116Z"
}
```

{% endstep %}

{% step %}

#### Téléverser le document

Téléversez une image encodée en BASE64 du document justificatif de domicile.

Les images doivent être au **JPG**, **PNG**, ou **PDF** format et avoir entre **34 Ko** et **4 Mo** de taille.

Ci-dessous se trouve un exemple de fichier encodé en BASE64. Téléchargez-le, copiez son contenu et collez-le dans le `data` attribut lors de la requête.

{% file src="/files/2ca030ec92c9ce3172888ede0d2205c2415002c4" %}
Exemple - relevé bancaire encodé en BASE64
{% endfile %}

**Exemple de requête pour téléverser une image d'un document**

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

```bash
 curl -X POST https://api.complycube.com/v1/documents/5ebd40714f23960008c81527/upload/front \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
         "fileName": "bank-statement-sample.pdf",
         "data": "<BASE64_DATA_CONTENT>"
        }'
```

{% endtab %}

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

```javascript
const frontImage = await complycube.document.upload("5ebd40714f23960008c81527", {
    fileName: "bank-statement-sample.pdf",
    data: "<BASE64_DATA_CONTENT>"
}, "front");
```

{% endtab %}

{% tab title="Python" %}

```python
front_image = cc_api.documents.upload(
    '5ebd40714f23960008c81527', 
    'front',
    fileName='bank-statement-sample.pdf',
    data='<BASE64_DATA_CONTENT>'
)
```

{% endtab %}

{% tab title="PHP" %}

```php
$up = $ccapi->documents()->upload(
    '5ebd40714f23960008c81527', 
    'front', 
    [
        'fileName' => 'bank-statement-sample.pdf',
        'data' => '<BASE64_DATA_CONTENT>'
    ]
);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
var docFront = new ImageRequest {
  fileName = "bank-statement-sample.pdf",
  data = "<BASE64_DATA_CONTENT>"
};

var img = await docApi.UploadImageAsync(
    "5ebd40714f23960008c81527",
    "front",
    docFront
);

```

{% endtab %}
{% endtabs %}

**Exemple de réponse**

La réponse contiendra un `identifiant` (l'ID de l'image). Il est requis pour l'étape suivante.

```json
{
    "id": "5eb169302d868c0008828591",
    "fileName": "bank-statement-sample.pdf",
    "documentSide": "front",
    "downloadLink": "/documents/5ebd40714f23960008c81527/images/5eb169302d868c0008828591/download",
    "contentType": "application/pdf",
    "size": 182716,
    "createdAt": "2025-01-04T17:25:21.116Z",
    "updatedAt": "2025-01-04T17:25:21.116Z"
}
```

{% endstep %}

{% step %}

#### Créer une vérification de justificatif de domicile

Créez une vérification de justificatif de domicile en fournissant le **ID client**, **ID du document**, et **type de vérification**.

La réponse contiendra un `identifiant` (l’ID de vérification). Il est requis pour l’étape suivante.

**Exemple de requête pour créer une vérification**

{% 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":"5eb04fcd0f3e360008035eb1",
          "documentId":"5ebd40714f23960008c81527",
          "type": "proof_of_address_check"
        }'
```

{% endtab %}

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

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

{% endtab %}

{% tab title="Python" %}

```python
check = cc_api.checks.create(
    '5eb04fcd0f3e360008035eb1',
    'proof_of_address_check',
    documentId='5ebd40714f23960008c81527'
)
```

{% endtab %}

{% tab title="PHP" %}

```php
$result = $ccapi->checks()->create(
    '5eb04fcd0f3e360008035eb1',
    [
        'type' => 'proof_of_address_check',
        'documentId' => '5ebd40714f23960008c81527'
    ]
);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
var checkRequest = new CheckRequest {
  clientId = "5eb04fcd0f3e360008035eb1",
  documentId = "5ebd40714f23960008c81527",
  type = "proof_of_address_check"
};

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

{% endtab %}
{% endtabs %}

**Exemple de réponse**

```json
{
    "id": "65c12a6426d2ab000814037e",
    "entityName": "John Doe",
    "type": "proof_of_address_check",
    "clientId": "5eb04fcd0f3e360008035eb1",
    "documentId": "5ebd40714f23960008c81527",
    "status": "pending",
    "createdAt": "2025-01-04T17:25:21.116Z",
    "updatedAt": "2025-01-04T17:25:21.116Z"
}
```

{% endstep %}

{% step %}

#### Récupérer les résultats

ComplyCube exécutera ensuite la vérification. Vous pouvez récupérer son [résultat et son analyse détaillée](/documentation/api-reference/check-types/proof-of-address-check.md#result-object) via l’API, ou consulter les résultats dans le portail.

Si vous avez [configuré des webhooks](/documentation/documentation/documentation-fr/ressources-dintegration/webhooks.md), vous recevrez également une notification une fois la vérification terminée.

**Exemple de requête pour récupérer le résultat de la vérification**

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

```bash
curl -X GET https://api.complycube.com/v1/checks/5ebd40714f23960008c81527 \\
     -H 'Authorization: <YOUR_API_KEY>'
```

{% endtab %}

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

```javascript
const check = await complycube.check.get("5ebd40714f23960008c81527");
```

{% endtab %}

{% tab title="Python" %}

```python
check = cc_api.checks.get('5ebd40714f23960008c81527')
```

{% endtab %}

{% tab title="PHP" %}

```php
$check = $ccapi->checks()->get('5ebd40714f23960008c81527');
```

{% endtab %}

{% tab title=".NET" %}

```csharp
var check = await checkApi.GetAsync("5ebd40714f23960008c81527");
```

{% endtab %}
{% endtabs %}

**Exemple de réponse**

```json
{
   "id": "65c12a6426d2ab000814037e",
   "entityName": "John Doe",
   "type": "proof_of_address_check",
   "clientId": "5eb04fcd0f3e360008035eb1",
   "documentId": "5ebd40714f23960008c81527",
   "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": "2025-01-04T17:25:21.116Z",
   "updatedAt": "2025-01-04T17:25:21.116Z"
}
```

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.complycube.com/documentation/documentation/documentation-fr/guides-rapides/api-quick-guide/perform-proof-of-address-check.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
