---
title: "Create new account."
method: POST
path: "/v1/accounts"
tags: ["accounts"]
---

# Create new account.

`POST /v1/accounts`

## Request

- Base URL: `https://demo.firefly-iii.org/api`
- URL: `https://demo.firefly-iii.org/api/v1/accounts`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://demo.firefly-iii.org/oauth/authorize`
    - Token URL: `https://demo.firefly-iii.org/oauth/token`
  - HTTP bearer

Creates a new account. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform).

## Headers

- `X-Trace-Id` string, uuid

## Request body

- AccountStore
  - `name` string, string, required
  - `type` 'asset' | 'expense' | 'import' | 'revenue' | 'cash' | 'liability' | 'liabilities' | 'initial-balance' | 'reconciliation', string, required: Can only be one one these account types. import, initial-balance and reconciliation cannot be set manually.
  - `iban` string, iban, nullable
  - `bic` string, string, nullable
  - `account_number` string, string, nullable
  - `opening_balance` string, amount: Represents the opening balance, the initial amount this account holds.
  - `opening_balance_date` string, date-time, nullable: Represents the date of the opening balance.
  - `virtual_balance` string, amount
  - `currency_id` string, string: Use either currency_id or currency_code. Defaults to the user's financial administration's currency.
  - `currency_code` string, string: Use either currency_id or currency_code. Defaults to the user's financial administration's currency.
  - `active` boolean: If omitted, defaults to true.
  - `order` integer: Order of the account
  - `include_net_worth` boolean: If omitted, defaults to true.
  - `account_role` 'defaultAsset' | 'sharedAsset' | 'savingAsset' | 'ccAsset' | 'cashWalletAsset' | 'null', string, nullable: Is only mandatory when the type is asset.
  - `credit_card_type` 'monthlyFull' | 'null', string, nullable: Mandatory when the account_role is ccAsset. Can only be monthlyFull or null.
  - `monthly_payment_date` string, date-time, nullable: Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank.
  - `liability_type` 'loan' | 'debt' | 'mortgage' | 'null', string, nullable: Mandatory when type is liability. Specifies the exact type.
  - `liability_direction` 'credit' | 'debit' | 'null', string, nullable: 'credit' indicates somebody owes you the liability. 'debit' Indicates you owe this debt yourself. Works only for liabilities.
  - `interest` string, string, nullable: Mandatory when type is liability. Interest percentage.
  - `interest_period` 'weekly' | 'monthly' | 'quarterly' | 'half-year' | 'yearly' | 'null', string, nullable: Mandatory when type is liability. Period over which the interest is calculated.
  - `notes` string, string, nullable
  - `latitude` number, double, nullable: Latitude of the accounts's location, if applicable. Can be used to draw a map.
  - `longitude` number, double, nullable: Latitude of the accounts's location, if applicable. Can be used to draw a map.
  - `zoom_level` integer, nullable: Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels.

## Response `200`

New account stored, result in response.

