Validation rules
This page's content:
Below you will find the validation rules we use for the input data.
Credit Cards
The credit card scheme can be detected by using the following regular expressions, note that if the rule has “include” and “exclude”, both need to be true to be accepted as that brand. Also, these rules need to be verified in the order displayed above.
- American Express:
- Includes:
^((34)|(37))
- Diners:
- Includes:
^(36)
- Mastercard:
- Includes:
^(5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$
- Excludes:
^(514256|514586|526461|511309|514285|501059|557909|501082|589633|501060|501051|501016|589657|553839|525855|553777|553771|551792|528733|549180|528745|517562|511849|557648|546367|501070|601782|508143|501085|501074|501073|501071|501068|501066|589671|589633|588729|501089|501083|501082|501081|501080|501075|501067|501062|501061|501060|501058|501057|501056|501055|501054|501053|501051|501049|501047|501045|501043|501041|501040|501039|501038|501029|501028|501027|501026|501025|501024|501023|501021|501020|501018|501016|501015|589657|589562|501105|557039|542702|544764|550073|528824|522135|522137|562397|566694|566783|568382|569322|504363)
- Elo:
^(50(67(1[589]|2[012456789]|3[<wbr />01234569]|4[123567]|53|7[4568]<wbr />)|9(0(0[0137]|2[0-2]|3[59]|4[<wbr />012578]|5[1235789]|6[<wbr />013456789]|7[0134789]|8[047]|<wbr />9[123489])|1(0[0456789]|46)|<wbr />220|407))|6(27780|36368|5(0(0(<wbr />3[12356789]|4[0-9]|5[01789]|6[<wbr />0-9]|7[0-6])|4(0[6-9]|1[0-9]|<wbr />2[0-9]|3[0-9]|8[5-9]|9[0-9])|<wbr />5(0[012346789]|1[0-9]|2[0-9]|<wbr />3[0-8]|5[2-9]|6[0-9]|7[0-9]|8[<wbr />0-9]|9[0-8])|72[0-7]|9(0[1-9]|<wbr />1[0-9]|2[0128]|3[89]|4[6-9]|5[<wbr />0-9]|6[0-9]|7[0-8]))|1(6(5[2-<wbr />9]|6[0-9]|7[0-9]|8[0-9]|9[0-9]<wbr />)|70[0-4])|50(0[0-9]|1[0-9]|2[<wbr />1-9]|3[0-9]|4[0-9]|5[0-7])))|<wbr />65(0(0(4[89]|5[01789]|6[<wbr />013456789]|7[0-6])|4(1[2-9]|2[<wbr />0-9]|3[01238])|5(3[1-8]|5[2-9]<wbr />|6[0-9]|7[0-6]|8[18]|9[4-8])|<wbr />720|9(5[01236789]|6[0129]|7[<wbr />02345678]))|1(6(62|7[0-4]|8[0-<wbr />9]|9[0-9])|70[0-4])|50(05|1[<wbr />189]|2[1-9]|3[0-9]|4[0-9]|5[<wbr />0345])))
- Includes:
^((509091)|(636368)|(636297)|(504175)|(438935)|(40117[8-9])|(45763[1-2])|(457393)|(431274)|(50990[0-2])|(5099[7-9][0-9])|(50996[4-9])|(509[1-8][0-9][0-9])|(5090(0[0-2]|0[4-9]|1[2-9]|[24589][0-9]|3[1-9]|6[0-46-9]|7[0-24-9]))|(5067(0[0-24-8]|1[0-24-9]|2[014-9]|3[0-379]|4[0-9]|5[0-3]|6[0-5]|7[0-8]))|(6504(0[5-9]|1[0-9]|2[0-9]|3[0-9]))|(6504(8[5-9]|9[0-9])|6505(0[0-9]|1[0-9]|2[0-9]|3[0-8]))|(6505(4[1-9]|5[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-8]))|(6507(0[0-9]|1[0-8]))|(65072[0-7])|(6509(0[1-9]|1[0-9]|20))|(6516(5[2-9]|6[0-9]|7[0-9]))|(6550(0[0-9]|1[0-9]))|(6550(2[1-9]|3[0-9]|4[0-9]|5[0-8])))
- Hipercard:
- Includes:
^((606282)|(637095)|(637568)|(637599)|(637609)|(637612))
- Visa:
- Includes:
^(4)
- Excludes:
^((451416)|(438935)|(40117[8-9])|(45763[1-2])|(457393)|(431274)|(402934))
- CARNET:
- Includes:
^(286900|502275|506(199|2(0[1-6]|1[2-578]|2[289]|3[67]|4[579]|5[01345789]|6[1-79]|7[02-9]|8[0-7]|9[234679])|3(0[0-9]|1[1-479]|2[0239]|3[02-79]|4[0-49]|5[0-79]|6[014-79]|7[0-4679]|8[023467]|9[1234689])|4(0[0-8]|1[0-7]|2[0-46789]|3[0-9]|4[0-69]|5[0-79]|6[0-38]))|588772|604622|606333|627535|636(318|379)|639(388|484|559))
- Naranja:
- Includes:
^(589562)
- Cabal:
- Includes:
^((627170)|(589657)|(603522)|(604((20[1-9])|(2[1-9][0-9])|(3[0-9]{2})|(400))))
Length between 2 and 50 digits
Date in the format MM/YYYY (e.g., 10/2019)
The length between three and four digits.
Customer data
For payments in Brazil
Length must be 8 digits; format may be XXXXX-XXX or XXXXXXXX
Length must be between 8 and 13 digits. You can see below an example of complete phone number for both Brazil and Mexico:
- Brazil
country code (+55)
area code (XX)
phone/mobile (XXXX-XXXX / XXXXX-XXXX)
Example: +55 41 3140-8723 or 99872-1281
For payments in Mexico
Length must be between 8 and 13 digits. You can see below an example of complete phone number:
Example: +55 41 3140-8723 or 99872-1281
- Mexico
country code (+52)
area code (XX / XXX)
phone/mobile (XXXX-XXXX / XXX-XXXX)
Example: +52 040 577-7687
For payments in Argentina
For CUIT/CUIL/CDI length must be 11 numeric digits. For DNI length goes from 7 or 8 numeric digits.
DNI REGEX: !/\d{7,8}/
Mask: xx-xxxxxxxx-x
For payments in Chile
Length must be 8 to 9 digits.
Mask: x.xxx.xxx – y (8 dígitos) xx.xxx.xxx – y (9 dígitos)
RUT REGEX: !/^[0-9]{7,8}[Kk0-9]$/
The last digit(y) could be a “k” or a number.
For payments in Colombia
NIT (Número de Identificación Tributaria) – Lenght of 9 to 10 digits. REGEX: !/^\d{9,15}$/ CC (Cédula de Ciudadanía) – Lenght of 5 to 15 digits. CE (Cédula de Extranjería) – Lenght of 1 to 6 digits.
For payments in Ecuador
Length must be 10 digits.
For payments in Peru
Length must be 8,9 or 11 digits. 10 digits is not a valid one.