Cancel sales invoice

Cancels a submitted sales invoice and reverses its ledger entries.

MCP tool erpnext_write → cancel_sales_invoice

write Confirm

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

Parameters: cancel_sales_invoice
NameTypeDescription
invoice string required string Sales Invoice ID from list_sales_invoices or create_sales_invoice.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "erpnext_write",
    "arguments": {
      "operation": "cancel_sales_invoice",
      "arguments": {
        "invoice": "invoice"
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "invoice": "ACC-SINV-2026-00042",
    "status": "Cancelled",
    "docstatus": 2
  },
  "isError": false
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.