Get counterparty bank account by ID
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.
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
application/json
curl -X GET "https://example.com/v1/counterparties/bank-accounts/string"{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"recipient_id": "b6731cb5-d462-49ea-afb8-7933b670b560",
"cp_account_id": "eb064395-4075-439f-a7b1-d660c0883425",
"iban": "string",
"bic": "string",
"bank": "string",
"intermediate_bic": "string",
"intermediate_bank": "string",
"intermediate_route": "string",
"is_primary": true,
"is_validated": true,
"active": true,
"created_at": "2019-08-24T14:15:22Z",
"created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
"modified_at": "2019-08-24T14:15:22Z",
"modified_by": "e8d4374d-93a1-4e98-a6c6-fdcf00c5059f",
"metadata": {},
"products_allowed": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"code": "string",
"name": "string",
"description": "string",
"type": "string",
"route": "string",
"icon": "string"
}
],
"counterparty_id": "fd38dae9-b300-4017-a630-101c4279eafd"
}{
"status": 400,
"message": "Invalid input"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 403,
"message": "Forbidden"
}{
"status": 404,
"message": "Not found"
}{
"status": 500,
"message": "server_error"
}Returns standalone counterparty bank accounts visible to the requesting user in the standard Corebanq getAll response shape.
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.