ID Number Regex

Validate the ID number format to prevent failed ID lookups due to invalid format

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)

CountryCountry Codeid_typeRegex

Ghana

GH

PASSPORT

/^[A-Z]{1,2}[0-9]{6,7}$/i

Ghana

GH

SSNIT

/^[a-zA-Z]{1}[a-zA-Z0-9]{12,14}$/i

Ghana

GH

VOTER_ID

/^[0-9]{10,12}$/

Ghana

GH

NEW_VOTER___ID

/^[0-9]{10,12}$/

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]$/

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

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}$/

Uganda

UG

NATIONAL_ID_NO_PHOTO

/^[A-Z0-9]{14}$/i

Zambia

ZM

BANK_ACCOUNT

ZM

TPIN

/^[0-9]{10}$/

*: Tokenized version of the NIN

Last updated