Kartik Scripts

CancelInvoice

local ok, err = exports['kartik-banking']:CancelInvoice(invoiceId, reason)

🔹 Description

Cancels an open invoice. It can no longer be paid and stops recurring. Fires the onInvoiceCancelled event.


🔧 Parameters

NameTypeRequiredDescription
invoiceIdnumber✅The invoice id
reasonstring❌Why it was cancelled (default 'cancelled')

📤 Returns

TypeDescription
trueThe invoice was cancelled
false, 'invoice_not_found'No invoice with that id
false, 'invoice_not_active'It is already paid or cancelled

🧠 Example Usage

local ok, err = exports['kartik-banking']:CancelInvoice(42, 'Order refunded')

On this page