> ## Documentation Index
> Fetch the complete documentation index at: https://developer.jtl-software.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CancelSalesInvoiceCommandRequestInput

> Cancels a finalized invoice. A cancellation document is created with its own number and a copy of the line items; the payments of the invoice are moved to the sales order, and the quantities the invoice carried are free again. External invoices can be cancelled. The response carries the ID of the cancellation document. A refusal carries 'blockers' with all reasons, each with a code and a message. Errors: errorCode is SALES_INVOICE_NOT_FOUND (no sales invoice with this ID); errorCode is SALES_INVOICE_ALREADY_CANCELLED (the invoice is cancelled already); errorCode is SALES_INVOICE_IS_DRAFT (a draft cannot be cancelled; delete it); errorCode is SALES_INVOICE_HAS_UNCANCELLED_CORRECTION (a correction of the invoice exists that is not cancelled); errorCode is SALES_INVOICE_HAS_NO_SALES_ORDER (the invoice is not external and has no sales order); errorCode is CANCELLATION_REASON_NOT_FOUND (no cancellation reason with this ID); errorCode is CANCELLATION_COMMENT_REQUIRED (the reason requires a comment); errorCode is CANCELLATION_COMMENT_TOO_LONG (the comment is longer than 100 characters); errorCode is SALES_INVOICE_CANCELLATION_FAILED (the cancellation document could not be created). - Request



**Kind**: `input`

## Fields

**`salesInvoiceId`**: `ID!` (required)

The ID of the sales invoice.

---

**`cancellationReasonId`**: `ID!` (required)

The reason for cancelling the invoice, from the cancellation reasons of sales invoices.

---

**`cancellationComment`**: `String`

A comment on the cancellation; required for some reasons, at most 100 characters.

---

**`disableAutomaticWorkflows`**: `Boolean`

Suppresses the automatic workflow triggers of this call. Defaults to false when omitted.

---

**`idempotencyKey`**: `String`

Client-supplied idempotency key. When provided, a repeated request with the same key and payload replays the original result instead of re-executing the mutation.

