With just the number of a government issued ID, we can fetch all the information from the official government databases.

National ID

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

{
    "template_id" : "{{YOUR_TEMPLATE_ID}}",
    "user_data": {
        "last_name": "{{User_Last_Name}}",
        "identity": {
            "identity_country_code": "KE",
            "identity_number_type": "NATIONAL_ID",
            "identity_number": "{{Valid_National_ID_Number}}"
        }
    }
}

Driver License

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

{
    "template_id" : "{{YOUR_TEMPLATE_ID}}",
    "user_data": {
        "last_name": "{{User_Last_Name}}",
        "identity": {
            "identity_country_code": "KE",
            "identity_number_type": "DRIVER_LICENSE",
            "identity_number": "{{Valid_Driver_License_Number}}"
        },
    }
}

Passport

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

{
    "template_id" : "{{YOUR_TEMPLATE_ID}}",
    "user_data": {
        "last_name": "{{User_Last_Name}}",
        "identity": {
            "identity_country_code": "KE",
            "identity_number_type": "PASSPORT",
            "identity_number": "{{Valid_Passport_Number}}"
        },
    }
}

KRA Pin

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

{
    "template_id" : "{{YOUR_TEMPLATE_ID}}",
    "user_data": {
        "identity": {
            "identity_country_code": "KE",
            "identity_number_type": "KENYA_KRA_PIN",
            "identity_number": "{{Valid_KRA_PIN_Number}}"
        },
    }
}

Alien Card

Regex: /^[0-9]{6,9}$/

{
    "template_id" : "{{YOUR_TEMPLATE_ID}}",
    "user_data": {
        "identity": {
            "identity_country_code": "KE",
            "identity_number_type": "ALIEN_CARD",
            "identity_number": "{{Valid_Alien_Card_Number}}"
        },
    }
}