---
description: Below you will see the fields designated for the Costa Rica
---

# Costa Rica

### Document validations

<table><thead><tr><th width="170">Document Type</th><th width="168">Description</th><th width="314">ID for individuals and/or legal entities</th><th width="148">Length</th><th width="126">Data Type</th><th width="159">Verification digit</th><th width="209">Mandatory for methods</th><th>Regex</th><th width="100">Document ID Example</th></tr></thead><tbody><tr><td>RUT</td><td>Registro Único Tributario</td><td>Legal Entities</td><td>10</td><td>Numeric</td><td>-</td><td><ul><li>Credit Card</li><li>Debit Card</li></ul></td><td>^[0-9]{10}$</td><td>1533470188</td></tr><tr><td>CI</td><td>Cedula de Identidad</td><td>Individual Entity</td><td>9-11</td><td>String</td><td></td><td><ul><li>Credit Card</li><li>Debit Card</li></ul></td><td>^[1-7]-?\d{3}-?\d{5}$</td><td><ul><li>114712748</li><li>1-234-56789</li></ul></td></tr><tr><td>DIMEX</td><td>Dirección General de Migración y Extranjería</td><td>Individual Entity</td><td>11-12</td><td>Numeric</td><td></td><td><ul><li>Credit Card</li><li>Debit Card</li></ul></td><td>^\d{11,12}$</td><td>123456789012</td></tr><tr><td>CEJ</td><td>Cedula Jurídica</td><td>Legal Entities</td><td>6-12</td><td>String</td><td></td><td><p></p><ul><li>Credit Card</li></ul><ul><li>Debit Card</li><li>3101362119</li></ul></td><td>^[1-9]-?\d{3}-?\d{6}$</td><td><ul><li>CR-1234  </li><li>3101362119</li></ul></td></tr></tbody></table>

{% hint style="info" %}
Structure of the identity card (CI):

* The first digit indicates the province of birth or registration (1–7).
* The second block  of 3 digits, is a sequential number.
* The third block  of 5 digits, contains another sequential number that was assigned to each individual.
* You can optionally add a hyphen "-" to divide the blocks.
{% endhint %}

{% hint style="info" %}
Structure of the Cedula Jurídica (CEJ):

* Depending on the issuing authority, the identifier often follows an alphanumeric pattern (combining letters and digits) or a full numeric structure, often split with hyphens "-" to divide code blocks.
{% endhint %}

### Example: How to validate IDs through the API?

{% hint style="info" %}
**`Remember that you can validate documents through the LP api`. See** [**Document Validation service**](https://docs.v3.localpayment.com/before-payment/document-validation)**.**
{% endhint %}

Below you can find some examples to validate through our API. You can also test with the examples above. Please note the structure of each **`ID type`** (length, dots, hyphen, lowercase/uppercase). To validate Chilean documents through the API, you can add or omit the dots, hyphens, and lowercase/uppercase.



{% tabs %}
{% tab title="Example: RUT" %}
```json

{
    "document": {
        "id" :"1111111111", 
        "type" :"RUT"
    },
    "country" : "CRI"
}
```
{% endtab %}

{% tab title="Valid ID Response" %}
```json
{
    "code": "200",
    "description": "Valid id and type document"
}
```
{% endtab %}
{% endtabs %}

**Validate IDs through the LP api:**

{% embed url="https://docs.v3.localpayment.com/before-payment/validations/document-validation" %}

#### Check the Country `ISOCode 3:`

{% embed url="https://docs.v3.localpayment.com/api-reference-guide/country_codes" %}
