> ## Documentation Index
> Fetch the complete documentation index at: https://docs.checkin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Analysis

> Extract and verify data from supporting documents such as payslips, tax returns and employment contracts.

Document Analysis handles supporting documents, such as a payslip, tax return or employment contract. The applicant chooses a document type and uploads the document. Its data is extracted automatically and matched against the applicant's details. You configure which document types are accepted and which fields are required.

| | |
| - | - |
| API identifier | `document-analysis` |
| Result key | `servicesResults.documentAnalysis` |
| Available in | Web SDK, API |
| Review | Fully automatic. Extracted data and match results appear in the application details in the Backoffice. |

## Use cases

| Use case | Typical documents | Typical fields |
| - | - | - |
| **Affordability / income** (iGaming) | Payslip, tax return, bank statement | Name, date of issue, tax year |
| **Source of funds / wealth** | Bank statement, crypto export, tax return | Name, bank name, statement period, transactions |
| **Employment verification** | Employment contract, payslip | Name, date of issue |
| **Bank account ownership** | Bank statement | Name, account number, IBAN |

## What you can configure

* **Accepted documents.** Turn document types on or off, for example payslips and tax returns for affordability, or bank statements and crypto exports for source of funds.
* **How recent a document must be.** Set a validity period per document type.
* **Required data.** Make optional fields required.
* **Verification rules.** For each matching rule, choose whether a mismatch sets the application to `needs-review` or `declined`.

Turn on **Document Analysis** in **Flows → \[flow name] → Services**. All of the settings above are set in the Backoffice, under **Settings → Verification rules → Document Analysis**, or in the flow's own verification rules.

See [Verification rules](https://docs.checkin.com/backoffice/verification-rules.md).

### Acceptable documents

Choose which document types the applicant can pick from. Each type can be enabled or disabled independently.

### Validity period

Set how recent a document must be, in months, per document type. Default: 6 months. A document issued earlier than that fails the **Date of issue** rule.

## User flow in the Web SDK

1. The applicant selects a document type from the list.
2. The applicant uploads files or takes photos of the pages. For payslips, up to 3 documents.
3. Document Analysis extracts the data and matches it against the applicant's details.
4. Extracted data and match results appear in the application details in the Backoffice.

![Web SDK screens: welcome, personal details, supported documents, review of an employment contract, sending, success](https://mintcdn.com/checkin-com/25GVaDB7DHI1hjGE/images/flow-document-analysis.png?fit=max\&auto=format\&n=25GVaDB7DHI1hjGE\&q=85\&s=1253a00ccf6d1f805f13e6293276bce3)

Document Analysis in the Web SDK

## Matching rules

Each rule can be enabled or disabled. For each one you choose what happens when it fails: `declined` or `needs-review`.

| Rule | What is checked | Default |
| - | - | - |
| **Document type** | The uploaded document is one of the accepted types | Declined |
| **Date of issue** | The document was issued within the validity period | Declined |
| **First name** | Matches the applicant's first name | Declined |
| **Last name** | Matches the applicant's last name | Declined |
| **Date of birth** | Matches the applicant's date of birth | Disabled |
| **Account number** | Matches the applicant's account number | Disabled |
| **Other** | Other extracted fields | Disabled |

## Request

Send the applicant's details in `application.fields` and the document in `application.documentAnalysis.file`.

### Example

```json theme={null}
{
  "verificationTypes": ["document-analysis"],
  "metadata": {
    "externalId": "api123456789"
  },
  "application": {
    "fields": [
      { "category": "First name", "content": "BETINEZ", "contentType": "string" },
      { "category": "Last name", "content": "JONATAN", "contentType": "string" },
      { "category": "Account number", "content": "12345", "contentType": "string" }
    ],
    "documentAnalysis": {
      "file": {
        "uri": "data:application/pdf;base64,..."
      }
    }
  }
}
```

Send the file as a data URI, the same way as for [Proof of Address](https://docs.checkin.com/products/proof-of-address.md) and [Bank Statement](https://docs.checkin.com/products/bank-statement.md). You don't pass the document type: it is detected from the document and returned in `documentType`.

## Result

| Field | Content |
| - | - |
| `status`, `processingState`, `comment`, `verifier`, `serviceType` | Service outcome |
| `documentType` | Document type detected from the uploaded file, for example `bank-statement` |
| `fieldsCheck` | Check list, one check per matching rule that ran. See [Concerns](#concerns). |
| `crossChecking[]` | Per field: `category`, the value read from the document (`ocr`), the value you sent (`form`), `valid`, `status`, `message`. Fields read from the document without a value to compare, such as bank name or statement period, have an empty `form`. |
| `transactions[]` | Transactions read from a bank statement: `date`, `description`, `amount`, `balance` |
| `files.original` | Link to the uploaded file |

### Example

A bank statement checked against the applicant's first and last name. Matching ignores letter case.

```json theme={null}
{
  "documentAnalysis": {
    "serviceType": "document-analysis",
    "processingState": "done",
    "status": "approved",
    "comment": "No issues found.",
    "documentType": "bank-statement",
    "fieldsCheck": {
      "group": "fieldsCheck",
      "description": "Document Analysis",
      "considers": [
        { "id": "DOA001", "name": "docType", "type": "clear", "status": "approved", "description": "Document type bank statement is acceptable" },
        { "id": "DOA002", "name": "firstName", "type": "clear", "status": "approved", "description": "Provided first name matches the document" },
        { "id": "DOA003", "name": "lastName", "type": "clear", "status": "approved", "description": "Provided last name matches the document" },
        { "id": "DOA004", "name": "dateOfIssue", "type": "clear", "status": "approved", "description": "Document issued within the last 6 months" }
      ]
    },
    "crossChecking": [
      { "id": "DOA-firstName", "category": "First name", "ocr": "Anna", "form": "anna", "valid": true, "status": "approved", "message": "" },
      { "id": "DOA-lastName", "category": "Last name", "ocr": "Ozola", "form": "ozola", "valid": true, "status": "approved", "message": "" },
      { "id": "DOA-dateOfIssue", "category": "Date of issue", "ocr": "2026-07-09", "form": "", "valid": true, "status": "approved", "message": "" },
      { "id": "DOA-bankName", "category": "Bank name", "ocr": "Example Bank", "form": "", "valid": true, "status": "approved", "message": "" },
      { "id": "DOA-periodStartDate", "category": "Period start date", "ocr": "2025-07-10", "form": "", "valid": true, "status": "approved", "message": "" },
      { "id": "DOA-periodEndDate", "category": "Period end date", "ocr": "2026-07-09", "form": "", "valid": true, "status": "approved", "message": "" }
    ],
    "transactions": [
      { "date": "2026-05-31", "description": "Card payment", "amount": "-$2.00", "balance": "$0.49" },
      { "date": "2026-05-30", "description": "Incoming transfer", "amount": "$8.95", "balance": "$2.49" }
    ],
    "files": { "original": "https://..." }
  }
}
```

## Concerns

Values in `{braces}` are filled in at runtime.

| Code | Message |
| - | - |
| `DOA001` | Document type is not acceptable |
| `DOA002` | Provided first name does not match the document |
| `DOA003` | Provided last name does not match the document |
| `DOA004` | Document issued more than `{period}` ago |
| `DOA016` | Required fields missing from the document: `{fields}` |

All codes are in [Considers lists](https://docs.checkin.com/integrate/results/considers-lists.md).

## Related

* [Proof of Address](https://docs.checkin.com/products/proof-of-address.md)
* [Bank Statement](https://docs.checkin.com/products/bank-statement.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.