Cancel sales invoice
Cancels a submitted sales invoice and reverses its ledger entries.
POST https://cotlet.dev/api/v1/erpnext/sales-invoice/cancel
Moves a submitted Sales Invoice to cancelled (docstatus 2) and reverses its ledger effects. ERPNext's guide says to handle linked payments, returns and stock transactions first; the call returns ERPNext's error if something still links to the invoice. A cancelled invoice cannot be edited, so create a new draft to replace it. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| invoice string required | string | Sales Invoice ID from list_sales_invoices or create_sales_invoice. |
Request
curl -X POST https://cotlet.dev/api/v1/erpnext/sales-invoice/cancel \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"invoice":"invoice"}' result = client.call("erpnext", "cancel_sales_invoice", {"invoice":"invoice"}) const result = await cotlet.call('erpnext', 'cancel_sales_invoice', {"invoice":"invoice"}); cotlet call erpnext cancel_sales_invoice --data '{"invoice":"invoice"}' Example response
{
"invoice": "ACC-SINV-2026-00042",
"status": "Cancelled",
"docstatus": 2
}