Bablo ResourcesDocs

Exports

Use these exports to integrate other scripts with the billing system. Call client exports from client scripts, server exports from server scripts.

Client Exports

Open — Open Billing UI

Opens the billing interface for the local player.

LUA
exports['bablo-billing']:Open()

OpenJob — Open Billing with Job Access

Checks job permissions and grants job account access, then opens the billing UI. Use this when you want to restrict job billing to specific interactions (e.g. on duty).

LUA
exports['bablo-billing']:OpenJob()

Example usage in a job script:

LUA
RegisterCommand('police_billing', function()
    exports['bablo-billing']:OpenJob()
end, false)

OpenJob respects Config.JobAccount.blockedJobs. If the player’s job is blocked, a notification is shown and the UI will not open.

CanAccessJobAccount — Check Job Account Access

Returns true if the local player currently has access to job accounts, false otherwise.

LUA
local canAccess = exports['bablo-billing']:CanAccessJobAccount()
if canAccess then
    print('Player has job account access')
end

When Config.JobAccount.requireJobOpen = false, this always returns true. When requireJobOpen = true, access is only granted after OpenJob is called.


Server Exports

createInvoice / CreateInvoice — Create an Invoice

Creates a new invoice from a sender to a recipient.

LUA
exports['bablo-billing']:createInvoice({
    from = 'steam:110000100000000',   -- Sender's identifier
    to   = 'steam:110000100000001',   -- Recipient's identifier
    title       = 'Vehicle Repair',
    description = 'Engine replacement and paint job',
    amount      = 15000
})
ParameterTypeDescription
fromstringSender’s player identifier
tostringRecipient’s player identifier
titlestringInvoice title
descriptionstringInvoice description (optional)
amountnumberAmount to invoice
due_datenumberUnix timestamp in ms for due date (optional)

getInvoice — Get Invoice Data

Retrieves invoice data by ID.

LUA
local invoice = exports['bablo-billing']:getInvoice('invoice-uuid-here')

payInvoice — Pay an Invoice

Pays an invoice programmatically on behalf of a player.

LUA
local success = exports['bablo-billing']:payInvoice('invoice-uuid-here', 'steam:110000100000000')
ParameterTypeDescription
invoiceIdstringThe invoice UUID
identifierstringThe player identifier paying the invoice

deleteInvoice — Delete an Invoice

Deletes an invoice by ID.

LUA
exports['bablo-billing']:deleteInvoice('invoice-uuid-here')