# Accounts
> Accounts are your bank accounts with Increase. They store money, receive transfers, and send payments. They earn interest and have depository insurance.

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

## The Account object
### Example
```json
{
  "account_revenue_rate": null,
  "bank": "first_internet_bank",
  "closed_at": null,
  "created_at": "2020-01-31T23:59:59Z",
  "currency": "USD",
  "entity_id": "entity_n8y8tnk2p9339ti393yi",
  "funding": "deposits",
  "id": "account_in71c4amph0vgo2qllky",
  "idempotency_key": null,
  "informational_entity_id": null,
  "interest_rate": "0.055",
  "loan": null,
  "name": "My first account!",
  "program_id": "program_i2v2os4mwza1oetokh9i",
  "status": "open",
  "type": "account"
}
```
### Attributes
- `account_revenue_rate` (string, nullable)
  The account revenue rate currently being earned on the account, as a string containing a decimal number. For example, a 1% account revenue rate would be represented as "0.01". Account revenue is a type of non-interest income accrued on the account.

- `bank` (enum)
  The bank the Account is with.
  Cases:
  * `core_bank` (Core Bank)
  * `first_internet_bank` (First Internet Bank of Indiana)
  * `grasshopper_bank` (Grasshopper Bank)

- `closed_at` (string, nullable)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Account was closed.

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

- `currency` (enum)
  The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Account currency.
  Cases:
  * `USD` (US Dollar (USD))

- `entity_id` (string)
  The identifier for the Entity the Account belongs to.

- `funding` (enum)
  Whether the Account is funded by a loan or by deposits.
  Cases:
  * `loan` (An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program.)
  * `deposits` (An account funded by deposits.)

- `id` (string)
  The Account 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).

- `informational_entity_id` (string, nullable)
  The identifier of an Entity that, while not owning the Account, is associated with its activity.

- `interest_rate` (string)
  The interest rate currently being earned on the account, as a string containing a decimal number. For example, a 1% interest rate would be represented as "0.01".

- `loan` (dictionary, nullable)
  The Account's loan-related information, if the Account is a loan account.

  - `loan.credit_limit` (integer)
    The maximum amount of money that can be borrowed on the Account.

  - `loan.grace_period_days` (integer)
    The number of days after the statement date that the Account can be past due before being considered delinquent.

  - `loan.maturity_date` (string, nullable)
    The date on which the loan matures.

  - `loan.statement_day_of_month` (integer)
    The day of the month on which the loan statement is generated.

  - `loan.statement_payment_type` (enum)
    The type of payment for the loan.
    Cases:
    * `balance` (The borrower must pay the full balance of the loan at the end of the statement period.)
    * `interest_until_maturity` (The borrower must pay the accrued interest at the end of the statement period.)

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

- `program_id` (string)
  The identifier of the Program determining the compliance and commercial terms of this Account.

- `status` (enum)
  The status of the Account.
  Cases:
  * `closed` (Closed Accounts on which no new activity can occur.)
  * `open` (Open Accounts that are ready to use.)

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

## List Accounts
GET /accounts

