Create budget
Create a new budget. Some related data is updated asynchronously.
POST /budgets
Required scope:
- budgets:rw
Parameters
|
name * required string
|
Budget name. Max length:255 |
|
limit * required number
|
Budget limit. If > -1000000000000000Maximum: < 1000000000000000 |
|
currency * required object
|
Currency object |
|
code * required string
|
Budget currency code. Regex:[A-Z0-9_]{2,10} |
|
rate optional number
|
Budget 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 not refreshed on next budget iteration. Default value:false |
|
rollover optional boolean
|
Boolean which determines if rollover is enabled for budget. If rollover is enabled whatever is left of the budget |
|
rollover_override optional boolean
|
Is true if rollover is overriden with a custom amount (can be useful for smart clients). |
|
rollover_amount optional number
|
Budget rollover amount. If client updates this the rollovers from previous months are not transferred anymore. Minimum:> -1000000000000000Maximum: < 1000000000000000Default value: 0 |
|
recurrence optional object
|
Recurrence object. |
|
frequency optional string
|
Budget frequency. Possible values:one-time, daily, weekly, monthly, yearly |
|
interval optional integer
|
Budget interval. Minimum:>= 1Maximum: =< 127 |
|
start optional string
|
Budget start date in date |
|
end optional string
|
Budget end date in date |
|
byday optional string
|
A weekday ( |
|
bymonthday optional string
|
A comma separated list of month days (1-31). Each month day can have a plus(+) or minus(-) prefix. Only one month day can be specified due to the nature of budgets. |
|
bysetpos optional string
|
A comma separater list of the nth occurance within |
|
type * required string
|
Budget type. Possible values:regular, delta, percent |
|
percent optional number
|
Percent of monthly income. If > 0 |
|
delta optional number
|
Used to define monthly budget -/+ delta. If |
|
tags optional array
|
An |
|
!tags optional array
|
An |
|
categories optional array
|
An |
|
!categories optional array
|
An |
|
accounts optional array
|
An |
|
!accounts optional array
|
An |
|
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/budgets \
-H "Authorization: Bearer T9cE5asGnuyYCCqIZFoWjFHvNbvVqHjl" \
-H "Content-Type: application/json" \
-X POST \
-d '{json}'
Response
HTTP/1.1 201 Created
Location: https://api.toshl.com/budgets/42