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 Identity. 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

🇬🇭

Ghana

GH

DRIVERS_LICENSE

/^[a-zA-Z0-9]{6,10}$/

Ghana

GH

PASSPORT

/^(?i)G[a-zA-Z0-9]{7,9}$/

Ghana

GH

SSNIT

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

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

NATIONAL_ID

/^[0-9]{1,9}$/

Kenya

KE

PASSPORT

/^[A-Z0-9]{7,9}$/

🇳🇬

Nigeria

NG

BVN

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

Nigeria

NG

NIN

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

***Nigeria

NG

NIN_SLIP

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

Nigeria

NG

DRIVERS_LICENSE

/^[a-zA-Z]{3}([ -]{1})?[A-Z0-9]{6,12}$/

Nigeria

NG

VOTER_ID

/^[a-zA-Z0-9 ]{9,19}$/

🇿🇦

South Africa

ZA

NATIONAL_ID

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

South Africa

ZA

NATIONAL_ID_NO_PHOTO

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

Know Your Business (KYB)

Country

Country Code

id_type

Regex

🇳🇬

Nigeria

NG

TIN

/^[0-9]{8,}-[0-9]{4,}$/

Nigeria

NG

CAC

/^(RC)?[0-9]{5,8}$/