Delete counterparty bank account (soft delete)
Handler: DeleteBankAccount → DeleteBankAccountSrv. Soft-deletes: sets active=false and keeps the row (preserved for transfer history); the cp_accounts link row is NOT removed. Deleting (deactivating) a bank account that is already inactive requires the caller to hold the Internal role; otherwise the row is treated as not found and returns 404 Not Found. This check is enforced atomically inside the transaction via a row lock (SELECT ... FOR UPDATE). Returns 204 on success.
Authorization
bearerAuth In: header
Path Parameters
Counterparty bank account ID.
id path parameter
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/v1/counterparties/bank-accounts/string"{
"status": 400,
"message": "Invalid input"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 403,
"message": "Forbidden"
}{
"status": 404,
"message": "Not found"
}{
"status": 500,
"message": "server_error"
}Returns one bank account (in the recipients.bank_accounts table, exposed under the counterparties bank-accounts API) if the caller has record read access. An inactive bank account (active=false) is hidden from callers without the Internal RBAC role — the endpoint returns 404 Not Found as if the record did not exist. Callers holding the Internal role can retrieve inactive bank accounts.
Creates a recipient-backed bank account linked to an existing counterparty. Parent counterparty update access is required.