# Document Validation

> **In simple terms:** This guide shows you how to verify that an ID document (like a passport or driver's license) is real and not fake. Users take a photo of their document, and Truora checks its authenticity.

{{<tags >}}

When you are creating a [**Web Flow**](/guides/flows_web/), you can select the **Document ID** box, from the **Validator Blocks**. 
This module allows you to verify the authenticity of the user's identity document.
{{<img src="/images/illustrations/document/document_validation_box.gif" alt="properties" width="100%">}}

## Properties
Depending on the level of user experience and security you want to implement in the validation process, you can configure the **Document ID** validator.

* **Enable gallery upload:** You can allow the user to upload a document from their gallery.
* **Check Type:** In countries where available, every time you run a **document validation** our system runs a default **Background check**, which will only verify datasets related  to **identity** and excludes criminal, legal, international or any other dataset types. If you wish customize the default behavior, use this field to conduct a [**Background Check**](/guides/understading_background_checks/) with a [**Custom Type**](/guides/background_check_custom_type/).
  * **Note 1**: You must have enabled the background check (BGC) product to use **Custom Type**. For each document validation request with a custom background check, you will be charged for it with the BGC price.
  * **Note 2**: If you create a **Custom Type**, you must add the dataset ``dataset_document_validation`` key with a value of **zero**.
  * ***Remember**:  Whenever you conduct a  **document validation** our system automatically initiates a default **background check** (no extra charge). Within the **Document Validation** in our dashboard, you can review this **Background Check**. First select the validation:
  {{<img src="/images/illustrations/document/document_validation_select.png" alt="document_validation_select" width="90%" class="rounded-md">}}
  Then you´ll see a link to the corresponding **Check URL**:
  {{<img src="/images/illustrations/document/document_validation_check_select.png" alt="document_validation_check_select" width="90%" class="rounded-md">}}
  Also, in the **backend** (Truora's API), you can identify within the validation response that a **check id** has been created. Your response will look similar to the following: 
  {{<code lang="json" lang_title="Response 200">}}
  {
    "validation_id":"VLDXXXXXXXXXXXXXXXXXXXXXX",
    "ip_address":"186.XXX.XX.XX",
    "account_id":"ACCXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "type":"document-validation",
    "validation_status":"success",
    "creation_date":"2023-02-06T21:04:29.726993196Z",
    "details":  {
        "background_check": {
            "check_id":"CHK123XXXXXX12",
            "check_url":"https://api.checks.truora.com/v1/checks/CHK123XXXXXX12"
            },
            "document_details": {
                "birth_place":"CALI (VALLE)",
                "country":"CO",
                "creation_date":"2023-02-06T21:04:29.652206102Z",
                "date_of_birth":"1980-XX-15T00:00:00Z",
                .
                .
                .
                .
             }
      }
  }
  {{</code>}}
  You can learn more about getting results in the [**Guide to Get Results**](/guides/get_result/).
* **Allowed retries:** This setting determines the number of times a user can retry document validation, with a maximum value of **3 retries**.
* **Allowed document types:** You can restrict the **document type** and **country** by selecting them, or ask the user to provide this information during the validation.

{{<img src="/images/illustrations/document/document_step_config.gif" alt="properties" width="100%">}}

* Additionally, using our API you can configure other parameters to improve the behavior of the validators and the user experience according to your particular needs. Please see the {{< newtab href="/guides/config_validators/" >}}Config Validator Guide{{< /newtab >}} for more information on customization.

> **Please Note:**
> - The config parameters you will see in the {{< newtab href="/guides/config_validators/" >}}Config Validator Guide{{< /newtab >}} are global parameters for your account and will affect all the validations across your account.
> - However, validations performed using the flow you created will prioritize the configuration in the Validator Block of your flow. All other parameters, not configurable within the Flow Builder, will take the global configuration values.

* Remember also you can customize your web flow. For more information please visit [Customize Web Flow](/guides/customize_web_flow) guide.

## Integrating Your Flow
Once your flow has been completed and [**tested**](/guides/flows_web#Testing_The_Flow_Template), you need to integrate it. For more information please visit [**How to create a Web Integration Token**](/guides/web_integration_token/) guide.

## Get Results of Validation
- You can get the validation results with a query to the truora's API or from the dashboard. For more information, please see [**Guide to Get Results**](/guides/get_result/).

- To get flow validation result automatically, you must subscribe webhooks. For more information, please see [**Webhooks guide**](/guides/webhook_rule).

**Note**:
* Whenever a validation fails due to inconsistencies in the validation process, a decline reason is indicated. To know the possible decline reasons, please visit the [**Declined Reasons**](/guides/declined_reasons_details/) guide.
* We recommend sending the photo horizontally. JPEG, JPG and PNG are the only supported formats and the max allowed size is 30MB. For more information on how to take a good picture of the document, please visit the [**Document Picture Tips**](/guides/tip_for_document_photo/) guide.
* For information about how to integrate this validator in WhatsApp, please visit [**How to Use WhatsApp to Validate Identity**](/guides/how_use_whatsapp_kyc#Document_Id) guide.