- AccountSingle
  - `data` AccountRead, required
    - `type` string, string, required: Immutable value
    - `id` string, string, required
    - `attributes` AccountProperties, required
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `active` boolean
      - `order` integer, nullable: Order of the account. Is NULL if account is not asset or liability.
      - `name` string, string, required
      - `type` 'asset' | 'expense' | 'import' | 'revenue' | 'cash' | 'liability' | 'liabilities' | 'initial-balance' | 'reconciliation', string, required: Can only be one one these account types. import, initial-balance and reconciliation cannot be set manually.
      - `account_role` 'defaultAsset' | 'sharedAsset' | 'savingAsset' | 'ccAsset' | 'cashWalletAsset' | 'null', string, nullable: Is only mandatory when the type is asset.
      - `object_group_id` string, string, nullable: The group ID of the group this object is part of. NULL if no group.
      - `object_group_order` integer, nullable: The order of the group. At least 1, for the highest sorting.
      - `object_group_title` string, string, nullable: The name of the group. NULL if no group.
      - `object_has_currency_setting` boolean: Indicates whether the account has a currency setting. If false, the account uses the administration's primary currency. Asset accounts and liability accounts always have a currency setting, while expense and revenue accounts do not.
      - `currency_id` string, string: The currency ID of the currency associated with this object.
      - `currency_name` string, string: The currency name of the currency associated with this object.
      - `currency_code` string, string: The currency code of the currency associated with this object.
      - `currency_symbol` string, string
      - `currency_decimal_places` integer
      - `primary_currency_id` string, string: The currency ID of the administration's primary currency.
      - `primary_currency_name` string, string: The currency name of the administration's primary currency.
      - `primary_currency_code` string, string: The currency code of the administration's primary currency.
      - `primary_currency_symbol` string, string: The currency symbol of the administration's primary currency.
      - `primary_currency_decimal_places` integer: The currency decimal places of the administration's primary currency.
      - `current_balance` string, amount: The current balance of the account in the account's currency. If the account has no currency, this is the balance in the administration's primary currency. Either way, the `currency_*` fields reflect the currency used.
      - `pc_current_balance` string, amount, nullable: The current balance of the account in the administration's primary currency. The `primary_currency_*` fields reflect the currency used. This field is NULL if the user does have 'convert to primary' set to true in their settings.
      - `balance_difference` string, amount: If you submit a start AND end date, this will be the difference between those two moments.
      - `pc_balance_difference` string, amount, nullable: If you submit a start AND end date, this will be the difference in the currency of the account or the administration's primary currency between those two moments.
      - `opening_balance` string, amount: Represents the opening balance, the initial amount this account holds in the currency of the account or the administration's primary currency if the account has no currency. Either way, the `currency_*` fields reflect the currency used.
      - `pc_opening_balance` string, amount: The opening balance of the account in the administration's primary currency (pc). The `primary_currency_*` fields reflect the currency used. This field is NULL if the user does have 'convert to primary' set to true in their settings.
      - `virtual_balance` string, amount: The virtual balance of the account in the account's currency or the administration's primary currency if the account has no currency.
      - `pc_virtual_balance` string, amount: The virtual balance of the account in the administration's primary currency (pc). The `primary_currency_*` fields reflect the currency used. This field is NULL if the user does have 'convert to primary' set to true in their settings.
      - `debt_amount` string, amount, nullable: In liability accounts (loans, debts and mortgages), this is the amount of debt in the account's currency (see the `currency_*` fields). In asset accounts, this is NULL.
      - `pc_debt_amount` string, amount, nullable: In liability accounts (loans, debts and mortgages), this is the amount of debt in the administration's primary currency (see the `currency_*` fields. In asset accounts, this is NULL.
      - `current_balance_date` string, date-time: The timestamp for this date is always 23:59:59, to indicate it's the balance at the very END of that particular day.
      - `notes` string, string, nullable
      - `monthly_payment_date` string, date-time, nullable: Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank.
      - `credit_card_type` 'monthlyFull' | 'null', string, nullable: Mandatory when the account_role is ccAsset. Can only be monthlyFull or null.
      - `account_number` string, string, nullable
      - `iban` string, iban, nullable
      - `bic` string, string, nullable
      - `opening_balance_date` string, date-time, nullable: Represents the date of the opening balance.
      - `liability_type` 'loan' | 'debt' | 'mortgage' | 'null', string, nullable: Mandatory when type is liability. Specifies the exact type.
      - `liability_direction` 'credit' | 'debit' | 'null', string, nullable: 'credit' indicates somebody owes you the liability. 'debit' Indicates you owe this debt yourself. Works only for liabilities.
      - `interest` string, string, nullable: Mandatory when type is liability. Interest percentage.
      - `interest_period` 'weekly' | 'monthly' | 'quarterly' | 'half-year' | 'yearly' | 'null', string, nullable: Mandatory when type is liability. Period over which the interest is calculated.
      - `include_net_worth` boolean
      - `longitude` number, double, nullable: Latitude of the accounts's location, if applicable. Can be used to draw a map.
      - `latitude` number, double, nullable: Latitude of the accounts's location, if applicable. Can be used to draw a map.
      - `zoom_level` integer, nullable: Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels.
      - `last_activity` string, date-time, nullable: Last activity of the account.

## Other responses

- `400`: Bad request
- `401`: Unauthenticated
- `404`: Page not found
- `422`: Validation error. The body will have the exact details.
- `500`: Internal exception

---

[API](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-4-8.md) - [All operations](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-4-8/llms.txt) - [OpenAPI document](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-4-8/revisions/bf6c71da53e3?raw)
