# External Accounts
> External Accounts represent accounts at financial institutions other than Increase. You can use this API to store their details for reuse.

[Events](https://increase.com/documentation/events.md) will be generated for this resource. The possible event categories are: `external_account.created` and `external_account.updated`.

## The External Account object
### Example
```json
{
  "account_holder": "business",
  "account_number": "987654321",
  "created_at": "2020-01-31T23:59:59Z",
  "description": "Landlord",
  "funding": "checking",
  "id": "external_account_ukk55lr923a3ac0pp7iv",
  "idempotency_key": null,
  "routing_number": "101050001",
  "status": "active",
  "type": "external_account"
}
```
### Attributes
- `account_holder` (enum)
  The type of entity that owns the External Account.
  Cases:
  * `business` (The External Account is owned by a business.)
  * `individual` (The External Account is owned by an individual.)
  * `unknown` (It's unknown what kind of entity owns the External Account.)

- `account_number` (string)
  The destination account number.

- `created_at` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the External Account was created.

- `description` (string)
  The External Account's description for display purposes.

- `funding` (enum)
  The type of the account to which the transfer will be sent.
  Cases:
  * `checking` (A checking account.)
  * `savings` (A savings account.)
  * `general_ledger` (A general ledger account.)
  * `other` (A different type of account.)

- `id` (string)
  The External Account's identifier.

- `idempotency_key` (string, nullable)
  The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

- `routing_number` (string)
  The American Bankers' Association (ABA) Routing Transit Number (RTN).

- `status` (enum)
  The External Account's status.
  Cases:
  * `active` (The External Account is active.)
  * `archived` (The External Account is archived and won't appear in the dashboard.)

- `type` (string)
  A constant representing the object's type. For this resource it will always be `external_account`.

## List External Accounts
GET /external_accounts

### Example
```curl
curl \
  --url "${INCREASE_URL}/external_accounts" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```

### Query Parameters
- `cursor` (string, optional)
  Return the page of entries after this one.

- `limit` (integer, optional)
  Limit the size of the list that is returned. The default (and maximum) is 100 objects.

- `status.in` (array of enums, optional)
  Filter External Accounts for those with the specified status or statuses. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `active` (The External Account is active.)
  * `archived` (The External Account is archived and won't appear in the dashboard.)

- `routing_number` (string, optional)
  Filter External Accounts to those with the specified Routing Number.

- `idempotency_key` (string, optional)
  Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

### Returns a External Account List object:
```json
{
  "data": [
    {
      "account_holder": "business",
      "account_number": "987654321",
      "created_at": "2020-01-31T23:59:59Z",
      "description": "Landlord",
      "funding": "checking",
      "id": "external_account_ukk55lr923a3ac0pp7iv",
      "idempotency_key": null,
      "routing_number": "101050001",
      "status": "active",
      "type": "external_account"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Create an External Account
POST /external_accounts

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/external_accounts" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "account_holder": "business",
    "account_number": "987654321",
    "description": "Landlord",
    "routing_number": "101050001"
  }'
```

### Body Parameters
- `account_holder` (enum, optional)
  The type of entity that owns the External Account.
  Cases:
  * `business` (The External Account is owned by a business.)
  * `individual` (The External Account is owned by an individual.)
  * `unknown` (It's unknown what kind of entity owns the External Account.)

- `account_number` (string, required)
  The account number for the destination account.

- `description` (string, required)
  The name you choose for the Account.

- `funding` (enum, optional)
  The type of the destination account. Defaults to `checking`.
  Cases:
  * `checking` (A checking account.)
  * `savings` (A savings account.)
  * `general_ledger` (A general ledger account.)
  * `other` (A different type of account.)

- `routing_number` (string, required)
  The American Bankers' Association (ABA) Routing Transit Number (RTN) for the destination account.

## Retrieve an External Account
GET /external_accounts/{external_account_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/external_accounts/external_account_ukk55lr923a3ac0pp7iv" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `external_account_id` (string, required)
  The identifier of the External Account.

## Update an External Account
PATCH /external_accounts/{external_account_id}

### Example
```curl
curl -X "PATCH" \
  --url "${INCREASE_URL}/external_accounts/external_account_ukk55lr923a3ac0pp7iv" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "description": "New description"
  }'
```
### Path Parameters
- `external_account_id` (string, required)
  The external account identifier.

### Body Parameters
- `account_holder` (enum, optional)
  The type of entity that owns the External Account.
  Cases:
  * `business` (The External Account is owned by a business.)
  * `individual` (The External Account is owned by an individual.)

- `description` (string, optional)
  The description you choose to give the external account.

- `funding` (enum, optional)
  The funding type of the External Account.
  Cases:
  * `checking` (A checking account.)
  * `savings` (A savings account.)
  * `general_ledger` (A general ledger account.)
  * `other` (A different type of account.)

- `status` (enum, optional)
  The status of the External Account.
  Cases:
  * `active` (The External Account is active.)
  * `archived` (The External Account is archived and won't appear in the dashboard.)