# Perform AML Screening

## Overview <a href="#overview" id="overview"></a>

This guide shows you how to run an AML Screening check using the ComplyCube API.

{% hint style="success" %}
You can try this check right away using our [Demo Postman Collection](https://docs.complycube.com/documentation/integration-resources/postman#demo-collection). It’s publicly accessible and **requires no account**.
{% endhint %}

## Integration steps <a href="#create-an-applicant" id="create-an-applicant"></a>

<figure><img src="https://2950143584-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsw26JqCBnT6AEIbxAYyk%2Fuploads%2FlFr3q2KsYUZhhZVa63aW%2Fdocumentation-AML%20Screening.drawio-min.png?alt=media&#x26;token=67a887e3-f5a9-402c-ba67-39b00fcaab89" alt=""><figcaption><p>AML Screening API Guide</p></figcaption></figure>

{% stepper %}
{% step %}

#### Create a client <a href="#create-an-applicant" id="create-an-applicant"></a>

The first step in creating any check is to add a **client** from your backend server. A client can represent either a **person** or a **company**. For individuals, you must provide a **first** and **last name**, while for companies only the **name** is required.

The response will contain an `id` (the Client ID). It is required for the next step.

{% hint style="info" %}
While not strictly required, we **strongly recommend** including a customer’s **date of birth** when registering an individual.
{% endhint %}

**Example request for creating a client**&#x20;

{% 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 %}

**Example response**

```javascript
{
    "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 %}

#### Create a **check** <a href="#create-an-applicant" id="create-an-applicant"></a>

Create a check by specifying the **Client ID** and the **check type**. ComplyCube supports two AML Screening types: [Standard](https://app.gitbook.com/s/KyFKMqftsmT6qln9zo5y/watchlist-pep-and-adverse-media/aml-screening-check#service-variants) and [Extensive](https://app.gitbook.com/s/KyFKMqftsmT6qln9zo5y/watchlist-pep-and-adverse-media/aml-screening-check#service-variants). The example below demonstrates an **Extensive AML Screening**.

The response will contain an `id` (the Check ID). It is required for the next step.

**Example request for creating a check**

{% 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",
               "type": "extensive_screening_check"
        }'
```

{% endtab %}

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

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

{% endtab %}

{% tab title="Python" %}

```python
check = cc_api.complycube.checks.create(
    "5eb04fcd0f3e360008035eb1",
    type="standard_screening_check"
)
```

{% endtab %}

{% tab title="PHP" %}

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

{% endtab %}

{% tab title=".NET" %}

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

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

{% endtab %}
{% endtabs %}

**Example response**

```javascript
{
    "id": "5ebd40714f23960008c81527",
    "entityName": "John Doe",
    "type": "extensive_screening_check",
    "clientId": "5eb04fcd0f3e360008035eb1",
    "status": "pending",
    "createdAt": "2025-01-04T17:25:21.116Z",
    "updatedAt": "2025-01-04T17:25:21.116Z"
}
```

{% endstep %}

{% step %}

#### Retrieve results

ComplyCube will then run the check. You can retrieve its [outcome and detailed breakdown](https://app.gitbook.com/s/kAhgmUKSf8CFUFVL3GEe/check-types/aml-screening-check#result-object) via the API, or review the results in the Portal.

If you have [set up webhooks](https://docs.complycube.com/documentation/integration-resources/webhooks), you’ll also receive a notification once the check is complete.

**Example request for retrieving the check outcome**

{% 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 %}

**Example response**

```javascript
{
    "id": "65c12a6426d2ab000814037e",
    "entityName": "John Doe",
    "type": "standard_screening_check",
    "clientId": "5eb04fcd0f3e360008035eb1",
    "status": "complete",
    "result": {
        "outcome": "clear",
        "breakdown": {
            "summary": {
                "pep": {
                    "level1": "clear",
                    "level2": "clear",
                    "level3": "clear",
                    "level4": "clear"
                },
                "watchlist":{
                    "sanctionsLists": "clear",
                    "otherOfficialLists": "clear",
                    "warCrimes": "clear",
                    "terror": "clear",
                    "otherExclusionLists": "clear",
                    "sanctionsControlAndOwnership": "clear"
                },
                "adverseMedia": {
                    "environmentProduction": "clear",
                    "socialLabour": "clear",
                    "competitiveFinancial": "clear",
                    "regulatory": "clear"
                },
                "otherLists": {
                    "associatedEntity": "clear",
                    "organisedCrime": "clear",
                    "financialCrime": "clear",
                    "taxCrime": "clear",
                    "corruption": "clear",
                    "trafficking": "clear"
                }
            }
        }
    },
    "createdAt": "2025-01-04T17:25:21.116Z",
    "updatedAt": "2025-01-04T17:25:21.116Z"
}
```

{% endstep %}
{% endstepper %}
