Finance

Module to generate finance related entries.

Account

Generates a random account number.

Parameters

NameTypeDefaultDescription
length?number8

The length of the account number.

Returns: string

faker.finance.account(length?: number = 8): string
faker.finance.account() // => "55786858"
faker.finance.account() // 92842238
faker.finance.account(5) // 32564

Account Name

Generates a random account name.

Returns: string

faker.finance.accountName(): string
faker.finance.accountName() // => "Home Loan Account"
faker.finance.accountName() // 'Personal Loan Account'

Amount

Generates a random amount between the given bounds (inclusive).

Parameters

NameTypeDefaultDescription
minnumber0

The lower bound for the amount.

maxnumber1000

The upper bound for the amount.

decnumber2

The number of decimal places for the amount.

symbolstring''

The symbol used to prefix the amount.

autoFormat?boolean

If true this method will use Number.toLocaleString(). Otherwise it will use Number.toFixed().

Returns: string

faker.finance.amount(min: number = 0, max: number = 1000, dec: number = 2, symbol: string = '', autoFormat?: boolean): string
faker.finance.amount() // => "548.81"
faker.finance.amount() // '617.87'
faker.finance.amount(5, 10) // '5.53'
faker.finance.amount(5, 10, 0) // '8'
faker.finance.amount(5, 10, 2, '$') // '$5.85'
faker.finance.amount(5, 10, 5, '', true) // '9,75067'

Bic

Generates a random bic.

Returns: string

faker.finance.bic(): string
faker.finance.bic() // => "PSVOTDO1"
faker.finance.bic() // 'WYAUPGX1432'

Bitcoin Address

Generates a random bitcoin address.

Returns: string

faker.finance.bitcoinAddress(): string
faker.finance.bitcoinAddress() // => "3HQARxRqCDoriT4XgotMPwtyoVQ5k6"
faker.finance.bitcoinAddress() // '3ySdvCkTLVy7gKD4j6JfSaf5d'

Credit Card CVV

Generates a random credit card CVV.

Returns: string

faker.finance.creditCardCVV(): string
faker.finance.creditCardCVV() // => "557"
faker.finance.creditCardCVV() // '506'

Credit Card Issuer

Returns a random credit card issuer.

Returns: string

faker.finance.creditCardIssuer(): string
faker.finance.creditCardIssuer() // => "maestro"
faker.finance.creditCardIssuer() // 'discover'

Credit Card Number

Generates a random credit card number.

Parameters

NameTypeDefaultDescription
issuerstring''

The name of the issuer (case insensitive) or the format used to generate one.

Returns: string

faker.finance.creditCardNumber(issuer: string = ''): string
faker.finance.creditCardNumber() // => "5020868584663428091"
faker.finance.creditCardNumber() // '4427163488668'
faker.finance.creditCardNumber('visa') // '4882664999003'
faker.finance.creditCardNumber('63[7-9]#-####-####-###L') // '6375-3265-4676-6644'

Currency Code

Returns a random currency code. (The short text/abbreviation for the currency (e.g. US Dollar -> USD))

Returns: string

faker.finance.currencyCode(): string
faker.finance.currencyCode() // => "MUR"
faker.finance.currencyCode() // 'USD'

Currency Name

Returns a random currency name.

Returns: string

faker.finance.currencyName(): string
faker.finance.currencyName() // => "Mauritius Rupee"
faker.finance.currencyName() // 'US Dollar'

Currency Symbol

Returns a random currency symbol.

Returns: string

faker.finance.currencySymbol(): string
faker.finance.currencySymbol() // => "₨"
faker.finance.currencySymbol() // '$'

Ethereum Address

Generates a random ethereum Address.

Returns: string

faker.finance.ethereumAddress(): string
faker.finance.ethereumAddress() // => "0xcdfcdcbc9de896d1f58abbbac8ec171e08cfb3dd"
faker.finance.ethereumAddress() // '0xf03dfeecbafc5147241cc4c4ca20b3c9dfd04c4a'

Iban

Generates a random iban.

Parameters

NameTypeDefaultDescription
formattedbooleanfalse

Return a formatted version of the generated IBAN.

countryCode?string

The country code from which you want to generate an IBAN, if none is provided a random country will be used.

Returns: string

faker.finance.iban(formatted: boolean = false, countryCode?: string): string
faker.finance.iban() // => "LI4476584648937N59B00"
faker.finance.iban() // 'TR736918640040966092800056'
faker.finance.iban(true) // 'FR20 8008 2330 8984 74S3 Z620 224'
faker.finance.iban(true, 'DE') // 'DE84 1022 7075 0900 1170 01'

Litecoin Address

Generates a random litecoin address.

Returns: string

faker.finance.litecoinAddress(): string
faker.finance.litecoinAddress() // => "MHQARxRqCDoriT4XgotMPwtyoVQ5k6"
faker.finance.litecoinAddress() // 'MoQaSTGWBRXkWfyxKbNKuPrAWGELzcW'

Mask

Generates a random masked number.

Parameters

NameTypeDefaultDescription
length?number4

The length of the unmasked number.

parens?booleantrue

Whether to use surrounding parenthesis.

ellipsis?booleantrue

Whether to prefix the numbers with an ellipsis.

Returns: string

faker.finance.mask(length?: number = 4, parens?: boolean = true, ellipsis?: boolean = true): string
faker.finance.mask() // => "(...5578)"
faker.finance.mask() // '(...9711)'
faker.finance.mask(3) // '(...342)'
faker.finance.mask(3, false) // '...236'
faker.finance.mask(3, false, false) // '298'

Pin

Generates a random PIN number.

Parameters

NameTypeDefaultDescription
lengthnumber4

The length of the PIN to generate.

Returns: string

faker.finance.pin(length: number = 4): string
faker.finance.pin() // => "5578"
faker.finance.pin() // '5067'
faker.finance.pin(6) // '213789'

Routing Number

Generates a random routing number.

Returns: string

faker.finance.routingNumber(): string
faker.finance.routingNumber() // => "557868588"
faker.finance.routingNumber() // '522814402'

Transaction Description

Generates a random transaction description.

Returns: string

faker.finance.transactionDescription(): string
faker.finance.transactionDescription() // => "payment transaction at Ratke - Sporer using ca...
faker.finance.transactionDescription()
// 'invoice transaction at Kilback - Durgan using card ending with ***(...4316) for UAH 783.82 in account ***16168663'

Transaction Type

Returns a random transaction type.

Returns: string

faker.finance.transactionType(): string
faker.finance.transactionType() // => "payment"
faker.finance.transactionType() // 'payment'