QBCore Frameworkqbcore.netCommunity docs
On this page

Updated 2026-10-11 · 5 min read

qb-banking: accounts, exports and SQL

qb-banking implements the bank/ATM interface, shared player accounts, job and gang accounts, and bank statements. It does not replace the checking balance in Player.PlayerData.money.bank. This reference is based on upstream commit b2dee4e, not older forks with different account models.

Installation and dependencies

  1. Install qb-core and oxmysql. The manifest imports @oxmysql/lib/MySQL.lua and the client-side PolyZone modules.
  2. Import the unmodified banking.sql into a staging database. Back up existing account data before migrating an old banking script.
  3. Start the required dependencies before qb-banking. Confirm no second resource is defining a competing banking UI or society-account schema.
  4. Join with a test character, open a bank and an ATM, then test deposits and withdrawals with permitted and insufficient balances.

The upstream SQL creates exactly two tables:

TablePurpose
bank_accountsNamed shared, job and gang accounts; includes account_name, account_balance, account_type and users
bank_statementsTransaction history with citizenid, account_name, amount, reason and statement_type

bank_accounts.account_type permits shared, job and gang. The personal checking account is represented using PlayerData.money.bank; do not change the SQL enum to an invented personal or business type.

Configuration

These are the keys present in upstream config.lua:

KeyCurrent defaultWhat it controls
Config.useTargetGetConvar('UseTarget', 'false') == 'true'Whether target interaction is enabled
Config.atmModelsFour GTA ATM prop namesModels used for nearby ATM detection
Config.useDailyLimittrueEnables the configured withdrawal limit flow
Config.dailyLimit5000Configured withdrawal limit
Config.maxAccounts2Maximum additional accounts per character
Config.blipInfoBank blip propertiesBank map markers
Config.locationsBank coordinatesBank interaction locations

Do not use Config.EnableATMs, Config.InterestRate or other keys from unrelated bank forks unless the installed revision actually defines them.

Server exports

Call these from server code. The names and function arguments below come from server.lua.

ExportArgumentsWhat it does
CreatePlayerAccountplayerId, accountName, accountBalance, accountUsersCreates a named shared account for an online player's citizen ID
CreateJobAccountaccountName, accountBalanceCreates a job account
CreateGangAccountaccountName, accountBalanceCreates a gang account
CreateBankStatementplayerId, account, amount, reason, statementType, accountTypeStores a bank statement
AddMoney / AddGangMoneyaccountName, amount, reasonCredits a named banking account
RemoveMoney / RemoveGangMoneyaccountName, amount, reasonDebits a named banking account
GetAccount / GetGangAccountaccountNameReturns the named account table or nil
GetAccountBalanceaccountNameReturns the named account balance, or 0 when absent

The gang-named exports are aliases of the corresponding generic implementations. CreateAccount, GetBalance, and OpenBankingMenu are not exported by this upstream revision.

Read a job account without changing it

local account = exports['qb-banking']:GetAccount('police')
if not account then
    print('No police banking account has been initialized')
else
    print(('Police account balance: %s'):format(account.account_balance))
end

GetAccountBalance('police') returning 0 does not distinguish a missing account from an empty one; call GetAccount when that distinction matters.

Credit a verified job account

Only a server-owned workflow with independently validated authorization and amount should modify an account. AddMoney does not perform your job/role authorization for you.

-- Within an already authorized, server-owned payout path:
local accountName = 'police'  -- Derived from trusted server configuration
local amount = 250            -- Derived from trusted server rules
local account = exports['qb-banking']:GetAccount(accountName)
if account and amount > 0 then
    exports['qb-banking']:AddMoney(accountName, amount, 'Approved department payment')
end

Do not accept accountName, amount or reason directly from a client event and use them without server-side validation.

Callbacks versus network events

The bundled client uses QBCore.Functions.TriggerCallback for these internal banking flows:

  • qb-banking:server:openBank and qb-banking:server:openATM
  • qb-banking:server:withdraw and qb-banking:server:deposit
  • qb-banking:server:internalTransfer and qb-banking:server:externalTransfer
  • qb-banking:server:orderCard, openAccount, renameAccount and deleteAccount (all with the qb-banking:server: prefix)
  • qb-banking:server:addUser and qb-banking:server:removeUser

These are framework callbacks, not qb-banking:server:depositMoney/withdrawMoney network events. Their payloads belong to the installed UI, not a documented general-purpose export API.

Job and gang accounts are initialized when the bank opens for an applicable player. A separate resource that needs the balance before first bank use should verify account initialization instead of assuming the row already exists.

Troubleshooting

SymptomFirst check
bank_accounts or bank_statements missingVerify the official banking.sql was imported into the actual oxmysql database
Account lookup returns nilCheck the exact account_name and whether an account was created/initialized
Account balance is wrongDetermine whether the integration used the named society account or PlayerData.money.bank
ATM interface does not openConfirm Config.atmModels, target convar, PolyZone startup and client console
An export or event cannot be foundCompare its spelling and side with server.lua; do not copy APIs from a different bank fork
Migration from an older banking script breaksDiff table columns and account types on staging; do not overwrite balances with a new demo schema

Update checklist

  1. Pin the deployed banking commit; review config.lua, server.lua, client.lua and banking.sql together.
  2. Back up existing accounts and statements before any SQL migration.
  3. Verify authorized and unauthorized transfers, account creation limits, withdrawal bounds and UI callbacks on a test server.
  4. Audit custom money-changing events separately: this page documents the upstream interface, not a security guarantee.

Sources

Repository · Server exports and callbacks · Configuration · Schema

For server-side money handling see QBCore functions and safe server events.

Related Banking Scripts on RPScripts

Paid banking listings on the RPScripts marketplace, for comparison against the free resources documented above.

Ownership disclosure: qbcore.net and RPScripts are operated by the same owner. These are commercial alternatives, not verified compatibility recommendations. Check each listing for current dependencies, licensing, support, price, and availability.

Found an issue in this guide?

Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website