# Configuration Components

Human URL: https://dochorizon.klippa.com/docs/capturing/identity/components
Source: https://dochorizon.klippa.com/docs/llms/capturing/identity/components.md

> Look at the available Identity configuration components

---

On the identity service page you can create configurations for API requests to the identity model. In a configuration, you can enable components to receive their data while keeping others disabled. This page lists the available components and the fields they provide.

- Candidates

- OCR Data

- Masking

- Modifiers

- Validators

- Barcodes

- Custom Fields

### Masking

The masking component allows you to mask specific fields on an identity document. Masking ensures that sensitive data is not exposed to unauthorized parties. You can define how and where the masking should occur for each selected field.

##### Masking Options

For each field, the following options are available:

- **Start Index**: Defines where the masking should begin. If not provided, masking will start at the beginning of the field.
- **End Index**: Defines where the masking should stop. If not provided, masking will end at the last character of the field.
- **Replacement**: Specifies the value that will replace the original content in the API response. For example, using "X" as a replacement for the document_number field will return "X" instead of the original value.
- **Color**: Sets the color of the mask. You can use hex codes (e.g., "#FF0000") or English color names (e.g., "red").

### Modifiers

Modifiers allow you to adjust the data returned by the API to match your desired format. These modifications are applied before the data is returned, based on the configuration you specify.

> **INFO:** Modifiers are specific to the Identity Model. They rely on MRZ and VIZ processing, which is unique to identity documents such as passports, ID cards, and driver's licenses. Other capturing models, such as Financial, Bank Statement, and Salary Slip, do not have a Modifiers component.

##### Reject Wrong MRZ Checksums

This modifier ensures that fields with incorrect MRZ (Machine-Readable Zone) checksums are rejected. An MRZ contains a checksum calculated from its data and separate check digits for specific fields. By enabling this option, you can reject fields if their checksum is invalid or if no checksum is available.

The following fields have separate check digits and are applicable for this modifier:

- **Date of Birth**
- **Date of Expiry**
- **Document Number**
- **Personal Number**
- **MRZ**

##### Select Source

This modifier allows you to choose the source of information for specific fields. These fields can exist in both the MRZ (Machine-Readable Zone) and the VIZ (Visual Inspection Zone). By default, the source is the MRZ, except for the given names and surname, which default to the VIZ.

You can override the default source and select the VIZ as the source. This is helpful for documents containing non-ASCII characters. The MRZ uses ASCII characters but includes alternative representations for non-ASCII characters to ensure compatibility.

Additionally, you can configure whether to allow or disallow the use of an alternative source if the selected source does not provide any results.

The following fields support source selection:

- **Document Subtype**
- **Date Of Birth**
- **Date Of Expiry**
- **Gender**
- **Nationality**
- **Issuing Country**
- **Document Number**
- **Given Names**
- **Personal Number**
- **Surname**

### Validators

The Validator component provides validation options. Unlike the Modifiers component, validators do not alter the captured data. Instead, they return flags or results in the JSON output, indicating the validation outcomes.

##### Field Value Validation

This feature allows you to validate the values of specific fields. You can configure validations based on your requirements. For example, the date_of_birth field can be validated by setting minimum and maximum values, enabling age-based validation for identity documents.

The following validation options may be available for a field:

- **Empty Field Validation**: Check whether a field is allowed to be empty.
- **Expiration Validation**: Verify if a field, such as `date_of_expiry`, is expired.
- **Predefined Value Matching**: Ensure the field value matches predefined values or a regex pattern.

The following fields support field value validations:

- Date Of Birth, Date Of Expiry, Date Of Issue, Application Number, Country Of Birth, Document Number, Document Subtype, Document Type, Drive License Categories, Gender, Given Names, Height, Issuing Country, Issuing Institution, Maiden Name, Nationality, Partner Name, Personal Number, Place Of Birth, Residency, Sponsorship Number, Surname, Visa Number, Weight, Address

##### Validate MRZ Checksum

This validation checks whether specific fields have a valid MRZ checksum. Fields with invalid or missing checksums can be flagged or rejected. This functionality is similar to the checksum validation in the Modifiers component but focuses solely on validation without modifying the data.

The following fields support MRZ checksum validation:

- Date of Birth
- Date of Expiry
- Document Number
- Personal Number
- MRZ

##### Verify Two Sides Given

This option verifies whether both sides of a two-sided document are included in the input. The identity model automatically detects whether the document is expected to have two sides, such as ID cards or driver’s licenses. If only one side is provided, this validation will flag the issue.

##### Is Specimen

This option verifies whether the submitted document is a specimen. If the submitted document matches the specimen database, this validation will flag it as an issue.

### Barcodes

The Barcodes component allows you to extract barcode data found on identity documents. When enabled, it scans the document and returns information about any barcodes detected, including their type and decoded value.

##### Configuration

The Barcodes component has a single configuration option:

- **Enabled**: A boolean flag that enables or disables barcode extraction. When enabled, the component scans the identity document for barcodes.

##### Output Fields

When the Barcodes component is enabled, it adds a `barcode` field (array) to the identity document result. Each entry in the array is a `BarcodeData` object containing:

- **Type**: The format or encoding type of the barcode (e.g., CODE128, QR_CODE, DATA_MATRIX, etc.).
- **Value**: The decoded value extracted from the barcode.

##### With Candidates Component

When both the Barcodes and Candidates components are enabled, a `BarcodeCandidate` object is also available for each barcode, containing:

- **Value**: A `BarcodeData` object with the barcode's type and decoded value.
- **Source**: The source location where the barcode was found on the document.
- **Confidence**: A confidence score (0–1) indicating the reliability of the barcode detection and decoding.
- **Coordinates**: An array of coordinate objects specifying the location of the barcode on the document.

> **INFO:** The Barcodes component is unmaskable, meaning barcode values cannot be masked in the API response.

### Custom Fields

Enabling the Custom Fields component lets you add fields to your identity configuration beyond the standard Identity model fields. Three types are available: **Static**, **Prompt**, and **Regex**. Static fields act as empty fields for Human in the Loop reviews. Prompt and Regex fields use AI prompts or regex patterns to extract additional data from documents.

For more information, refer to the [Custom Fields documentation](https://dochorizon.klippa.com/docs/llms/capturing/shared-components/custom-fields.md).