# Account Statements
> Account Statements are generated monthly for every active Account. You can access the statement's data via the API or retrieve a PDF with its details via its associated File.

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

## The Account Statement object
### Example
```json
{
  "account_id": "account_in71c4amph0vgo2qllky",
  "created_at": "2020-01-31T23:59:59Z",
  "ending_balance": 100,
  "file_id": "file_makxrc67oh9l6sg7w9yc",
  "id": "account_statement_lkc03a4skm2k7f38vj15",
  "loan": null,
  "starting_balance": 0,
  "statement_period_end": "2020-01-31T23:59:59Z",
  "statement_period_start": "2020-01-31T23:59:59Z",
  "type": "account_statement"
}
```
### Attributes
- `account_id` (string)
  The identifier for the Account this Account Statement belongs to.

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

- `ending_balance` (integer)
  The Account's balance at the end of its statement period.

- `file_id` (string)
  The identifier of the File containing a PDF of the statement.

- `id` (string)
  The Account Statement identifier.

- `loan` (dictionary, nullable)
  The loan balances.

  - `loan.due_at` (string, nullable)
    The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the loan payment is due.

  - `loan.due_balance` (integer)
    The total amount due on the loan.

  - `loan.past_due_balance` (integer)
    The amount past due on the loan.

- `starting_balance` (integer)
  The Account's balance at the start of its statement period.

- `statement_period_end` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end of the period the Account Statement covers.

- `statement_period_start` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the start of the period the Account Statement covers.

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

## List Account Statements
GET /account_statements

### Example
```curl
curl \
  --url "${INCREASE_URL}/account_statements?account_id=account_in71c4amph0vgo2qllky" \
  -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.

- `account_id` (string, optional)
  Filter Account Statements to those belonging to the specified Account.

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

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

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

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

### Returns a Account Statement List object:
```json
{
  "data": [
    {
      "account_id": "account_in71c4amph0vgo2qllky",
      "created_at": "2020-01-31T23:59:59Z",
      "ending_balance": 100,
      "file_id": "file_makxrc67oh9l6sg7w9yc",
      "id": "account_statement_lkc03a4skm2k7f38vj15",
      "loan": null,
      "starting_balance": 0,
      "statement_period_end": "2020-01-31T23:59:59Z",
      "statement_period_start": "2020-01-31T23:59:59Z",
      "type": "account_statement"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Retrieve an Account Statement
GET /account_statements/{account_statement_id}

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

## Sandbox: Create an Account Statement
POST /simulations/account_statements
> Simulates an [Account Statement](#account-statements) being created for an account. In production, Account Statements are generated once per month.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/simulations/account_statements" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "account_id": "account_in71c4amph0vgo2qllky"
  }'
```

### Body Parameters
- `account_id` (string, required)
  The identifier of the Account the statement is for.