# BVN Identity Matching

{% hint style="info" %}
Please note that when using your test key, Our test persona is **John Doe** and his BVN is **10000000001.** Hence all matching done with your test keys with details other than our Test Persona would simulate a failed identity matching.
{% endhint %}

#### John Doe's matching test&#x20;

```
ID_SAMPLE = {
    idNumber: '10000000001',
    firstname: 'John',
    lastname: 'Doe',
    dob: '04-04-1944',
    gender: 'male',
    email: 'johndoe@test.ng',
    phone: '+2348000000001'
}
```

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

```
{
    "firstname": "JOHN",
    "lastname": "Doe",
    "phone": "+2348000000001",
    "dob": "04-04-1944",
    "gender": "female",
    "email": "johndoe@test.ng"
}
```

{% endtab %}

{% tab title="CURL" %}

```
curl --location --request POST 'https://vapi.verifyme.ng/v1/verifications/identities/bvn/10000000001/match' \
--header 'Authorization: Bearer {your secret key}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstname": "JOHN",
    "lastname": "DOe",
    "phone": "+2348000000001",
    "dob": "04-04-1944",
    "gender": "female",
    "email": "johndoe@test.ng"
}
'
```

{% endtab %}
{% endtabs %}

## Identity Matching

<mark style="color:green;">`POST`</mark> `https://vapi.verifyme.ng/v1/verifications/identities/bvn/:ref/match`

Use this endpoint to match data supplied to bvn verified data

#### Path Parameters

| Name                                  | Type   | Description |
| ------------------------------------- | ------ | ----------- |
| ref<mark style="color:red;">\*</mark> | string | BVN number  |

#### Headers

| Name                                            | Type   | Description          |
| ----------------------------------------------- | ------ | -------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Authorization Header |

#### Request Body

| Name         | Type   | Description   |
| ------------ | ------ | ------------- |
| firstname    | string | First name    |
| emailAddress | string | Email address |
| phoneNumber  | String | Phone number  |
| dob          | String | Date of birth |
| lastname     | String | Last name     |
| gender       | String | Gender        |

{% tabs %}
{% tab title="201: Created Success response" %}

```
{
    "status": "success",
    "data": {
        "bvn": "10000000001",
        "fieldMatches": {
            "firstname": true,
            "lastname": true,
            "dob": true,
            "gender": false,
            "phoneNumber": true,
            "emailAddress": true
        }
    }
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized Error" %}

```
{
    "statusCode": 401,
    "error": "Unauthorized"
}
```

{% endtab %}

{% tab title="404: Not Found BVN not found" %}

```
{
    "code":"NOT_FOUND_ERROR",
    "message":"BVN provided is not found. Please provide a valid bvn"
}
```

{% endtab %}
{% endtabs %}
