Skip to main content

Update clearing record (cancel and create new)

PUT 

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

Updates an existing invoice clearing record. The original record is marked as canceled and a new clearing record is created and returned. Invoice clearing totals are recalculated. Canceled records remain in the clearing records list (unlike deleted).

For CUSTOMER_INVOICE, if the record represents payment, the change is applied to billing balance.

Audit event:

  • invoice.clearing.record.update

Privilege (one of; checked against invoice class):

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

clearingTypeId:

  • 2 - Payment
  • 3 - Interest
  • 4 - Reminder

paymentTypeId:

  • 1 - Bank Transfer (bankAccountId required, must be > 0)
  • 2 - Credit Card
  • 3 - Paypal
  • 4 - Cash

Errors:

  • INVOICE_NOTFOUND - Invoice not found
  • 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
  • INVOICE_CLEARING_RECORD_NOTFOUND - Invoice clearing record not found
  • INVOICE_CLEARING_NOTFOUND - Invoice clearing not found
  • INVOICE_CLEARING_RECORD_DELETED - Invoice clearing record already deleted
  • INVOICE_CLEARING_RECORD_CANCELED - Invoice clearing record is canceled and can not be updated
  • 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

Error items:

  • invalid value - clearingTypeId can not be nil
  • invalid value - clearingTypeId can not be 1
  • invalid value - clearingTypeId must be in (2,3,4)
  • invalid value - recordDate can not be nil
  • invalid value - recordDate date invalid
  • invalid value - paymentTypeID can not be nil
  • PAYMENT_TYPE_NOT_FOUND - Payment type not found
  • invalid value - amountIncrement must not be empty or 0 for clearingTypeId 3 or 4
  • invalid value - paidAmount must not be empty or less than 0 for clearingTypeId 2 or 5
  • invalid value - bank account id not provided
  • invalid value - bank account with given id not found
  • invalid value - bank account currency and invoice currency do not match
  • BANK_ACC_NOT_ALLOWED_FOR_PAYMENT_TYPE - Bank acc not allowed for payment type: 'paymentTypeName'

Request

Responses

Clearing record updated; returns the new record (original marked canceled)