legacy-billing
Overview
What legacy-billing does and how it fits together.
legacy-billing
legacy-billing is a full billing/invoicing system for FiveM:
- Players receive and pay bills, in full or partially, via cash or bank.
- Job employees (e.g. police, ambulance, mechanic) send individual or bulk bills to players and manage reusable bill templates.
- Admins (members of
Config.AdminGroups) get system-wide statistics, can cancel bills, manage which jobs are allowed to bill, configure late fees, and resolve disputes.
Bill lifecycle
Bills progress through statuses defined in Config.Statuses:
unpaid → partial / paid, or overdue (with late fees applied), or disputed → resolved (which reinstates to unpaid/partial or sets cancelled).
Data model
All billing data is backed by five MySQL tables:
legacy_billing_jobs— which jobs may send bills, and their late fee percentagelegacy_bills— the bills themselveslegacy_bill_payments— payment history against billslegacy_bill_disputes— filed disputes and their resolutionlegacy_bill_templates— reusable per-job bill templates
How players interact with it
Players (and job billers/admins) open the billing panel with the /billing command, which opens a NUI panel showing different tabs depending on permissions (player bills, job biller panel, admin panel).
How other resources interact with it
Other resources can:
- Open the billing panel for a player via the
OpenBilling()client export. - Create bills programmatically via the
CreateBill(...)server export. - React to billing activity via the
legacy-billing:billCreated,legacy-billing:billPaid, andlegacy-billing:billCancelledserver-local events.
See the Integration page for full details and code samples.
Frontend
The NUI panel is a separate React/Vite project rooted at web/, with translated strings loaded from locales/en.json and locales/sv.json (selected via Config.Locale).