Toshl Developer

Create account

Create a new account. Some related data is updated asynchronously.

POST /accounts

Required scope:

Parameters

parent
optional
string

Parent account id.

name *
required
string

Account name.

Max length: 255
type
optional
string

Account type

Possible values: custom, depository, credit_card, loan, mortgage, brokerage, other
initial_balance
optional
number

Account balance.

Minimum: > -1000000000000000
Maximum: < 1000000000000000
Default value: 0
currency *
required
object

Currency object

code *
required
string

Account currency code.

Regex: [A-Z0-9_]{2,10}
rate
optional
number

Account exchange rate calculated according to users currency. If not set (and currency differs from main currency) the daily exchange rate will be used.

Minimum: > 0
main_rate
optional
number

Entry exchange rate main currency calculated according to entry main currency.

fixed
optional
boolean

If set to true, the exchange rate is fixed.

Default value: false
goal
optional
object

If account is a savings goal this includes a savings goal object.

amount *
required
number

Desired amount to save.

Minimum: > 0
Maximum: < 1000000000000000
start *
required
string

Savings goal start date in YYYY-MM-DD format.

Format: date
end *
required
string

Savings goal end date in YYYY-MM-DD format.

Format: date
extra
optional
object

A custom JSON object that you can use to extend Toshl API. Whatever you save into this field you will get back whenever you fetch it later.

* denotes required field/parameter.

Request

$ curl https://api.toshl.com/accounts \
  -H "Authorization: Bearer T9cE5asGnuyYCCqIZFoWjFHvNbvVqHjl" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{json}'

Response

HTTP/1.1 201 Created
Location: https://api.toshl.com/accounts/42