# Manual Review

## This service is asynchronous

The manual review service includes two requests:

* **Initial Request -** make an HTTPS POST request with the below body parameters to register the document with the Veratad Manual Review Team. The response for this request will include polling instructions with a unique token for the request.

{% hint style="info" %}
**NOTE:** The total payload of the initial request can not be greater than 10mb in size.
{% endhint %}

* **Polling Request -** make an HTTPS POST request with the template returned from the initial request to find the user's final status. The majority of manual reviews will take 90 seconds to complete, but this is not guaranteed, so continue to poll until you receive the final status.

![](https://819132595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrPvlS0RZU28IENnZ_J%2F-MC8tL4PKpyVKsSUxSFy%2F-MC8ug2M0nK9-9CFNDe-%2Fmanual_review_flow%20\(4\).png?alt=media\&token=738cfbbb-75ac-459a-9373-a131b434e0c8)

## DCAMSPLUS5.0.Manual (Initial Request)

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

This is the initial request.

#### 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 (DCAMSPLUS5.0.Manual)                                |
| rules                                     | string | The rule set name (if left empty then the base rule set will be used) |
| reference                                 | string | A unique identifier for your customer                                 |
| target                                    | object | The individual being sent for verification                            |
| fn                                        | string | The target's first name                                               |
| ln                                        | 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)                          |
| license                                   | object | The target's document images                                          |
| front<mark style="color:red;">\*</mark>   | string | The target's front document image                                     |
| back                                      | string | The target's back document image                                      |
| 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
{
    "output": {
        "input": {
            "DriversLicense": "{}",
            "FirstName": "John",
            "LastName": "Smith",
            "Age": "21+",
            "DateOfBirth": "19870621",
            "TestKey": "dcams_manual_review_completed"
        },
        "documents": []
    },
    "meta": {
        "confirmation": 95742258,
        "reference": "12345",
        "service": "DCAMSPLUS5.0.Manual",
        "timestamp": "2020-07-02 10:29:33",
        "company": "Company ABC, Inc.",
        "user": "user@company.com"
    },
    "result": {
        "action": "PENDING",
        "detail": "MORE INFORMATION IS REQUIRED",
        "issues": []
    },
    "continuations": {
        "polling": {
            "url": "\/process\/continue",
            "template": {
                "polled": {
                    "status": "PROCESSING", // on initial request the status will either be PROCESSING when the action is PENDING or ERROR when the action is FAIL
                    "test_key": "",
                    "expiry": "2020-07-03 10:29:35"
                },
                "token": "37a0dvjedoyiovnwyhixf49cxm9a45la"
            },
            "instructions": "Please submit template at 2.0 second intervals until polling is complete."
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Initial Request Body

```javascript
{
  "user": "user@company.com",
  "pass": "PASSWORD",
  "service": "DCAMSPLUS5.0.Manual",
  "reference": "12345",
  "rules": "additional matching rules",
  "target": {
    "license": { // this object will accept any identity document i.e. driving license, identity card or passport.
      "front": "base64 encoded image file",
      "back": "base64 encoded image file"
    },
    "age": "21+",
    "fn": "John",
    "ln": "Smith",
    "dob": "19870621",
    "test_key": "dcams_manual_review_completed"
  }
}
```

## Test Key Initial Submission Scenarios

{% hint style="info" %}
Use the `test_key` attribute to test the service. When the `test_key` is provided the system will return a known canned response (regardless of the image provided) and these transactions are free of charge.
{% endhint %}

| test\_key                         | description                                                                           |
| --------------------------------- | ------------------------------------------------------------------------------------- |
| dcams\_manual\_review\_completed  | Returns a document output when sending `template` to `process/continue`               |
| dcams\_manual\_review\_processing | Will only return a `processing` state when sending `template` to `process/continue`   |
| dcams\_manual\_review\_error      | Will return an `error` state and `FAIL` when sending `template` to `process/continue` |

## Action and Detail Responses For the Initial Request

{% hint style="info" %}
The following are all values that will be returned in the result object of the initial response.
{% endhint %}

| Action  | Detail                       | Description                                                                                        |
| ------- | ---------------------------- | -------------------------------------------------------------------------------------------------- |
| PENDING | MORE INFORMATION IS REQUIRED | The document was accepted and is currently going through manual review process.                    |
| FAIL    | SERVICE CANNOT BE COMPLETED  | There was an issue with the submitted document and it cannot go through the manual review process. |

## Possible Status Responses

{% hint style="info" %}
On the initial request the status will always be PROCESSING or ERROR. You will only see COMPLETED during a polling request.
{% endhint %}

| status     | description                         |
| ---------- | ----------------------------------- |
| COMPLETED  | The manual review is complete       |
| PROCESSING | The manual review is processing     |
| ERROR      | The manual review resulted in error |

## DCAMSPLUS5.0.Manual (Polling Request)

<mark style="color:green;">`POST`</mark> `https://docs.idresponse.com/process/continue`

This is the polling request.

#### Request Body

| Name                                   | Type   | Description                                                                 |
| -------------------------------------- | ------ | --------------------------------------------------------------------------- |
| user<mark style="color:red;">\*</mark> | string | Your Veratad API username                                                   |
| pass<mark style="color:red;">\*</mark> | string | Your Veratad API password                                                   |
| polled                                 | object | The polled object that was returned in the template of the initial response |
| status                                 | string | The status returned in the template of the initial response                 |
| test\_key                              | string | The test\_key that you want to use during the polling request.              |
| expiry                                 | string | The expiry returned in the template of the initial response                 |
| token                                  | string | The token returned in the template of the initial response.                 |

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

```javascript
{
    "final": { // this object should be ignored. Please continue to send poll requests to the above URL in the same fashion as the first request until you get a completed result.
        "template": {
            "token": "37a0dvjedoyiovnwyhixf49cxm9a45la"
        },
        "url": "\/process\/status"
    },
    "meta": {
        "company": "Company ABC, Inc.",
        "confirmation": 95743502,
        "reference": "12345",
        "service": "DCAMSPLUS5.0.Manual",
        "timestamp": "2020-07-02 10:39:37",
        "user": "user@company.com"
    },
    "output": {
        "documents": { //this is the test case data in the DB. 
            "Address": "109 S FOSTER RD",
            "City": "BATON ROUGE",
            "Confidence": 100,
            "DateOfBirth": "19720629",
            "DocumentNumber": "003009381",
            "ExpirationDate": "20300329",
            "FirstName": "LOUISA ANNA",
            "IssueDate": "20140714",
            "LastName": "SAMPLE",
            "MiddleName": "",
            "State": "LA",
            "Zip": "70806-0000",
            "CountryCode": "USA", // (ISO Alpha 2 or 3)
            "DocumentType": "DRIVERS LICENSE" // other values are PASSPORT, IDENTITY CARD and UNKNOWN
        },
        "input": {
            "Age": "21+",
            "DateOfBirth": "19870621",
            "DriversLicense": "{}",
            "FirstName": "John",
            "LastName": "Smith",
            "TestKey": "dcams_manual_review_completed"
        },
        "polled": {
            "instructions": "Poll request has completed.",
            "status": "COMPLETED"
        }
    },
    "result": {
        "action": "REVIEW",
        "detail": "TRANSACTION REQUIRES FURTHER ATTENTION",
        "issues": ["LAST NAME DOES NOT MATCH DOCUMENT", "DOB DOES NOT MATCH DOCUMENT", "FIRST NAME DOES NOT MATCH DOCUMENT"]
    }
}
```

{% endtab %}
{% endtabs %}

## Sample Polling Request Body

```javascript
{
    "user": "user@company.com",
    "pass": "PASSWORD",
    "polled": {
        "status": "PROCESSING",
        "test_key": "dcams_manual_review_pass",
        "expiry": "2020-07-03 10:29:35"
    },
    "token": "37a0dvjedoyiovnwyhixf49cxm9a45la"
}
```

## Test Key Polling Response Scenarios

| test\_key                                  | description                                                                                 |
| ------------------------------------------ | ------------------------------------------------------------------------------------------- |
| dcams\_manual\_review\_pass                | When submitted the polling action will be PASS                                              |
| dcams\_manual\_review\_fail\_expired       | When submitted the polling action will be FAIL and detail will be DOCUMENT IS EXPIRED       |
| dcams\_manual\_review\_fail\_age           | When submitted the polling action will be FAIL and detail will be DOCUMENT AGE CHECK FAILED |
| dcams\_manual\_review\_fail\_not\_valid    | When submitted the polling action will be FAIL and detail will be NOT A VALID DOCUMENT      |
| dcams\_manual\_review\_fail\_not\_verified | When submitted the polling action will be FAIL and detail will be DOCUMENT NOT VERIFIED     |

{% hint style="info" %}
If you are using one of the additional rule sets and want to get a REVIEW then just send the `dcams_manual_review_pass` key and change one of the target attributes to something that does not match the test case returned.
{% endhint %}

## Action and Detail Responses for the Polling Request

| action | detail                                 | description                                                                                                                          |
| ------ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| FAIL   | NOT A VALID DOCUMENT                   | The document is not valid or visible or is cut off                                                                                   |
| FAIL   | DOCUMENT IS EXPIRED                    | The expiration date on the document is in the past                                                                                   |
| FAIL   | DOCUMENT NOT VERIFIED                  | The document is not verified                                                                                                         |
| FAIL   | DOCUMENT AGE CHECK FAILED              | The Date of Birth on the document does not meet the minimum age requirement                                                          |
| REVIEW | TRANSACTION REQUIRES FURTHER ATTENTION | One of the matching rules was not met (this only happens when using an additional rule set)                                          |
| PASS   | ALL CHECKS PASSED                      | The document is valid, is not expired, the Date of Birth meets the minimum age requirement and additional matching rules all passed. |

## Issues Responses for the Polling Request

{% hint style="info" %}
When a transaction returns as REVIEW then there will be a list of issues. This list can include any of the below values. For this service the REVIEW action will only return if you are not using the base rule set.
{% endhint %}

| Issue                                  | Description                                                                      |
| -------------------------------------- | -------------------------------------------------------------------------------- |
| FIRST NAME DOES NOT MATCH THE DOCUMENT | The target's first name does not match the first name discovered on the document |
| LAST NAME DOES NOT MATCH THE DOCUMENT  | The target's last name does not match the last name discovered on the document   |
| DOB DOES NOT MATCH THE DOCUMENT        | The target's DOB does not match the DOB discovered on the document               |

## Rules

DCAMSPLUS5.0.Manual will process with the default base ruleset unless a rule set value is supplied:

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

* The document is valid
* The document is not expired
* The Date of Birth on the document meets the age requirement
  {% endhint %}

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

* The base rule set it not used
* One or more of the target attributes do not match the document.
  {% endhint %}

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

* The document is not valid
* The document is expired
* The Date of Birth on the document does not meet the age requirement
  {% endhint %}

## Additional Rule Sets

You can set a new rule set.

| Rule Set Name                                 | Description                                                   |
| --------------------------------------------- | ------------------------------------------------------------- |
| DCAMS5\_0\_Manual\_Review\_RuleSet\_NAME\_DOB | Base Ruleset + Name and DOB on target must match the document |
| DCAMS5\_0\_Manual\_Review\_RuleSet\_NAME      | Base Ruleset + Name on target must match the document         |
