Skip to main content

Delete clearing record (logical delete)

DELETE 

/invoices/{invoiceId}/clearingrecords/{recordId}

Deletes an invoice clearing record by logical delete: the record's status is set to deleted. Invoice clearing totals are recalculated.

For CUSTOMER_INVOICE, if the record represents payment, deleting it is applied to billing balance (decreases balance, increases unpaid amount). If that would result in blocked balance (insufficient funds already spent), the API returns 409 CHANGE_PAYMENT_BLOCK_BALANCE. Use query parameter force=yes to force deletion even when it would block balance (balance/account may be blocked for use afterward).

Audit event:

  • invoice.clearing.record.delete

Privilege (one of; checked against invoice class):

  • finance-invoices.manage
  • finance-cust-invoices.manage
  • finance-supplier-invoices.manage
  • finance-netting-invoices.manage

Errors:

  • INVOICE_NOTFOUND - Invoice not found
  • INVOICE_CLEARING_NOTFOUND - Invoice clearing not found
  • INVOICE_CLEARING_RECORD_NOTFOUND - Invoice clearing record not found
  • INVOICE_CLEARING_RECORD_DELETED - Invoice clearing record already deleted
  • INVOICE_CLEARING_RECORD_CANCELED - Invoice clearing record is canceled and can not be deleted
  • NETTING_MEMBER_CLEARING_NOT_ALLOWED - Can not manage clearing records for netting invoice member
  • COLLECTION_MEMBER_CLEARING_RECORD_NOT_ALLOWED - Invoice is collection member.Collection members ar not allowed to have clearing records
  • CHANGE_PAYMENT_BLOCK_BALANCE - After delete of edit payment balance will be blocked because of insufficient funds available
  • CREDIT_RECORD_NOTFOUND - Credit record not found
  • PAYMENT_TRANSFER_FAILED - Payment transfer to billing failed
  • BILLING_RECORD_NOTFOUND - Billing record not found
  • NOT_AUTHORIZED - Not authorized
  • NOT_AUTHENTICATED - Not authenticated
  • INT_APP_ERROR - Unexpected internal error

Request

Responses

Clearing record deleted successfully; returns the record with status "deleted"