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
| Name | Type | Required | Description |
|---|---|---|---|
owner | string | ✅ | Citizen ID of the owner whose account is being queried. |
accountType | string | ❌ | (Optional) Filters by type of account (e.g., "personal", "company, "shared"). |
bankType | string | ❌ | (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:
| Key | Type | Description |
|---|---|---|
accountNumber | string | Unique identifier for the account. |
accountType | string | Type of account ("personal", "shared", "company", etc.). |
bankType | string | Bank type ("fleeca", "swiss", etc.). |
owner | string | Citizen ID of the owner. |
status | string | Current status of the account ("active", "frozen", etc.). |
accountName | string | Display name of the account. |
members | table | Decoded JSON list of additional members linked to the account. |
balance | number | Balance from the first linked debit card (if available). |
income | number | Total income recorded for the account. |
expenses | number | Total expenses recorded for the account. |
transfer | number | Total amount transferred from the account. |
debitCardNumber | string | Debit 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.