> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/supported-id-types/for-individuals-kyc/backed-by-id-authority/id-number-regex.md).

# ID Number Regex

The most common reason for failure of an ID lookup is because the end user did not input their ID number correctly. One of the best ways to mitigate this is to validate ID numbers on the client-side, before sending them to Smile ID. Below we will provide validation regexes for most of our ID types. It is important to note that they change over time, and we will do our best to keep this page updated.

## Know Your Customer (KYC)

| Country       | Country Code | id\_type                | Regex                                                                                                                                   |
| ------------- | ------------ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|               |              | 🇨🇮                    |                                                                                                                                         |
| Côte d'Ivoire | CI           | NATIONAL\_ID\_NO\_PHOTO | <ul><li><code>/^\[0-9]{11}$/</code></li><li><code>/^\[A-Za-z]\d{10}$/</code></li></ul>                                                  |
| Côte d'Ivoire | CI           | RESIDENT\_ID\_NO\_PHOTO | <ul><li><code>/^\[0-9]{11}$/</code></li><li><code>/^\[A-Za-z]\d{10}$/</code></li></ul>                                                  |
|               |              | :flag\_gh:              |                                                                                                                                         |
| Ghana         | GH           | GHANA\_CARD             | `/^[A-Z]{3}-?\d{9}-?\d$/i`                                                                                                              |
| Ghana         | GH           | GHANA\_CARD\_NO\_PHOTO  | `/^[A-Z]{3}-?\d{9}-?\d$/i`                                                                                                              |
|               |              | :flag\_ke:              |                                                                                                                                         |
| Kenya         | KE           | ALIEN\_CARD             | `/^[0-9]{6,9}$/`                                                                                                                        |
| Kenya         | KE           | KRA\_PIN                | `/^[0-9]{1,9}$/`                                                                                                                        |
| Kenya         | KE           | NATIONAL\_ID            | `/^[0-9]{1,9}$/`                                                                                                                        |
| Kenya         | KE           | NATIONAL\_ID\_NO\_PHOTO | `/^[0-9]{1,9}$/`                                                                                                                        |
| Kenya         | KE           | PASSPORT                | `/^[A-Z0-9]{7,9}$/`                                                                                                                     |
| Kenya         | KE           | TAX\_INFORMATION        | `/^[Aa]\d{9}[a-zA-Z]$/`                                                                                                                 |
|               |              | :flag\_ng:              |                                                                                                                                         |
| Nigeria       | NG           | BVN                     | `/^[0-9]{11}$/`                                                                                                                         |
| Nigeria       | NG           | NIN\_V2                 | `/^[0-9]{11}$/`                                                                                                                         |
| Nigeria       | NG           | NIN\_SLIP               | `/^[0-9]{11}$/`                                                                                                                         |
| Nigeria       | NG           | PHONE\_NUMBER           | `/^[0-9]{11}$/`                                                                                                                         |
| Nigeria       | NG           | VOTER\_ID               | `/^[a-zA-Z0-9 ]{9,29}$/i`                                                                                                               |
|               |              | :flag\_za:              |                                                                                                                                         |
| South Africa  | ZA           | NATIONAL\_ID            | `/^[0-9]{13}$/`                                                                                                                         |
| South Africa  | ZA           | NATIONAL\_ID\_NO\_PHOTO | `/^[0-9]{13}$/`                                                                                                                         |
| South Africa  | ZA           | PHONE\_NUMBER           | `/^[0-9]{10}$/`                                                                                                                         |
|               |              | :flag\_ug:              |                                                                                                                                         |
| Uganda        | UG           | NATIONAL\_ID\_NO\_PHOTO | `/^[A-Z0-9]{14}$/i`                                                                                                                     |
|               |              | :flag\_zm:              |                                                                                                                                         |
| Zambia        | ZM           | BANK\_ACCOUNT           | [Varies per bank](/supported-id-types/for-individuals-kyc/backed-by-id-authority/supported-countries/zambia/bank-account.md#bank-codes) |
|               | ZM           | TPIN                    | `/^[0-9]{10}$/`                                                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/supported-id-types/for-individuals-kyc/backed-by-id-authority/id-number-regex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
