> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Counterpart bank accounts

> Add and manage bank account details for counterparts to enable invoice payments and transfers.

## Overview

[Counterparts](/finops/guides/common/counterparts/index) that represent an [organization's](/finops/guides/organizations/index) vendors or suppliers can have bank account information associated with them. The bank account information can be used to pay the invoices ([payables](/finops/guides/accounts-payable/payables/collect)) issued by those counterparts.

## Add a bank account to a counterpart

To add a bank account to a counterpart, call [`POST /counterparts/{counterpart_id}/bank-accounts`](/finops/reference/openapi/counterpart-bank-accounts/post-counterparts-id-bank-accounts) and provide the bank account details.

All bank accounts require the `currency` and `country`. For US banks, also provide `account_holder_name`, `account_number`, and `routing_number`. The `bic` field is optional.

Sample request:

```sh lines theme={null}
curl -X POST 'https://api.sandbox.tesouro.com/v1/counterparts/3a9c5...8df/bank-accounts' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "account_number": "2571714302",
       "routing_number": "061000227",
       "account_holder_name": "Bob Jones",
       "name": "Primary account",
       "currency": "USD",
       "country": "US",
       "is_default": true
     }'
```

The successful response returns the `id` assigned to this bank account, along with other details:

```json lines theme={null}
{
  "id": "04476eb4-121e-44dd-8a0d-1bcaa9246265",
  "counterpart_id": "3a9c5924-2c3f-47af-905a-e4c7efe548df",
  "is_default_for_currency": false,
  "partner_metadata": {},
  ...
}
```

## Set the default bank account

Once the bank accounts are added to a counterpart, you can set a default bank account for each currency by making a `POST` request to the `/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}/make-default` endpoint:

```sh lines theme={null}
curl -X POST 'https://api.sandbox.tesouro.com/v1/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}/make-default' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN'
```

The successful response contains information about the counterpart's bank account marked as default:

```json lines theme={null}
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "bic": "ACMEAA33",
  "bank_name": "Bank name",
  "is_default_for_currency": true,
  "display_name": "My main account",
  "was_created_by_user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "account_holder_name": "Bob Jones",
  "account_number": "2571714302",
  "routing_number": "061000227",
  "sort_code": null,
  "currency": "USD",
  "country": "US"
}
```

<Note>
  The default counterpart bank account is set for each currency. Each counterpart can only have one default bank account per currency. The `is_default_for_currency` field indicates which bank accounts are the default for each currency.

  If a new counterpart bank account is added to a currency with no default bank account set, the newly added bank account is automatically set as the default for that currency.
</Note>

## List all bank accounts

To get information about all bank accounts associated with the specified counterpart, call\
[`GET /counterparts/{counterpart_id}/bank-accounts`](/finops/reference/openapi/counterpart-bank-accounts/get-counterparts-id-bank-accounts).

## Retrieve a bank account

To get information about a specific bank account associated with the specified counterpart, call\
[`GET /counterparts/{counterpart_id}/bank-accounts/{bank_account_id}`](/finops/reference/openapi/counterpart-bank-accounts/get-counterparts-id-bank-accounts-id).

## Edit a bank account

To edit an existing bank account of the specified counterpart, call\
[`PATCH /counterparts/{counterpart_id}/bank-accounts/{bank_account_id}`](/finops/reference/openapi/counterpart-bank-accounts/patch-counterparts-id-bank-accounts-id).

## Delete a bank account

To delete an existing bank account from the list of bank accounts associated with the specified counterpart, call\
[`/counterparts/{counterpart_id}/bank-accounts/{bank_account_id}`](/finops/reference/openapi/counterpart-bank-accounts/delete-counterparts-id-bank-accounts-id). Only non-default bank accounts can be deleted.
