GetInvoice
local invoice = exports['kartik-banking']:GetInvoice(invoiceId)🔹 Description
Returns one invoice by its id.
🔧 Parameters
| Name | Type | Required | Description |
|---|---|---|---|
invoiceId | number | ✅ | The invoice id (returned by GenerateBill) |
📤 Returns
The invoice table, or nil if it does not exist. metadata is already a Lua table.
| Field | Description |
|---|---|
id | Invoice id |
owner | Account number the invoice is billed to |
issuer_account_number | Account that receives the payment (if set) |
sender_name | Who sent it |
title, description | Invoice text |
amount | Amount (per installment for EMI) |
frequency, custom_frequency_days, next_due | Billing schedule |
auto_pay | 1 when autopay is on |
active | 1 while unpaid / running, 0 when paid or cancelled |
metadata | type (one-time / subscription / emi) and EMI details |
🧠 Example Usage
local invoice = exports['kartik-banking']:GetInvoice(42)
if invoice and invoice.active == 1 then
print(('Invoice %s is still open: $%d'):format(invoice.title, invoice.amount))
end