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
Base URL
https://api-cpaas.sms.es/finance/sit/v1
Authentication

OAuth2 — send Authorization: Bearer <access_token>. Token URL: https://accounts-cpaas.sms.es/oauth2/access-token

Request

Path parameters

invoiceIdintegerrequired

Invoice ID

recordIdintegerrequired

Invoice clearing record ID to delete

Query parameters

forcestring

If "yes", force delete payment for customer invoices even if the operation would lead to customer balance blocking.

Possible values: yes, no · Default: "no"

Request example

cURL · cURL
curl -L -X DELETE "https://api-cpaas.sms.es/finance/sit/v1/invoices/{invoiceId}/clearingrecords/{recordId}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>"

Responses

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

application/json
amountIncrementnumber (float)
bankAccountIbanstring
bankAccountIdinteger
bankAccountNamestring
bankAccountNumberstring
bankAccountSwiftBicstring
clearingIdinteger
clearingTypeCodeNamestring
clearingTypeIdinteger
commentstring
idinteger
paidAmountnumber (float)
paymentReferencestring
paymentTypeIdinteger
paymentTypeNamestring
recordDatestring (date)
revokeCommentstring
revokeUserIdstring
revokeUserNamestring
statusstring

active or canceled

statusDatestring | null (date-time)
Example response
{
  "amountIncrement": 0,
  "bankAccountIban": "CH9300762011623852957",
  "bankAccountId": 1,
  "bankAccountName": "Main account",
  "bankAccountNumber": "123456",
  "bankAccountSwiftBic": "CRESCHZZ",
  "clearingId": 100,
  "clearingTypeCodeName": "PAYMENT",
  "clearingTypeId": 2,
  "comment": "Bank transfer",
  "id": 1,
  "paidAmount": 100.5,
  "paymentReference": "REF-001",
  "paymentTypeId": 1,
  "paymentTypeName": "Bank transfer",
  "recordDate": "2026-01-15",
  "revokeComment": "",
  "revokeUserId": "",
  "revokeUserName": "",
  "status": "deleted",
  "statusDate": "2026-01-22T10:00:00.000Z"
}