Bablo ResourcesDocs

Events

These are server-side events — register them in a server script with AddEventHandler. Each handler receives the full invoice table (see Invoice payload). They are emitted locally on the server with TriggerEvent, so do not use RegisterNetEvent for them.

bablo-billing:invoiceCreated

Fires whenever an invoice is created — via the billing UI, the createInvoice / CreateInvoice exports, or any other path.

LUA
AddEventHandler('bablo-billing:invoiceCreated', function(invoice)
    print(('New invoice %s: %s -> %s for $%s'):format(
        invoice.uuid, invoice.issuer_identifier, invoice.recipient_identifier, invoice.amount
    ))
end)

bablo-billing:invoicePaid

Fires when an invoice is paid — manually or by auto-pay of overdue invoices. The invoice has status = 'paid' and a paid_at timestamp.

LUA
AddEventHandler('bablo-billing:invoicePaid', function(invoice)
    print(('Invoice %s paid by %s'):format(invoice.uuid, invoice.recipient_identifier))
end)

bablo-billing:invoiceDeleted

Fires when a pending invoice is deleted.

LUA
AddEventHandler('bablo-billing:invoiceDeleted', function(invoice)
    print(('Invoice %s deleted'):format(invoice.uuid))
end)

Invoice payload

Every event above receives the same invoice table:

FieldTypeDescription
idnumberAuto-increment database id
uuidstringPublic invoice reference (use this to look it up)
issuer_identifierstringSender’s identifier
issuer_display_namestringSender’s character name
recipient_identifierstringRecipient’s identifier
issuer_account_typestringpersonal or job
issuer_job_namestring | nilSender’s job (when a job invoice)
recipient_account_typestringpersonal or job
recipient_job_namestring | nilRecipient’s job (when billing a job)
amountnumberInvoice amount (pre-tax subtotal)
titlestringInvoice title
descriptionstringInvoice description
statusstringpending or paid
created_atnumberCreation time (unix ms)
due_datenumber | nilDue date (unix ms)
paid_atnumber | nilPayment time (unix ms), set on invoicePaid

The billing UI (client) also receives invoiceCreated / invoicePaid / invoiceDeleted via TriggerClientEvent, but wrapped as { type = 'sent' | 'received', invoice = <invoice> }. For server-side integrations (e.g. an MDT) use the server events above, which pass invoice directly.