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.
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.
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.
AddEventHandler('bablo-billing:invoiceDeleted', function(invoice)
print(('Invoice %s deleted'):format(invoice.uuid))
end)Invoice payload
Every event above receives the same invoice table:
| Field | Type | Description |
|---|---|---|
id | number | Auto-increment database id |
uuid | string | Public invoice reference (use this to look it up) |
issuer_identifier | string | Sender’s identifier |
issuer_display_name | string | Sender’s character name |
recipient_identifier | string | Recipient’s identifier |
issuer_account_type | string | personal or job |
issuer_job_name | string | nil | Sender’s job (when a job invoice) |
recipient_account_type | string | personal or job |
recipient_job_name | string | nil | Recipient’s job (when billing a job) |
amount | number | Invoice amount (pre-tax subtotal) |
title | string | Invoice title |
description | string | Invoice description |
status | string | pending or paid |
created_at | number | Creation time (unix ms) |
due_date | number | nil | Due date (unix ms) |
paid_at | number | nil | Payment 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.
