Toshl Developer

Create account

Create a new account.

Some related data is updated asynchronously. Clients can set an additional GET parameter immediate_update which dictates that those values should be updated immediately in current request. Such a request may take longer to complete.

POST /accounts

Required scope:

Parameters

parent
optional
string

Parent account id.

name
required
string

Account name.

Max length: 255
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-Z]{3}
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
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.

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