Flow Hybrid Input Validation

Flow does as much as possible to ensure the user data it helps you collect and verify is clean and standardized. If you're using the fully managed Flow embed product then you don't need to worry about the validations described below. If you're using Flow Hybrid and submiting data via API, you will need to match the formatting and standardization requirements described below.

To help with development, we also provide a JSON file containing the same validation rules:

Download JSON

ID Numbers

Flow's Lightning Verification will automatically collect, validate, and verify any of the following ID numbers for countries that you've enabled in the Flow Editor.

If you are separately collecting ID numbers outside of Flow, or if you have existing customer data you're looking to import into Flow, you can submit this data to Flow's API programatically.

The table below lists each ID number that Flow supports. The API type is a unique identifier that you should provide via API via the id_number.type field.

ID Numbers submitted via API should be stripped of any formatting characters like spaces, periods, and dashes. The table below also includes the exact regular expressions we use to decide whether a given ID Number is well formed and valid for that region's ID type.

Need this data for your code? Download these validation rules in JSON form

CountryCountry CodeID NameAPI TypeFormat
ArgentinaARDocumento Nacional de Identidad (DNI)ar_dni\A\d{8,10}\z
AustraliaAUDriver’s Licenseau_drivers_license\A[A-Z0-9]{6,11}\z
AustraliaAUPassport Numberau_passport\A[A-Z0-9]{7,8}\z
BrazilBRCadastro de Pessoas Físicas (CPF)br_cpf\A\d{11}\z
CanadaCASocial Insurance Number (SIN)ca_sin\A\d{9}\z
ChileCLRol Único Nacional (RUN)cl_run\A\d{8}[A-Z\d]\z
ChinaCNResident Identity Card Numbercn_resident_card\A\d{15,18}\z
ColombiaCONúmero de Identificación Tributaria (NIT)co_nit\A\d{8,10}\z
DenmarkDKCivil Personal Registration (CPR)dk_cpr\A\d{9,11}\z
EgyptEGNational ID Card Numbereg_national_id\A\d{14}\z
Hong KongHKHong Kong Identity (HKID)hk_hkid\A[A-Z0-9]{8,9}\z
IndiaINPermanent Account Number (PAN)in_pan\A[A-Z]{5}\d{4}[A-Z]\z
ItalyITCodice Fiscale (CF)it_cf\A[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]\z
JapanJP"My Number" Resident Record Codejp_my_number\A\d{12}\z
JordanJOCivil Identification Numberjo_civil_id\A\d{10,14}\z
KenyaKEHuduma Nambake_huduma_namba\A\d{10}\z
KuwaitKWCivil ID Card Numberkw_civil_id\A\d{12}\z
MalaysiaMYNational Registration Identity Card Number (NRIC)my_nric\A\d{12}\z
MexicoMXClave Única de Registro de Población (CURP)mx_curp\A[A-Z]{4}\d{6}[A-Z]{6}[A-Z\d]\d\z
MexicoMXRegistro Federal de Contribuyentes (RFC)mx_rfc\A[A-Z]{4}\d{6}[A-Z\d]{3}\z
New ZealandNZDriver’s Licensenz_drivers_license\A[A-Z]{2}\d{6}\z
NigeriaNGNational ID Numberng_nin\A[A-Z0-9]{11}\z
OmanOMIdentity Card Numberom_civil_id\A\d{8,9}\z
PhilippinesPHPhilSys Numberph_psn\A\d{12}\z
PolandPLPESEL Numberpl_pesel\A\d{11}\z
RomaniaROCod Numeric Personal (CNP)ro_cnp\A\d{13}\z
Saudi ArabiaSABiṭāgat Al-ʼaḥwālsa_national_id\A[A-Z0-9]{10}\z
SingaporeSGNational Registration Identity Cardsg_nric\A[A-Z]\d{7}[A-Z]\z
South AfricaZASmart ID Card Numberza_smart_id\A\d{13}\z
SpainESDocumento Nacional de Identidad (DNI)es_dni\A\d{8}[A-Z]\z
SpainESNúmero de Identidad de Extranjero (NIE)es_nie\A[A-Z]\d{7}[A-Z]\z
SwedenSEPersonnummer (PIN)se_pin\A\d{9,12}\z
TurkeyTRT.C. Kimlik No.tr_tc_kimlik\A\d{11}\z
United StatesUSSocial Security Number (SSN)us_ssn\A\d{9}\z
United StatesUSSocial Security Number (SSN) Last 4us_ssn_last_4\A\d{4}\z

Input Validation by Country

Address standards vary by country. Some countries do not support postal code or subdivision (the equivalent of "state" or "province" depending on the region). In other countries, postal code and/or subdivision is valid in a sense, but superfluous and not typically collected in native forms.

