# Phone Verification

## What's the difference between this service and IDMatch?

In short, the main differences between this service and IDMatch are:

* **The Goals -** this service knows that your main objective is matching a phone number to a target. Therefore, this service will continue to search sources until that goal can either be confirmed or denied.
* **The Required Inputs -** this service only requires a first name, last name and phone number on input to process, but can accept all other target attributes and will attempt to match anything sent in the request.
* **The Data Sources -** this service uses additional phone number specific data sources to increase your success rate.

## Can I verify a user to their phone number outside of the United States?

Yes. There are many countries outside of the US where Veratad has access to phone information. Please see the country coverage below:

{% content-ref url="../../coverage/international" %}
[international](https://api.veratad.com/coverage/international)
{% endcontent-ref %}

{% hint style="success" %}
Using this service coupled with **PhoneMatch5.0.SMS** and/or **PhoneMatch5.0.Call** is a great way to verify that the number belongs to your customer and that they have possession of the device to increase identity verification confidence.
{% endhint %}

## PhoneMatch5.0

<mark style="color:green;">`POST`</mark> `https://production.idresponse.com/process/comprehensive/gateway`

Make an **HTTPS POST** request with the following body parameters to find out if the target has provided valid identity attributes. You will receive a synchronous response in 2-3 seconds with a **result** object that includes an **action, detail** and **issues object**.

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| user<mark style="color:red;">\*</mark>    | string | Your account's API username                                        |
| pass<mark style="color:red;">\*</mark>    | string | Your account's API password                                        |
| service<mark style="color:red;">\*</mark> | string | The service name (PhoneMatch5.0)                                   |
| reference                                 | string | A unique identifier for your customer                              |
| target                                    | object | The individual being sent for verification                         |
| fn<mark style="color:red;">\*</mark>      | string | The target's first name                                            |
| ln<mark style="color:red;">\*</mark>      | object | The target's last name                                             |
| addr                                      | string | The target's street address (line 1 and line 2)                    |
| city                                      | string | the target's city                                                  |
| state                                     | string | The target's state                                                 |
| zip                                       | string | The target's zip                                                   |
| dob                                       | string | The target's Date of Birth (YYYYMMDD format)                       |
| ssn                                       | string | The target's SSN (either 4 or 9)                                   |
| phone<mark style="color:red;">\*</mark>   | string | The target's phone number                                          |
| email                                     | string | The target's email address                                         |
| age                                       | string | The age to check (must be sent like "age+" i.e. "18+", "21+" etc.) |
| test\_key                                 | string | The test key value that you are using to test                      |

{% tabs %}
{% tab title="200 Transaction processed and result returned" %}

```javascript
{
  "meta": {
    "company": "Company ABC, Inc.",
    "confirmation": "21201890",
    "reference": "12345 {A UNIQUE ID}",
    "service": "PhoneMatch5.0",
    "timestamp": "2017-08-08 17:56:14",
    "user": "user@company.com"
  },
  "result": {
    "action": "REVIEW",
    "detail": "TRANSACTION REQUIRES FURTHER ATTENTION",
    "issues": [
      "PHONE CHECK FAILED"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Sample Request Body

```javascript
{
      "user": "user@company.com",
      "pass": "PASSWORD",
      "service": "IDMatch5.0",
      "reference": "12345 {A UNIQUE ID}",
      "target":{
            "fn":"Barbara",
            "ln": "Miller",
            "phone": "2015106000",
            "test_key": "general_identity"
          }
  }
```

## Service Testing

Use the `test_key` attribute to test the service. When the `test_key` is provided the system will dynamically drop the live data sources and use the testing database.

{% content-ref url="../../testing-1/additional-test-cases" %}
[additional-test-cases](https://api.veratad.com/testing-1/additional-test-cases)
{% endcontent-ref %}

## Action and Detail Responses

The following are all values that will be returned in the result object of the response.

| Action | Detail                                 | Description                                                                                                                                                                                                           |
| ------ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FAIL   | NO MATCH                               | No matching identity found in the data sources                                                                                                                                                                        |
| FAIL   | TARGET IS DECEASED                     | Target found as a deceased identity                                                                                                                                                                                   |
| REVIEW | TRANSACTION REQUIRES FURTHER ATTENTION | Target found and not deceased, but at least one identity attribute provided does not match. This will also populate the `issues`object with a list of the identity attributes that did not match. See full list below |
| PASS   | ALL CHECKS PASSED                      | Target was found is not deceased and all submitted target attributes match                                                                                                                                            |

## Issues Responses

When a transaction returns as `REVIEW` then there will be a list of issues. This list can include any of the below values.

| Issue                | Description                                           |
| -------------------- | ----------------------------------------------------- |
| ADDRESS CHECK FAILED | The address provided does not match any on file       |
| DOB CHECK FAILED     | The Date of Birth provided does not match any on file |
| SSN CHECK FAILED     | The SSN provided does not math any on file            |
| PHONE CHECK FAILED   | The phone number provided does not match any on file  |
| EMAIL CHECK FAILED   | The email address provided does not match any on file |
| AGE CHECK FAILED     | The age found does not meet the age submitted         |

## Rules

PhoneMatch will process with the default base ruleset. Which is as follows:

{% hint style="success" %}
The base ruleset will return a PASS when:

* A match is found
* The target is not deceased
* The target has provided all valid identity attributes
  {% endhint %}

{% hint style="warning" %}
The base ruleset will return a REVIEW when:

* A match is found
* The target is not deceased
* The target's identity attributes do not all match

This result will also return an array of issues to notify you of exactly which target attributes provided did not match.
{% endhint %}

{% hint style="danger" %}
The base ruleset will return a FAIL when:

* A match is not found or
* The target is deceased
  {% endhint %}
