~/docs/banking/developers/snippets.mdx
docs online
12 / 13Developers

Snippets

Copy-ready Lua examples that use Banking's exports, such as billing a customer for a mechanic repair.

FrameworksQBCore, ESX, Qbox
Pages13
Updated06 Dec 2026
Read~1 min

Mechanic repair invoice#

lua
-- Called by your existing authorized server repair-completion workflow.
local function issueRepairInvoice(order)
    local result = exports['stormix-banking']:createInvoice({
        billFrom = order.society, -- Server-established shop group, e.g. mechanic.
        groupType = order.groupType, -- job/gang/system/ox; may be omitted when unambiguous.
        billTo = order.customerIdentifier,
        amount = order.totalDollars,
        label = ('Repair order %s - %s'):format(order.id, order.description),
        operationId = ('repair:%s'):format(order.id),
    })

    if not result.ok then
        print(('Repair invoice %s failed: %s'):format(order.id, result.error.code))
        return nil, result.error.code
    end

    return result.data.id
end

Government treasury integration#

lua
local treasuryName = 'government'
local treasuryType = 'system'

local function getTreasuryAccount()
    local result = exports['stormix-banking']:getBusinessAccount(treasuryName, treasuryType)
    if not result.ok then return nil, result.error.code end

    return result.data -- id, iban, balanceCents, ownerType, ownerId, etc.
end

local function addTreasuryReceipt(dollars, receiptId)
    return exports['stormix-banking']:addSocietyMoney(
        treasuryName, dollars, treasuryType, ('gov-credit:%s'):format(receiptId)
    )
end

local function payTreasuryExpense(dollars, expenseId)
    return exports['stormix-banking']:removeSocietyMoney(
        treasuryName, dollars, treasuryType, ('gov-debit:%s'):format(expenseId)
    )
end
stormix-bankingsnippets.mdx/ searcht themereport an issue