### Example
```curl
curl \
  --url "${INCREASE_URL}/accounts?entity_id=entity_n8y8tnk2p9339ti393yi" \
  -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.

- `entity_id` (string, optional)
  Filter Accounts for those belonging to the specified Entity.

- `informational_entity_id` (string, optional)
  Filter Accounts for those belonging to the specified Entity as informational.

- `program_id` (string, optional)
  Filter Accounts for those in a specific Program.

- `status.in` (array of enums, optional)
  Filter Accounts for those with the specified status. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `closed` (Closed Accounts on which no new activity can occur.)
  * `open` (Open Accounts that are ready to use.)

- `created_at.after` (string, optional)
  Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.before` (string, optional)
  Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_after` (string, optional)
  Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_before` (string, optional)
  Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `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 Account List object:
```json
{
  "data": [
    {
      "account_revenue_rate": null,
      "bank": "first_internet_bank",
      "closed_at": null,
      "created_at": "2020-01-31T23:59:59Z",
      "currency": "USD",
      "entity_id": "entity_n8y8tnk2p9339ti393yi",
      "funding": "deposits",
      "id": "account_in71c4amph0vgo2qllky",
      "idempotency_key": null,
      "informational_entity_id": null,
      "interest_rate": "0.055",
      "loan": null,
      "name": "My first account!",
      "program_id": "program_i2v2os4mwza1oetokh9i",
      "status": "open",
      "type": "account"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Create an Account
POST /accounts

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/accounts" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "entity_id": "entity_n8y8tnk2p9339ti393yi",
    "name": "New Account!",
    "program_id": "program_i2v2os4mwza1oetokh9i"
  }'
```

### Body Parameters
- `entity_id` (string, optional)
  The identifier for the Entity that will own the Account.

- `funding` (enum, optional)
  Whether the Account is funded by a loan or by deposits.
  Cases:
  * `loan` (An account funded by a loan. Before opening a loan account, contact support@increase.com to set up a loan program.)
  * `deposits` (An account funded by deposits.)

- `informational_entity_id` (string, optional)
  The identifier of an Entity that, while not owning the Account, is associated with its activity. This is generally the beneficiary of the funds.

- `loan` (dictionary, optional)
  The loan details for the account.

  - `loan.credit_limit` (integer, required)
    The maximum amount of money that can be drawn from the Account.

  - `loan.grace_period_days` (integer, required)
    The number of days after the statement date that the Account can be past due before being considered delinquent.

  - `loan.maturity_date` (string, optional)
    The date on which the loan matures.

  - `loan.statement_day_of_month` (integer, required)
    The day of the month on which the loan statement is generated.

  - `loan.statement_payment_type` (enum, required)
    The type of statement payment for the account.
    Cases:
    * `balance` (The borrower must pay the full balance of the loan at the end of the statement period.)
    * `interest_until_maturity` (The borrower must pay the accrued interest at the end of the statement period.)

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

- `program_id` (string, optional)
  The identifier for the Program that this Account falls under. Required if you operate more than one Program.

## Retrieve an Account
GET /accounts/{account_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/accounts/account_in71c4amph0vgo2qllky" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `account_id` (string, required)
  The identifier of the Account to retrieve.

## Update an Account
PATCH /accounts/{account_id}

### Example
```curl
curl -X "PATCH" \
  --url "${INCREASE_URL}/accounts/account_in71c4amph0vgo2qllky" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "name": "My renamed account"
  }'
```
### Path Parameters
- `account_id` (string, required)
  The identifier of the Account to update.

### Body Parameters
- `loan` (dictionary, optional)
  The loan details for the account.

  - `loan.credit_limit` (integer, required)
    The maximum amount of money that can be drawn from the Account.

- `name` (string, optional)
  The new name of the Account.

## Retrieve an Account Balance
GET /accounts/{account_id}/balance
> Retrieve the current and available balances for an account in minor units of the account's currency. Learn more about [account balances](/documentation/balance).
### Example
```curl
curl \
  --url "${INCREASE_URL}/accounts/account_in71c4amph0vgo2qllky/balance" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `account_id` (string, required)
  The identifier of the Account to retrieve.

### Query Parameters
- `at_time` (string, optional)
  The moment to query the balance at. If not set, returns the current balances.

### Returns a Balance Lookup object:
```json
{
  "account_id": "account_in71c4amph0vgo2qllky",
  "available_balance": 100,
  "current_balance": 100,
  "loan": null,
  "type": "balance_lookup"
}
```

## Close an Account
POST /accounts/{account_id}/close

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/accounts/account_in71c4amph0vgo2qllky/close" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `account_id` (string, required)
  The identifier of the Account to close. The account must have a zero balance.

## Sandbox: Create an interest payment
POST /simulations/interest_payments
> Simulates an interest payment to your account. In production, this happens automatically on the first of each month.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/simulations/interest_payments" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "account_id": "account_in71c4amph0vgo2qllky",
    "amount": 1000
  }'
```

### Body Parameters
- `account_id` (string, required)
  The identifier of the Account the Interest Payment should be paid to is for.

- `accrued_on_account_id` (string, optional)
  The identifier of the Account the Interest accrued on. Defaults to `account_id`.

- `amount` (integer, required)
  The interest amount in cents. Must be positive.

- `period_end` (string, optional)
  The end of the interest period. If not provided, defaults to the current time.

- `period_start` (string, optional)
  The start of the interest period. If not provided, defaults to the current time.

### Returns a Transaction object:
```json
{
  "account_id": "account_in71c4amph0vgo2qllky",
  "amount": 100,
  "created_at": "2020-01-31T23:59:59Z",
  "currency": "USD",
  "description": "INVOICE 2468",
  "id": "transaction_uyrp7fld2ium70oa7oi",
  "route_id": "account_number_v18nkfqm6afpsrvy82b2",
  "route_type": "account_number",
  "source": {
    "category": "interest_payment",
    "interest_payment": {
      "accrued_on_account_id": "account_in71c4amph0vgo2qllky",
      "amount": 100,
      "currency": "USD",
      "period_end": "2025-06-30T23:59:59+00:00",
      "period_start": "2025-06-01T00:00:00+00:00"
    }
  },
  "type": "transaction"
}
```