# Exports
> Exports are generated files. Some exports can contain a lot of data, like a CSV of your transactions. Others can be a single document, like a tax form. Since they can take a while, they are generated asynchronously. We send a webhook when they are ready. For more information, please read our [Exports documentation](https://increase.com/documentation/exports).

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

## The Export object
### Example
```json
{
  "account_statement_bai2": null,
  "account_statement_ofx": null,
  "account_verification_letter": null,
  "balance_csv": null,
  "bookkeeping_account_balance_csv": null,
  "category": "transaction_csv",
  "created_at": "2020-01-31T23:59:59Z",
  "daily_account_balance_csv": null,
  "dashboard_table_csv": null,
  "entity_csv": null,
  "fee_csv": null,
  "form_1099_int": null,
  "form_1099_misc": null,
  "funding_instructions": null,
  "id": "export_8s4m48qz3bclzje0zwh9",
  "idempotency_key": null,
  "result": {
    "file_id": "file_makxrc67oh9l6sg7w9yc"
  },
  "status": "complete",
  "transaction_csv": {
    "account_id": "account_in71c4amph0vgo2qllky",
    "created_at": null
  },
  "type": "export",
  "vendor_csv": null,
  "voided_check": null
}
```
### Attributes
- `account_statement_bai2` (dictionary, nullable)
  Details of the account statement BAI2 export. This field will be present when the `category` is equal to `account_statement_bai2`.

  - `account_statement_bai2.account_id` (string, nullable)
    Filter results by Account.

  - `account_statement_bai2.effective_date` (string, nullable)
    The date for which to retrieve the balance.

  - `account_statement_bai2.program_id` (string, nullable)
    Filter results by Program.

- `account_statement_ofx` (dictionary, nullable)
  Details of the account statement OFX export. This field will be present when the `category` is equal to `account_statement_ofx`.

  - `account_statement_ofx.account_id` (string)
    The Account to create a statement for.

  - `account_statement_ofx.created_at` (dictionary, nullable)
    Filter transactions by their created date.

      - `account_statement_ofx.created_at.before` (string, nullable)
        Filter results to transactions created before this time.

      - `account_statement_ofx.created_at.on_or_after` (string, nullable)
        Filter results to transactions created on or after this time.

- `account_verification_letter` (dictionary, nullable)
  Details of the account verification letter export. This field will be present when the `category` is equal to `account_verification_letter`.

  - `account_verification_letter.account_number_id` (string)
    The Account Number to create a letter for.

  - `account_verification_letter.balance_date` (string, nullable)
    The date of the balance to include in the letter.

- `balance_csv` (dictionary, nullable)
  Details of the balance CSV export. This field will be present when the `category` is equal to `balance_csv`.

  - `balance_csv.account_id` (string, nullable)
    Filter results by Account.

  - `balance_csv.created_at` (dictionary, nullable)
    Filter balances by their created date.

      - `balance_csv.created_at.after` (string, nullable)
        Filter balances created after this time.

      - `balance_csv.created_at.before` (string, nullable)
        Filter balances created before this time.

- `bookkeeping_account_balance_csv` (dictionary, nullable)
  Details of the bookkeeping account balance CSV export. This field will be present when the `category` is equal to `bookkeeping_account_balance_csv`.

  - `bookkeeping_account_balance_csv.bookkeeping_account_id` (string, nullable)
    Filter results by Bookkeeping Account.

  - `bookkeeping_account_balance_csv.on_or_after_date` (string, nullable)
    Filter balances to those on or after this date.

  - `bookkeeping_account_balance_csv.on_or_before_date` (string, nullable)
    Filter balances to those on or before this date.

- `category` (enum)
  The category of the Export. We may add additional possible values for this enum over time; your application should be able to handle that gracefully.
  Cases:
  * `account_statement_ofx` (Export an Open Financial Exchange (OFX) file of transactions and balances for a given time range and Account.)
  * `account_statement_bai2` (Export a BAI2 file of transactions and balances for a given date and optional Account.)
  * `transaction_csv` (Export a CSV of all transactions for a given time range.)
  * `balance_csv` (Export a CSV of account balances for the dates in a given range.)
  * `bookkeeping_account_balance_csv` (Export a CSV of bookkeeping account balances for the dates in a given range.)
  * `entity_csv` (Export a CSV of entities with a given status.)
  * `vendor_csv` (Export a CSV of vendors added to the third-party risk management dashboard.)
  * `dashboard_table_csv` (Certain dashboard tables are available as CSV exports. This export cannot be created via the API.)
  * `account_verification_letter` (A PDF of an account verification letter.)
  * `funding_instructions` (A PDF of funding instructions.)
  * `form_1099_int` (A PDF of an Internal Revenue Service Form 1099-INT.)
  * `form_1099_misc` (A PDF of an Internal Revenue Service Form 1099-MISC.)
  * `fee_csv` (Export a CSV of fees. The time range must not include any fees that are part of an open fee statement.)
  * `voided_check` (A PDF of a voided check.)
  * `daily_account_balance_csv` (Export a CSV of daily account balances with starting and ending balances for a given date range.)

- `created_at` (string)
  The time the Export was created.

- `daily_account_balance_csv` (dictionary, nullable)
  Details of the daily account balance CSV export. This field will be present when the `category` is equal to `daily_account_balance_csv`.

  - `daily_account_balance_csv.account_id` (string, nullable)
    Filter results by Account.

  - `daily_account_balance_csv.on_or_after_date` (string, nullable)
    Filter balances on or after this date.

  - `daily_account_balance_csv.on_or_before_date` (string, nullable)
    Filter balances on or before this date.

- `dashboard_table_csv` (dictionary, nullable)
  Details of the dashboard table CSV export. This field will be present when the `category` is equal to `dashboard_table_csv`.

- `entity_csv` (dictionary, nullable)
  Details of the entity CSV export. This field will be present when the `category` is equal to `entity_csv`.

- `fee_csv` (dictionary, nullable)
  Details of the fee CSV export. This field will be present when the `category` is equal to `fee_csv`.

  - `fee_csv.created_at` (dictionary, nullable)
    Filter fees by their created date. The time range must not include any fees that are part of an open fee statement.

      - `fee_csv.created_at.after` (string, nullable)
        Filter fees created after this time.

      - `fee_csv.created_at.before` (string, nullable)
        Filter fees created before this time.

- `form_1099_int` (dictionary, nullable)
  Details of the Form 1099-INT export. This field will be present when the `category` is equal to `form_1099_int`.

  - `form_1099_int.account_id` (string)
    The Account the tax form is for.

  - `form_1099_int.corrected` (boolean)
    Whether the tax form is a corrected form.

  - `form_1099_int.description` (string)
    A description of the tax form.

  - `form_1099_int.year` (integer)
    The tax year for the tax form.

- `form_1099_misc` (dictionary, nullable)
  Details of the Form 1099-MISC export. This field will be present when the `category` is equal to `form_1099_misc`.

  - `form_1099_misc.account_id` (string)
    The Account the tax form is for.

  - `form_1099_misc.corrected` (boolean)
    Whether the tax form is a corrected form.

  - `form_1099_misc.year` (integer)
    The tax year for the tax form.

- `funding_instructions` (dictionary, nullable)
  Details of the funding instructions export. This field will be present when the `category` is equal to `funding_instructions`.

  - `funding_instructions.account_number_id` (string)
    The Account Number to create funding instructions for.

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

- `result` (dictionary, nullable)
  The result of the Export. This will be present when the Export's status transitions to `complete`.

  - `result.file_id` (string)
    The File containing the contents of the Export.

- `status` (enum)
  The status of the Export.
  Cases:
  * `pending` (Increase is generating the export.)
  * `complete` (The export has been successfully generated.)
  * `failed` (The export failed to generate. Increase will reach out to you to resolve the issue.)

- `transaction_csv` (dictionary, nullable)
  Details of the transaction CSV export. This field will be present when the `category` is equal to `transaction_csv`.

  - `transaction_csv.account_id` (string, nullable)
    Filter results by Account.

  - `transaction_csv.created_at` (dictionary, nullable)
    Filter transactions by their created date.

      - `transaction_csv.created_at.after` (string, nullable)
        Filter transactions created after this time.

      - `transaction_csv.created_at.before` (string, nullable)
        Filter transactions created before this time.

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

- `vendor_csv` (dictionary, nullable)
  Details of the vendor CSV export. This field will be present when the `category` is equal to `vendor_csv`.

- `voided_check` (dictionary, nullable)
  Details of the voided check export. This field will be present when the `category` is equal to `voided_check`.

  - `voided_check.account_number_id` (string)
    The Account Number for the voided check.

  - `voided_check.payer` (array of objects)
    The payer information printed on the check.

      - `voided_check.payer.line` (string)
        The contents of the line.

## List Exports
GET /exports

### Example
```curl
curl \
  --url "${INCREASE_URL}/exports" \
  -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.

- `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.

- `category` (enum, optional)
  Filter Exports for those with the specified category.
  Cases:
  * `account_statement_ofx` (Export an Open Financial Exchange (OFX) file of transactions and balances for a given time range and Account.)
  * `account_statement_bai2` (Export a BAI2 file of transactions and balances for a given date and optional Account.)
  * `transaction_csv` (Export a CSV of all transactions for a given time range.)
  * `balance_csv` (Export a CSV of account balances for the dates in a given range.)
  * `bookkeeping_account_balance_csv` (Export a CSV of bookkeeping account balances for the dates in a given range.)
  * `entity_csv` (Export a CSV of entities with a given status.)
  * `vendor_csv` (Export a CSV of vendors added to the third-party risk management dashboard.)
  * `dashboard_table_csv` (Certain dashboard tables are available as CSV exports. This export cannot be created via the API.)
  * `account_verification_letter` (A PDF of an account verification letter.)
  * `funding_instructions` (A PDF of funding instructions.)
  * `form_1099_int` (A PDF of an Internal Revenue Service Form 1099-INT.)
  * `form_1099_misc` (A PDF of an Internal Revenue Service Form 1099-MISC.)
  * `fee_csv` (Export a CSV of fees. The time range must not include any fees that are part of an open fee statement.)
  * `voided_check` (A PDF of a voided check.)
  * `daily_account_balance_csv` (Export a CSV of daily account balances with starting and ending balances for a given date range.)

- `status.in` (array of enums, optional)
  Filter Exports 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:
  * `pending` (Increase is generating the export.)
  * `complete` (The export has been successfully generated.)
  * `failed` (The export failed to generate. Increase will reach out to you to resolve the issue.)

- `form_1099_int.account_id` (string, optional)
  Filter Form 1099-INT Exports to those for the specified Account.

- `form_1099_misc.account_id` (string, optional)
  Filter Form 1099-MISC Exports to those for the specified Account.

- `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 Export List object:
```json
{
  "data": [
    {
      "account_statement_bai2": null,
      "account_statement_ofx": null,
      "account_verification_letter": null,
      "balance_csv": null,
      "bookkeeping_account_balance_csv": null,
      "category": "transaction_csv",
      "created_at": "2020-01-31T23:59:59Z",
      "daily_account_balance_csv": null,
      "dashboard_table_csv": null,
      "entity_csv": null,
      "fee_csv": null,
      "form_1099_int": null,
      "form_1099_misc": null,
      "funding_instructions": null,
      "id": "export_8s4m48qz3bclzje0zwh9",
      "idempotency_key": null,
      "result": {
        "file_id": "file_makxrc67oh9l6sg7w9yc"
      },
      "status": "complete",
      "transaction_csv": {
        "account_id": "account_in71c4amph0vgo2qllky",
        "created_at": null
      },
      "type": "export",
      "vendor_csv": null,
      "voided_check": null
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Create an Export
POST /exports

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/exports" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "category": "transaction_csv",
    "transaction_csv": {
      "account_id": "account_in71c4amph0vgo2qllky"
    }
  }'
```

### Body Parameters
- `account_statement_bai2` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `account_statement_bai2`.

  - `account_statement_bai2.account_id` (string, optional)
    The Account to create a BAI2 report for. If not provided, all open accounts will be included.

  - `account_statement_bai2.effective_date` (string, optional)
    The date to create a BAI2 report for. If not provided, the current date will be used. The timezone is UTC. If the current date is used, the report will include intraday balances, otherwise it will include end-of-day balances for the provided date.

  - `account_statement_bai2.program_id` (string, optional)
    The Program to create a BAI2 report for. If not provided, all open accounts will be included.

- `account_statement_ofx` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `account_statement_ofx`.

  - `account_statement_ofx.account_id` (string, required)
    The Account to create a statement for.

  - `account_statement_ofx.created_at` (dictionary, optional)
    Filter transactions by their created date.

      - `account_statement_ofx.created_at.before` (string, optional)
        Filter results to transactions created before this time.

      - `account_statement_ofx.created_at.on_or_after` (string, optional)
        Filter results to transactions created on or after this time.

- `account_verification_letter` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `account_verification_letter`.

  - `account_verification_letter.account_number_id` (string, required)
    The Account Number to create a letter for.

  - `account_verification_letter.balance_date` (string, optional)
    The date of the balance to include in the letter. Defaults to the current date.

- `bookkeeping_account_balance_csv` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `bookkeeping_account_balance_csv`.

  - `bookkeeping_account_balance_csv.bookkeeping_account_id` (string, optional)
    Filter exported Bookkeeping Account Balances to the specified Bookkeeping Account.

  - `bookkeeping_account_balance_csv.on_or_after_date` (string, optional)
    Filter exported Balances to those on or after this date.

  - `bookkeeping_account_balance_csv.on_or_before_date` (string, optional)
    Filter exported Balances to those on or before this date.

- `category` (enum, required)
  The type of Export to create.
  Cases:
  * `account_statement_ofx` (Export an Open Financial Exchange (OFX) file of transactions and balances for a given time range and Account.)
  * `account_statement_bai2` (Export a BAI2 file of transactions and balances for a given date and optional Account.)
  * `transaction_csv` (Export a CSV of all transactions for a given time range.)
  * `balance_csv` (Export a CSV of account balances for the dates in a given range.)
  * `bookkeeping_account_balance_csv` (Export a CSV of bookkeeping account balances for the dates in a given range.)
  * `entity_csv` (Export a CSV of entities with a given status.)
  * `vendor_csv` (Export a CSV of vendors added to the third-party risk management dashboard.)
  * `account_verification_letter` (A PDF of an account verification letter.)
  * `funding_instructions` (A PDF of funding instructions.)
  * `voided_check` (A PDF of a voided check.)
  * `daily_account_balance_csv` (Export a CSV of daily account balances with starting and ending balances for a given date range.)

- `daily_account_balance_csv` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `daily_account_balance_csv`.

  - `daily_account_balance_csv.account_id` (string, optional)
    Filter exported Balances to the specified Account.

  - `daily_account_balance_csv.on_or_after_date` (string, optional)
    Filter exported Balances to those on or after this date.

  - `daily_account_balance_csv.on_or_before_date` (string, optional)
    Filter exported Balances to those on or before this date.

- `entity_csv` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `entity_csv`.

- `funding_instructions` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `funding_instructions`.

  - `funding_instructions.account_number_id` (string, required)
    The Account Number to create funding instructions for.

- `transaction_csv` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `transaction_csv`.

  - `transaction_csv.account_id` (string, optional)
    Filter exported Transactions to the specified Account.

  - `transaction_csv.created_at` (dictionary, optional)
    Filter results by time range on the `created_at` attribute.

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

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

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

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

- `vendor_csv` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `vendor_csv`.

- `voided_check` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `voided_check`.

  - `voided_check.account_number_id` (string, required)
    The Account Number for the voided check.

  - `voided_check.payer` (array of objects, optional)
    The payer information to be printed on the check.

      - `voided_check.payer.line` (string, required)
        The contents of the line.

## Retrieve an Export
GET /exports/{export_id}

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

## Sandbox: Generate a Tax Form Export
POST /simulations/exports
> Many exports are created by you via POST /exports or in the Dashboard. Some exports are created automatically by Increase. For example, tax documents are published once a year. In sandbox, you can trigger the arrival of an export that would normally only be created automatically via this simulation.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/simulations/exports" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "category": "form_1099_int",
    "form_1099_int": {
      "account_id": "account_in71c4amph0vgo2qllky"
    }
  }'
```

### Body Parameters
- `category` (enum, required)
  The type of Export to create.
  Cases:
  * `form_1099_int` (A PDF of an Internal Revenue Service Form 1099-INT.)

- `form_1099_int` (dictionary, optional)
  Options for the created export. Required if `category` is equal to `form_1099_int`.

  - `form_1099_int.account_id` (string, required)
    The identifier of the Account the tax document is for.