Skip to main content

deleteInvoice

DEPRECATED

Invoices are cancelled, never deleted — use cancelInvoice. This mutation always refuses.

Requires at least one of the permissions payments:invoice:delete or purchase:purchase_invoice:delete.

Always refuses: invoices are cancelled, never deleted. Use cancelInvoice; the cancelled invoice is kept for audit. An invoice that already has payments is refused with a pointer to cancelling it. Needs the invoices delete or purchase invoices delete permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation DeleteInvoice($id: ID!) {
deleteInvoice(id: $id) {
id
invoiceNumber
supplierCode
supplierDisplayName
supplierName
status
allocations {
id
invoiceNumber
paymentNumber
createdAt
amount
appliedFromAdvance
}
}
}

Variables:

{
"id": "id"
}

Response:

{
"data": {
"deleteInvoice": {
"id": "id",
"invoiceNumber": "string",
"supplierCode": "string",
"supplierDisplayName": "string",
"supplierName": "string",
"status": "APPROVED",
"allocations": [
{
"id": "id",
"invoiceNumber": "string",
"paymentNumber": "string",
"createdAt": "2025-01-15T00:00:00Z",
"amount": 0,
"appliedFromAdvance": true
}
]
}
}
}
deleteInvoice(
id: ID!
): Invoice! @deprecated

Arguments​

deleteInvoice.id ● ID! non-null scalar​

The ID of the invoice.

Type​

Invoice object​

A sales invoice issued to a customer or a purchase invoice received from a supplier, with its lines, totals, status and settlement.