# PostCustomersCustomerBankAccounts

From **Stripe API**.

`POST /v1/customers/{customer}/bank_accounts`

<p>When you create a new credit card, you must specify a customer or recipient on which to create it.</p>

<p>If the card’s owner has no default card, then the new card will become the default.
However, if the owner already has a default, then it will not change.
To change the default, you should <a href="/docs/api#update_customer">update the customer</a> to have a new <code>default_source</code>.</p>

## Parameters

### `customer`

- Location: path
- Required: true
- Type: `string`
- maxLength: `5000`

## Request body

- Required: false
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"alipay_account":{"description":"A token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.","maxLength":5000,"type":"string"},"bank_account":{"anyOf":[{"properties":{"account_holder_name":{"maxLength":5000,"type":"string"},"account_holder_type":{"enum":["company","individual"],"maxLength":5000,"type":"string"},"account_number":{"maxLength":5000,"type":"string"},"country":{"maxLength":5000,"type":"string"},"currency":{"type":"string"},"object":{"enum":["bank_account"],"maxLength":5000,"type":"string"},"routing_number":{"maxLength":5000,"type":"string"}},"required":["account_number","country"],"title":"customer_payment_source_bank_account","type":"object"},{"maxLength":5000,"type":"string"}],"description":"Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details."},"card":{"anyOf":[{"properties":{"address_city":{"maxLength":5000,"type":"string"},"address_country":{"maxLength":5000,"type":"string"},"address_line1":{"maxLength":5000,"type":"string"},"address_line2":{"maxLength":5000,"type":"string"},"address_state":{"maxLength":5000,"type":"string"},"address_zip":{"maxLength":5000,"type":"string"},"cvc":{"maxLength":5000,"type":"string"},"exp_month":{"type":"integer"},"exp_year":{"type":"integer"},"metadata":{"additionalProperties":{"type":"string"},"type":"object"},"name":{"maxLength":5000,"type":"string"},"number":{"maxLength":5000,"type":"string"},"object":{"enum":["card"],"maxLength":5000,"type":"string"}},"required":["exp_month","exp_year","number"],"title":"customer_payment_source_card","type":"object"},{"maxLength":5000,"type":"string"}],"description":"A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).","x-stripeBypassValidation":true},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"metadata":{"additionalProperties":{"type":"string"},"description":"Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.","type":"object"},"source":{"description":"Please refer to full [documentation](https://stripe.com/docs/api) instead.","maxLength":5000,"type":"string","x-stripeBypassValidation":true}},"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

```json
{"anyOf":[{"$ref":"#/components/schemas/account"},{"$ref":"#/components/schemas/alipay_account"},{"$ref":"#/components/schemas/bank_account"},{"$ref":"#/components/schemas/bitcoin_receiver"},{"$ref":"#/components/schemas/card"},{"$ref":"#/components/schemas/source"}],"title":"Polymorphic","x-resourceId":"payment_source"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/customers/{customer}/bank_accounts \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "alipay_account": "string",
  "bank_account": "string",
  "card": "string",
  "expand": [
    "string"
  ],
  "metadata": {},
  "source": "string"
}'
```
