Toshl Developer

Create entry

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

POST /entries

Required scope:

Parameters

amount *
required
number

Entry amount

Minimum: > -1000000000000000
Maximum: < 1000000000000000
currency *
required
object

Currency object

code *
required
string

Entry currency code.

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

Entry exchange rate calculated according to entry account currency.

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
date *
required
string

Entry purchase date in YYYY-MM-DD format.

Format: date
desc
optional
string

Entry description.

Max length: 255
account *
required
string

Entry account id.

category *
required
string

Entry category id.

tags
optional
array

An array of tag ids.

location
optional
object

Entry location object.

id
optional
string

Location id. This is the internal Toshl id, not the Foursquare venue id. Not set if user did not select a location.

venue_id
optional
string

Foursquare venue id. Not set if user did not select a location.

latitude *
required
number

Location latitude.

longitude *
required
number

Location longitude.

repeat
optional
object

A repeat object.

id
optional
string

Repeat id.

start *
required
date

Repeat start date.

end
optional
date

Repeat end date. If end date is not specified the end parameter is omitted. count can be specified instead of end.

frequency *
required
string

Repeat frequency.

Possible values: daily, weekly, monthly, yearly
interval *
required
integer

Repeat interval. For example: repeating every two months -> frequency: monthly, interval: 2.

Minimum: >= 1
Maximum: =< 127
count
optional
integer

How many times to repeat entry.

Minimum: >= 1
byday
optional
string

A comma separated list of weekdays (MO,TU..). Each weekday can have be preceded by a positive or negative number (1MO - 1st monday of the month/year, -1MO - last monday of the month/year).

bymonthday
optional
string

A comma separated list of month days (1-31). Each month day can have a plus(+) or minus(-) prefix.

bysetpos
optional
string

A comma separater list of the nth occurance within bymonthday. If you wish to set a repeat to occur on the last day of the month, set frequency to monthly, bymonthday to 28,29,30,31 and bysetpos to -1.

iteration
optional
number

Repeat iteration number. First entry in the repeat has iteration=0.

Minimum: >= 0
transaction
optional
object

A transaction object.

id
optional
string

Companion entry id.

account *
required
string

Companion entry account.

currency *
required
object

Companion entry currency object

code *
required
string

Entry currency code.

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

Entry exchange rate calculated according to entry account currency.

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
images
optional
array

List of entry images. Each entry can have up to 4 images.

Maximum items: 4
id
optional
string

Image id.

reminders
optional
array

List of entry reminders. Each entry can have up to 5 reminder.

Maximum items: 5
period
optional
string

Reminder period

Possible values: day, week, month, year
number
optional
integer

The number of periods before entry date -> 2 weeks before date: period = week, number = 2

Minimum: >= 0
Maximum: =< 255
at
optional
string

Time of day for the reminder to fire in HH:mm:ss format.

Format: time
split
optional
object

If entry was created by splitting up another, this object is returned.

parent *
required
string

Link to parent that was used to create this split entry.

completed
optional
boolean

If an entry has a reminder, this field indicates if the bill has been paid or not. Once it has reminders for this entry no longer fire.

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/entries \
  -H "Authorization: Bearer T9cE5asGnuyYCCqIZFoWjFHvNbvVqHjl" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{json}'

Response

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