# PostAccountExternalAccounts

From **Stripe API**.

`POST /v1/account/external_accounts`

<p>Create an external account for a given account.</p>

## Request body

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

- Type: `object`

```json
{"additionalProperties":false,"properties":{"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"},"account_type":{"enum":["checking","futsu","savings","toza"],"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":"external_account_payout_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."},"default_for_currency":{"description":"When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency.","type":"boolean"},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"external_account":{"description":"Please refer to full [documentation](https://stripe.com/docs/api) instead.","maxLength":5000,"type":"string","x-stripeBypassValidation":true},"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"}},"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/bank_account"},{"$ref":"#/components/schemas/card"}],"title":"Polymorphic","x-resourceId":"external_account","x-stripeBypassValidation":true}
```

### `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/account/external_accounts \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "bank_account": "string",
  "default_for_currency": true,
  "expand": [
    "string"
  ],
  "external_account": "string",
  "metadata": {}
}'
```
