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
| Name | Type | Required | Description |
|---|---|---|---|
invoiceId | number | ✅ | The invoice id |
reason | string | ❌ | Why it was cancelled (default 'cancelled') |
📤 Returns
| Type | Description |
|---|---|
true | The 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')