Kartik Scripts

GetInvoice

local invoice = exports['kartik-banking']:GetInvoice(invoiceId)

🔹 Description

Returns one invoice by its id.


🔧 Parameters

NameTypeRequiredDescription
invoiceIdnumber✅The invoice id (returned by GenerateBill)

📤 Returns

The invoice table, or nil if it does not exist. metadata is already a Lua table.

FieldDescription
idInvoice id
ownerAccount number the invoice is billed to
issuer_account_numberAccount that receives the payment (if set)
sender_nameWho sent it
title, descriptionInvoice text
amountAmount (per installment for EMI)
frequency, custom_frequency_days, next_dueBilling schedule
auto_pay1 when autopay is on
active1 while unpaid / running, 0 when paid or cancelled
metadatatype (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

On this page