Kartik Scripts

GetAccountDataByOwner

exports['kartik-banking']:GetAccountDataByOwner(owner, accountType, bankType)

🔹 Description

Fetches detailed information about the first bank account owned by the given citizen ID. If an accountType is provided, it filters the result by that type (e.g., personal, business, etc.).


🔧 Parameters

NameTypeRequiredDescription
ownerstring✅Citizen ID of the owner whose account is being queried.
accountTypestring❌(Optional) Filters by type of account (e.g., "personal", "company, "shared").
bankTypestring❌(Optional) Filters by type of bank(e.g., "fleeca", "swiss).

Bydefault - fleeca

📤 Returns

Returns a table with account details if found, or false if no account is found.

Return Structure:

KeyTypeDescription
accountNumberstringUnique identifier for the account.
accountTypestringType of account ("personal", "shared", "company", etc.).
bankTypestringBank type ("fleeca", "swiss", etc.).
ownerstringCitizen ID of the owner.
statusstringCurrent status of the account ("active", "frozen", etc.).
accountNamestringDisplay name of the account.
memberstableDecoded JSON list of additional members linked to the account.
balancenumberBalance from the first linked debit card (if available).
incomenumberTotal income recorded for the account.
expensesnumberTotal expenses recorded for the account.
transfernumberTotal amount transferred from the account.
debitCardNumberstringDebit card number (if available).

🧠 Example Usage

local account = exports['kartik-banking']:GetAccountDataByOwner("CITIZEN1234", "personal", "fleeca")

if account then
    print("Account Number:", account.accountNumber)
    print("Balance:", account.balance)
else
    print("No account found.")
end

❌ Returns false If:

  • No matching account is found for the given owner and (optional) account type.

On this page