Separately, variations in identity data coverage mean that collection of "ID Number" is a required part of Lightning Verification in some countries, optional (configured in the Flow Editor) for other countries, and not supported in countries that do not support Lightning at all.

This regional variation is reflected in the table below.

The labels for each input field below correspond to the following input validations:

  • address.postal_code and address.subdivision

    • Required - If address is provided as part of the request, this field must always be present

    • Not Accepted - If address is provided as part of the request, this field must be omitted. Specifically, the key should be omitted from the address object (as opposed to the key being present with a null value)

  • id_number

    • Required - If id_number is not provided for this country, kyc_check will treat the Flow Session as having incomplete data and will require user interaction with the Flow modal in order to collect id_number

    • Optional - If id_number is not provided for this country and your Flow Template is configured to not collect ID numbers for this country then Flow will automatically run the kyc_check step without any user interaction as long as all other required input fields are provided. Similar to the address fields, the API requires you omit the id_number key entirely if you are not providing ID number data

    • Not Accepted - ID number verification is not supported for this country and the id_number field should always be omitted from API requests

Need this data for your code? Download these validation rules in JSON form

CountryCountry Codeaddress.postal_codeaddress.subdivisionid_number
AfghanistanAFRequiredNot AcceptedNot Accepted
AlbaniaALRequiredNot AcceptedNot Accepted
AlgeriaDZRequiredNot AcceptedNot Accepted
AndorraADRequiredNot AcceptedNot Accepted
AngolaAONot AcceptedNot AcceptedNot Accepted
AnguillaAINot AcceptedNot AcceptedNot Accepted
Antigua & BarbudaAGNot AcceptedNot AcceptedNot Accepted
ArgentinaARRequiredRequiredRequired
ArmeniaAMRequiredNot AcceptedNot Accepted
ArubaAWNot AcceptedNot AcceptedNot Accepted
AustraliaAURequiredRequiredRequired
AustriaATRequiredNot AcceptedRequired
AzerbaijanAZRequiredNot AcceptedNot Accepted
BahamasBSNot AcceptedNot AcceptedNot Accepted
BahrainBHRequiredNot AcceptedNot Accepted
BangladeshBDRequiredNot AcceptedNot Accepted
BarbadosBBRequiredNot AcceptedNot Accepted
BelarusBYRequiredNot AcceptedNot Accepted
BelgiumBERequiredNot AcceptedRequired
BelizeBZNot AcceptedNot AcceptedNot Accepted
BeninBJNot AcceptedNot AcceptedNot Accepted
BermudaBMRequiredNot AcceptedNot Accepted
BhutanBTRequiredNot AcceptedNot Accepted
BoliviaBONot AcceptedNot AcceptedNot Accepted
Bosnia & HerzegovinaBARequiredNot AcceptedNot Accepted
BotswanaBWRequiredNot AcceptedNot Accepted
BrazilBRRequiredRequiredRequired
British Virgin IslandsVGRequiredNot AcceptedNot Accepted
BruneiBNRequiredNot AcceptedNot Accepted
BulgariaBGRequiredNot AcceptedNot Accepted
Burkina FasoBFNot AcceptedNot AcceptedNot Accepted
BurundiBIRequiredNot AcceptedNot Accepted
CambodiaKHRequiredNot AcceptedNot Accepted
CameroonCMRequiredNot AcceptedNot Accepted
CanadaCARequiredRequiredOptional
Cape VerdeCVRequiredNot AcceptedNot Accepted
Caribbean NetherlandsBQRequiredNot AcceptedNot Accepted
Cayman IslandsKYRequiredNot AcceptedNot Accepted
Central African RepublicCFRequiredNot AcceptedNot Accepted
ChadTDNot AcceptedNot AcceptedNot Accepted
ChileCLRequiredRequiredRequired
ChinaCNRequiredRequiredRequired
ColombiaCORequiredRequiredRequired
ComorosKMRequiredNot AcceptedNot Accepted
Congo - BrazzavilleCGRequiredNot AcceptedNot Accepted
Cook IslandsCKRequiredNot AcceptedNot Accepted
Costa RicaCRRequiredNot AcceptedNot Accepted
CroatiaHRRequiredNot AcceptedNot Accepted
CuraçaoCWNot AcceptedNot AcceptedNot Accepted
CyprusCYRequiredNot AcceptedNot Accepted
Czech RepublicCZRequiredNot AcceptedRequired
Côte d’IvoireCIRequiredNot AcceptedNot Accepted
DenmarkDKRequiredNot AcceptedRequired
DjiboutiDJNot AcceptedNot AcceptedNot Accepted
DominicaDMRequiredNot AcceptedNot Accepted
Dominican RepublicDORequiredNot AcceptedNot Accepted
EcuadorECRequiredNot AcceptedNot Accepted
EgyptEGRequiredRequiredNot Accepted
El SalvadorSVRequiredNot AcceptedNot Accepted
EritreaERRequiredNot AcceptedNot Accepted
EstoniaEERequiredNot AcceptedNot Accepted
EswatiniSZRequiredNot AcceptedNot Accepted
EthiopiaETRequiredNot AcceptedNot Accepted
Faroe IslandsFORequiredNot AcceptedNot Accepted
FijiFJNot AcceptedNot AcceptedNot Accepted
FinlandFIRequiredNot AcceptedRequired
FranceFRRequiredNot AcceptedRequired
French PolynesiaPFRequiredNot AcceptedNot Accepted
GabonGARequiredNot AcceptedNot Accepted
GambiaGMRequiredNot AcceptedNot Accepted
GeorgiaGERequiredNot AcceptedNot Accepted
GermanyDERequiredNot AcceptedRequired
GhanaGHNot AcceptedNot AcceptedNot Accepted
GibraltarGIRequiredNot AcceptedRequired
GreeceGRRequiredNot AcceptedNot Accepted
GreenlandGLRequiredNot AcceptedNot Accepted
GrenadaGDRequiredNot AcceptedNot Accepted
GuatemalaGTRequiredRequiredNot Accepted
GuernseyGGRequiredNot AcceptedNot Accepted
GuineaGNRequiredNot AcceptedNot Accepted
Guinea-BissauGWRequiredNot AcceptedNot Accepted
GuyanaGYRequiredNot AcceptedNot Accepted
HaitiHTRequiredNot AcceptedNot Accepted
HondurasHNRequiredNot AcceptedNot Accepted
Hong KongHKNot AcceptedRequiredRequired
HungaryHURequiredNot AcceptedNot Accepted
IcelandISRequiredNot AcceptedNot Accepted
IndiaINRequiredRequiredRequired
IndonesiaIDRequiredRequiredNot Accepted
IraqIQRequiredNot AcceptedNot Accepted
IrelandIERequiredRequiredRequired
Isle of ManIMRequiredNot AcceptedNot Accepted
IsraelILRequiredNot AcceptedNot Accepted
ItalyITRequiredRequiredOptional
JamaicaJMNot AcceptedNot AcceptedNot Accepted
JapanJPRequiredRequiredOptional
JerseyJERequiredNot AcceptedNot Accepted
JordanJORequiredNot AcceptedNot Accepted
KazakhstanKZRequiredNot AcceptedNot Accepted
KenyaKERequiredNot AcceptedRequired
KiribatiKIRequiredNot AcceptedNot Accepted
KosovoXKRequiredNot AcceptedNot Accepted
KuwaitKWRequiredNot AcceptedNot Accepted
KyrgyzstanKGRequiredNot AcceptedNot Accepted
LaosLARequiredNot AcceptedNot Accepted
LatviaLVRequiredNot AcceptedNot Accepted
LebanonLBRequiredNot AcceptedNot Accepted
LesothoLSRequiredNot AcceptedNot Accepted
LiberiaLRRequiredNot AcceptedNot Accepted
LiechtensteinLIRequiredNot AcceptedNot Accepted
LithuaniaLTRequiredNot AcceptedNot Accepted
LuxembourgLURequiredNot AcceptedRequired
Macao SAR ChinaMORequiredNot AcceptedNot Accepted
MadagascarMGRequiredNot AcceptedNot Accepted
MalawiMWNot AcceptedNot AcceptedNot Accepted
MalaysiaMYRequiredRequiredRequired
MaldivesMVRequiredNot AcceptedNot Accepted
MaliMLNot AcceptedNot AcceptedNot Accepted
MaltaMTRequiredNot AcceptedNot Accepted
MauritaniaMRRequiredNot AcceptedNot Accepted
MauritiusMURequiredNot AcceptedNot Accepted
MexicoMXRequiredRequiredRequired
MoldovaMDRequiredNot AcceptedNot Accepted
MonacoMCRequiredNot AcceptedNot Accepted
MongoliaMNRequiredNot AcceptedNot Accepted
MontenegroMERequiredNot AcceptedNot Accepted
MontserratMSRequiredNot AcceptedNot Accepted
MoroccoMARequiredNot AcceptedNot Accepted
MozambiqueMZRequiredNot AcceptedNot Accepted
Myanmar (Burma)MMRequiredNot AcceptedNot Accepted
NamibiaNARequiredNot AcceptedNot Accepted
NauruNRRequiredNot AcceptedNot Accepted
NepalNPRequiredNot AcceptedNot Accepted
NetherlandsNLRequiredNot AcceptedRequired
New ZealandNZRequiredRequiredOptional
NicaraguaNIRequiredNot AcceptedNot Accepted
NigerNERequiredNot AcceptedNot Accepted
NigeriaNGRequiredRequiredRequired
NiueNURequiredNot AcceptedNot Accepted
North MacedoniaMKRequiredNot AcceptedNot Accepted
NorwayNORequiredNot AcceptedRequired
OmanOMRequiredNot AcceptedNot Accepted
PakistanPKRequiredNot AcceptedNot Accepted
Palestinian TerritoriesPSRequiredNot AcceptedNot Accepted
PanamaPANot AcceptedRequiredNot Accepted
Papua New GuineaPGRequiredNot AcceptedNot Accepted
ParaguayPYRequiredNot AcceptedNot Accepted
PeruPERequiredRequiredNot Accepted
PhilippinesPHRequiredRequiredOptional
PolandPLRequiredNot AcceptedOptional
PortugalPTRequiredRequiredRequired
QatarQANot AcceptedNot AcceptedNot Accepted
RomaniaRORequiredRequiredNot Accepted
RussiaRURequiredRequiredNot Accepted
RwandaRWRequiredNot AcceptedNot Accepted
SamoaWSRequiredNot AcceptedNot Accepted
San MarinoSMRequiredNot AcceptedNot Accepted
Saudi ArabiaSARequiredNot AcceptedNot Accepted
SenegalSNRequiredNot AcceptedNot Accepted
SerbiaRSRequiredNot AcceptedNot Accepted
SeychellesSCRequiredNot AcceptedNot Accepted
Sierra LeoneSLNot AcceptedNot AcceptedNot Accepted
SingaporeSGRequiredNot AcceptedRequired
SlovakiaSKRequiredNot AcceptedRequired
SloveniaSIRequiredNot AcceptedNot Accepted
Solomon IslandsSBRequiredNot AcceptedNot Accepted
SomaliaSORequiredNot AcceptedNot Accepted
South AfricaZARequiredRequiredRequired
South KoreaKRRequiredRequiredNot Accepted
South SudanSSNot AcceptedNot AcceptedNot Accepted
SpainESRequiredRequiredOptional
Sri LankaLKRequiredNot AcceptedNot Accepted
St. Kitts & NevisKNRequiredNot AcceptedNot Accepted
St. LuciaLCRequiredNot AcceptedNot Accepted
St. MartinMFRequiredNot AcceptedNot Accepted
St. Vincent & GrenadinesVCRequiredNot AcceptedNot Accepted
SudanSDRequiredNot AcceptedNot Accepted
SurinameSRRequiredNot AcceptedNot Accepted
SwedenSERequiredNot AcceptedRequired
SwitzerlandCHRequiredNot AcceptedRequired
São Tomé & PríncipeSTRequiredNot AcceptedNot Accepted
TaiwanTWRequiredNot AcceptedNot Accepted
TajikistanTJRequiredNot AcceptedNot Accepted
TanzaniaTZRequiredNot AcceptedNot Accepted
ThailandTHRequiredRequiredNot Accepted
Timor-LesteTLRequiredNot AcceptedNot Accepted
TogoTGNot AcceptedNot AcceptedNot Accepted
TongaTONot AcceptedNot AcceptedNot Accepted
Trinidad & TobagoTTNot AcceptedNot AcceptedNot Accepted
TunisiaTNRequiredNot AcceptedNot Accepted
TurkeyTRRequiredNot AcceptedRequired
TurkmenistanTMRequiredNot AcceptedNot Accepted
Turks & Caicos IslandsTCRequiredNot AcceptedNot Accepted
TuvaluTVNot AcceptedNot AcceptedNot Accepted
UgandaUGNot AcceptedNot AcceptedNot Accepted
UkraineUARequiredNot AcceptedNot Accepted
United Arab EmiratesAENot AcceptedRequiredNot Accepted
United KingdomGBRequiredNot AcceptedRequired
United StatesUSRequiredRequiredOptional
UruguayUYRequiredNot AcceptedNot Accepted
UzbekistanUZRequiredNot AcceptedNot Accepted
VanuatuVUNot AcceptedNot AcceptedNot Accepted
Vatican CityVARequiredNot AcceptedNot Accepted
VenezuelaVERequiredNot AcceptedNot Accepted
VietnamVNRequiredNot AcceptedNot Accepted
Western SaharaEHRequiredNot AcceptedNot Accepted
YemenYENot AcceptedNot AcceptedNot Accepted
ZambiaZMRequiredNot AcceptedNot Accepted
ZimbabweZWNot AcceptedNot AcceptedNot Accepted