Skip to main content

finance Domain

The finance domain maps domain keywords to underlying faker implementations.

Faker Documentation

Methods

finance.accountName

Generates a random account name.

No parameters.

Examples:

Shows the default finance.accountName call.

finance.accountName

Returns: Home Loan Account

finance.accountNumber

Generates a random account number.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.

Examples:

Shows finance.accountNumber when optional params are omitted.

finance.accountNumber()

Returns: 47031013

Shows finance.accountNumber using length.

finance.accountNumber(length=5)

Returns: 47031

finance.amount

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

ArgTypeRequiredDescription
autoFormatbooleannoIf true this method will use Number.toLocaleString(). Otherwise it will use Number.toFixed().
decintegernoThe number of decimal places for the amount.
maxnumbernoThe upper bound for the amount.
minnumbernoThe lower bound for the amount.
symbolstringnoThe symbol used to prefix the amount.

Examples:

Shows finance.amount when optional params are omitted.

finance.amount()

Returns: 417.02

Shows finance.amount using autoFormat.

finance.amount(autoFormat=true)

Returns: 417.02

Shows finance.amount using dec.

finance.amount(dec=2)

Returns: 417.02

Shows finance.amount using max.

finance.amount(max=100)

Returns: 41.70

Shows finance.amount using min.

finance.amount(max=10, min=1)

Returns: 4.75

Shows finance.amount using symbol.

finance.amount(symbol="$")

Returns: $417.02

finance.bic

Generates a random SWIFT/BIC code based on the ISO-9362 format.

ArgTypeRequiredDescription
includeBranchCodebooleannoWhether to include a three-digit branch code at the end of the generated code.

Examples:

Shows finance.bic when optional params are omitted.

finance.bic()

Returns: SAHDBI6CJFO

Shows finance.bic using includeBranchCode.

finance.bic(includeBranchCode=true)

Returns: KSAHBZ36EJF

finance.bitcoinAddress

Generates a random Bitcoin address.

ArgTypeRequiredDescription
typelegacy|segwit|bech32|taprootnoThe bitcoin address type ('legacy', 'segwit', 'bech32' or 'taproot').
networkmainnet|testnetnoThe bitcoin network ('mainnet' or 'testnet').

Examples:

Shows finance.bitcoinAddress when optional params are omitted.

finance.bitcoinAddress()

Returns: 31i96bmpxqFcS2Eqy9cNYjGST53aS6qX

Shows finance.bitcoinAddress using type.

finance.bitcoinAddress(type="bech32")

Returns: bc1fr0a536dekfp7w0pfk57tycqww326w4fykqcpu0

Shows finance.bitcoinAddress using network.

finance.bitcoinAddress(network="testnet")

Returns: 21i96bmpxqFcS2Eqy9cNYjGST53aS6qX

finance.creditCardCVV

Generates a random credit card CVV.

No parameters.

Examples:

Shows the default finance.creditCardCVV call.

finance.creditCardCVV

Returns: 470

finance.creditCardIssuer

Returns a random credit card issuer.

No parameters.

Examples:

Shows the default finance.creditCardIssuer call.

finance.creditCardIssuer

Returns: discover

finance.creditCardNumber

Generates a random credit card number.

ArgTypeRequiredDescription
issuerstringnoIssuer or provider value used to constrain generated output.

Examples:

Shows finance.creditCardNumber when optional params are omitted.

finance.creditCardNumber()

Returns: 6503-1013-3546-2805

Shows finance.creditCardNumber using issuer.

finance.creditCardNumber(issuer="Visa")

Returns: 4703101335466

finance.currencyCode

Returns a random currency code.

No parameters.

Examples:

Shows the default finance.currencyCode call.

finance.currencyCode

Returns: JOD

finance.currencyName

Returns a random currency name.

No parameters.

Examples:

Shows the default finance.currencyName call.

finance.currencyName

Returns: Jordanian Dinar

finance.currencyNumericCode

Returns a random currency numeric code.

No parameters.

Examples:

Shows the default finance.currencyNumericCode call.

finance.currencyNumericCode

Returns: 400

finance.currencySymbol

Returns a random currency symbol.

No parameters.

Examples:

Shows the default finance.currencySymbol call.

finance.currencySymbol

Returns: руб

finance.ethereumAddress

Creates a random, non-checksum Ethereum address.

No parameters.

Examples:

Shows the default finance.ethereumAddress call.

finance.ethereumAddress

Returns: 0x9f0632478b9f4d0e9c34bf6fdd103d29fbf6fc0a

finance.iban

Generates a random IBAN.

ArgTypeRequiredDescription
countryCodestringnoThe country code from which you want to generate an IBAN, if none is provided a random country will be used.
formattedbooleannoReturn a formatted version of the generated IBAN.

Examples:

Shows finance.iban when optional params are omitted.

finance.iban()

Returns: IE39SAHD00454601410936

Shows finance.iban using countryCode.

finance.iban(countryCode="GB")

Returns: GB98KSAH00235420410936

Shows finance.iban using formatted.

finance.iban(formatted=true)

Returns: IE39 SAHD 0045 4601 4109 36

finance.litecoinAddress

Generates a random Litecoin address.

No parameters.

Examples:

Shows the default finance.litecoinAddress call.

finance.litecoinAddress

Returns: 31i96bmpxqFcS2Eqy9cNYjGST53aS

finance.pin

Generates a random PIN number.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.

Examples:

Shows finance.pin when optional params are omitted.

finance.pin()

Returns: 4703

Shows finance.pin using length.

finance.pin(length=5)

Returns: 47031

finance.routingNumber

Generates a random routing number.

No parameters.

Examples:

Shows the default finance.routingNumber call.

finance.routingNumber

Returns: 470310139

finance.transactionDescription

Generates a random transaction description.

No parameters.

Examples:

Shows the default finance.transactionDescription call.

finance.transactionDescription

Returns: You made a payment of AED 302.33 at Hegmann - Johnston using card ending in ****6280 from account ***6451.

finance.transactionType

Returns a random transaction type.

No parameters.

Examples:

Shows the default finance.transactionType call.

finance.transactionType

Returns: invoice