| Method | Signature | Returns |
generate | (country: string, bankCode?: string) | AccountResult |
validate | (country: string, raw: string) | boolean |
format | (country: string, raw: string) | string |
listCountries | () | BankCountryInfo[] |
isSupported | (country: string) | boolean |
interface AccountResult {
countryCode: string;
countryName: string;
formatName: string;
bankCode: string | null;
branchCode: string | null;
accountNumber: string;
checkDigits: string | null;
formatted: string;
raw: string;
iban: string | null;
valid: boolean;
}
interface BankCountryInfo {
code: string;
name: string;
format: string;
hasIban: boolean;
}
| Method | Signature | Returns |
generate | (country: string, gender?: string, year?: number) | string |
validate | (country: string, code: string) | boolean |
parse | (country: string, code: string) | IdResult |
listCountries | () | CountryInfo[] |
isSupported | (country: string) | boolean |
gender parameter: "male" or "female" (or omit for random).
interface IdResult {
countryCode: string;
code: string;
gender: string | null;
dob: string | null;
valid: boolean;
}
| Method | Signature | Returns |
generate | (brand?: string) | CardResult |
validate | (number: string) | boolean |
format | (brand: string, number: string) | string |
listBrands | () | string[] |
Supported brands: visa, mastercard, amex, discover, jcb, diners
interface CardResult {
brand: string;
number: string;
formatted: string;
cvv: string;
expiry: string;
valid: boolean;
}
| Method | Signature | Returns |
generate | (country?: string) | CompanyResult |
validate | (country: string, code: string) | boolean |
listCountries | () | CountryInfo[] |
interface CompanyResult {
countryCode: string;
countryName: string;
name: string;
code: string;
valid: boolean;
}
| Method | Signature | Returns |
generate | (country?: string) | SwiftResult |
validate | (code: string) | boolean |
interface SwiftResult {
code: string;
bank: string;
country: string;
location: string;
branch: string | null;
valid: boolean;
}
| Method | Signature | Returns |
generate | (country?: string) | DriverLicenseResult |
validate | (country: string, code: string) | boolean |
listCountries | () | CountryInfo[] |
isSupported | (country: string) | boolean |
interface DriverLicenseResult {
countryCode: string;
countryName: string;
name: string;
code: string;
valid: boolean;
}
| Method | Signature | Returns |
generate | (country?: string, options?: TaxIdOptions) | TaxIdResult |
validate | (country: string, code: string) | boolean |
listCountries | () | CountryInfo[] |
isSupported | (country: string) | boolean |
interface TaxIdOptions {
holderType?: string; // IN only: P, C, H, F, A, T, B, L, J, G
}
interface TaxIdResult {
countryCode: string;
countryName: string;
name: string;
code: string;
valid: boolean;
}
| Method | Signature | Returns |
generate | (country?: string) | PassportResult |
validate | (country: string, code: string) | boolean |
listCountries | () | CountryInfo[] |
isSupported | (country: string) | boolean |
interface PassportResult {
countryCode: string;
countryName: string;
name: string;
code: string;
valid: boolean;
}
| Function | Signature | Returns |
generateIban | (country?: string) | string |
validateIban | (iban: string) | boolean |
formatIban | (iban: string) | string |
ibanCountries | () | string[] |
interface CountryInfo {
code: string;
countryName: string;
idName: string;
}