Exports
Public exports registered by nx_realbanking, split into server and client.
All server exports live under exports.nx_realbanking:<Name>(). Client
exports use the same pattern inside a client-side script.
Server
exports.nx_realbanking:CreateInvoiceserverInsert a new invoice into the database and return its reference id.
Parameters
datatable— Invoice payload. Required: senderIdentifier, senderName, receiverIdentifier, receiverName, amount. Optional: type ("society" | "freelance" | "personal"), senderJob, senderJobLabel, label, vatPercent, vatAmount, commissionPercent, commissionAmount, govAccount, societyAccount.
Returns
boolean success, string|nil refIdOrErrorlocal ok, refId = exports.nx_realbanking:CreateInvoice({
senderIdentifier = 'char1:abc',
senderName = 'John Smith',
receiverIdentifier = 'char1:xyz',
receiverName = 'Jane Doe',
type = 'personal',
amount = 250.00,
label = 'Ride share'
})exports.nx_realbanking:GetInvoiceByRefserverFetch a single invoice row by its reference id.
Parameters
refIdstring— Reference id returned from CreateInvoice.
Returns
table|nillocal invoice = exports.nx_realbanking:GetInvoiceByRef('INV-ABC123')
if invoice then
print(invoice.amount, invoice.status)
endexports.nx_realbanking:GetPlayerInvoicesserverList invoices received by a given player, newest first.
Parameters
identifierstring— Player identifier (framework-specific: ESX identifier or QB citizenid).status?string— Filter: 'pending' | 'paid' | 'cancelled' | 'overdue'. Omit for all.
Returns
table[]local pending = exports.nx_realbanking:GetPlayerInvoices('char1:abc', 'pending')
print(('%d pending invoice(s)'):format(#pending))exports.nx_realbanking:PayInvoiceserverPay an invoice on behalf of the given source. Funds are pulled from the player's default account and distributed to society / commission / VAT destinations.
Parameters
refIdstring— Reference id of the invoice to pay.sourcenumber— Server id of the paying player.
Returns
boolean success, string|nil errorlocal ok, err = exports.nx_realbanking:PayInvoice('INV-ABC123', source)
if not ok then
print('Payment failed:', err)
endexports.nx_realbanking:ChargeCreditCardserverCharge an amount against a credit card. Supply one of cardId, cardNumber, or citizenId to resolve the card.
Parameters
payloadtable— Fields: amount (number, required), cardId | cardNumber | citizenId (one required), merchant (string, optional), transactionType (string, optional).
Returns
table { success: boolean, error?: string, ... }local result = exports.nx_realbanking:ChargeCreditCard({
citizenId = 'char1:abc',
amount = 1200,
merchant = 'Ammu-Nation',
transactionType = 'purchase'
})
if not result.success then
print('Charge failed:', result.error)
endexports.nx_realbanking:ApplyCreditCardserverRun the credit-application flow for a player. Assesses score, checks tier eligibility, and either issues a card or returns a rejection reason.
Parameters
sourcenumber— Server id of the applying player.requestedTier?string— One of 'standard', 'gold', 'black'. Omit to auto-assign the highest eligible tier from Config.Credit.tierPriority.
Returns
table { success: boolean, error?: string, card?: table, tier?: string, score?: number, ... }local result = exports.nx_realbanking:ApplyCreditCard(source, 'gold')
if result.success then
print('Issued', result.tier, 'card #', result.card.number)
else
print('Rejected:', result.error)
endClient
exports.nx_realbanking:IsAtATMclientReturns true while the player is within detection range of a known ATM prop.
Returns
booleanif exports.nx_realbanking:IsAtATM() then
-- Custom interaction prompt
endexports.nx_realbanking:GetNearestATMclientReturns the current ATM context, or nil if none is in range.
Returns
{ entity: number, coords: vector3, distance: number, hash: number } | nillocal atm = exports.nx_realbanking:GetNearestATM()
if atm and atm.distance < 1.5 then
print('Standing at ATM', atm.entity)
endexports.nx_realbanking:IsInteractingclientReturns true while the ATM session is active (camera engaged, NUI open).
Returns
booleanif exports.nx_realbanking:IsInteracting() then
-- Suppress your own UI while banking
endexports.nx_realbanking:GetSessionclientReturns the current client-side session descriptor, or nil when idle.
Returns
table | nillocal session = exports.nx_realbanking:GetSession()
if session then
print('Session id:', session.id)
end