# Customer Bank Account

Source: https://docs.gocardless.com/docs/api-reference/customer-bank-account

## Create a customer bank account

`POST /customer_bank_accounts`

Creates a new customer bank account object.

There are three different ways to supply bank account details:

- [Local details](#appendix-local-bank-details)

- IBAN

- [Customer Bank Account Tokens](#javascript-flow-create-a-customer-bank-account-token)

For more information on the different fields required in each country, see [local bank details](#appendix-local-bank-details).

### Request body

Wrap request body attributes in a `customer_bank_accounts` object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account_number` | string | No | Bank account number - see [local details](#appendix-local-bank-details) for more information. Alternatively you can provide an `iban`. |
| `bank_code` | string | No | Bank code - see [local details](#appendix-local-bank-details) for more information. Alternatively you can provide an `iban`. |
| `branch_code` | string | No | Branch code - see [local details](#appendix-local-bank-details) for more information. Alternatively you can provide an `iban`. |
| `iban` | string | No | International Bank Account Number. Alternatively you can provide [local details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts denominated in SEK - you must supply [local details](#local-bank-details-sweden). |
| `country_code` | string | No | [ISO 3166-1 alpha-2 code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). Defaults to the country code of the `iban` if supplied, otherwise is required. |
| `currency` | string | No | [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. |
| `account_holder_name` | string | No | Name of the account holder, as known by the bank. The full name provided when the customer is created is stored and is available via the API, but is transliterated, upcased, and truncated to 18 characters in bank submissions. This field is required unless the request includes a [customer bank account token](#javascript-flow-customer-bank-account-tokens). |
| `account_type` | string | No | Bank account type. Required for USD-denominated bank accounts. Must not be provided for bank accounts in other currencies. See [local details](#local-bank-details-united-states) for more information. |
| `metadata` | object | No | Key-value store of custom data. Up to 3 keys are permitted, with key names up to 50 characters and values up to 500 characters. |
| `links` | object | No |  |

### Responses

| Status | Description |
| --- | --- |
| 201 | Resource created successfully |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |

---

## List customer bank accounts

`GET /customer_bank_accounts`

Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your bank accounts.

### Responses

| Status | Description |
| --- | --- |
| 200 | Successful response |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |

---

## Get a single customer bank account

`GET /customer_bank_accounts/{customer_bank_account_id}`

Retrieves the details of an existing bank account.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `customer_bank_account_id` | path | string | Yes | The customer bank account id |

### Responses

| Status | Description |
| --- | --- |
| 200 | Successful response |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |

---

## Update a customer bank account

`PUT /customer_bank_accounts/{customer_bank_account_id}`

Updates a customer bank account object. Only the metadata parameter is allowed.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `customer_bank_account_id` | path | string | Yes | The customer bank account id |

### Request body

Wrap request body attributes in a `customer_bank_accounts` object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `metadata` | object | No | Key-value store of custom data. Up to 3 keys are permitted, with key names up to 50 characters and values up to 500 characters. |

### Responses

| Status | Description |
| --- | --- |
| 200 | Successful response |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |

---

## Disable a customer bank account

`POST /customer_bank_accounts/{customer_bank_account_id}/actions/disable`

Immediately cancels all associated mandates and cancellable payments.

This will return a `disable_failed` error if the bank account has already been disabled.

A disabled bank account can be re-enabled by creating a new bank account resource with the same details.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `customer_bank_account_id` | path | string | Yes | The customer bank account id |

### Responses

| Status | Description |
| --- | --- |
| 200 | Action completed successfully |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |
