API Search endpoints…⌘K Get API credentialsGet access

Cancel an invoice

POST/lokta-lms/api/v1/invoices/{id}/cancellation

Cancels a partner invoice, with a reason.

reason is required (422 sourcing/invoice_cancel_reason_required).

The invoice number is kept. GST requires a consecutive series, so a cancelled number stays spent and its invoice stays readable as cancelled; reissuing it would put two different documents under one reference, which is what consecutive numbering exists to prevent. A hole in the series and a reused number are both audit findings; keeping the row is neither, and the reason is what explains it to whoever reads the series.

Refused while anything is settled against it (409 sourcing/invoice_already_paid). A cancelled invoice with a payment attached is unresolvable: the money left, and the document saying why no longer stands. The guard reads net settlement (sum(amount_paid), contras included), so reversing the payments clears it; an invoice can be cancelled once nothing is settled against it.

The accruals behind it return to accrued, so a later run can invoice them again. The work was done and the partner is still owed for it. Only the document was withdrawn.

Path parameters

idpath · string · required

Header parameters

Idempotency-Keyheader · string · optional

Per-intent key

Request body application/json

reasonstring · required

Required. It explains the cancelled number to whoever reads the series.

Responses

defaultdefault response

Every request authenticates with HTTP Basic and carries a Tenant-Identifier header. See the conventions for dates, commands, pagination and errors. Open this operation in the interactive explorer, or read it as Markdown.

This is the API reference for Lokta, the agentic loan servicing platform. Go to lokta.ai