Toshl Developer

Update entry

Update an entry. Some related data is updated asynchronously. If entry is part of a repeat clients can set an additional GET parameter update which dictates which entries in the repeat to update. Possible values are:

all Updates all entries in the repeat.
one Updates only the sent entry.
tail Updates the sent entry and all following.

If update parameter is not specified the default value is all.

Note: When using the update parameter, all changes made on the entries will be lost.

If entry is part of a repeat clients can set an additional GET parameters delete_after_date or delete_after_count which dictates that entries in the repeat after specified date or specified count will be deleted.

PUT /entries/{id}

Required scope:

Parameters

id *
required
string

Entry id.

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 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.

modified *
required
string

Specifies when the entry was last modified.

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.

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
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/42?update=all \
  -H "Authorization: Bearer T9cE5asGnuyYCCqIZFoWjFHvNbvVqHjl" \
  -H "Content-Type: application/json" \
  -X PUT \
  -d '{json}'

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "42",
  "amount": -13.37,
  "currency": {
    "code": "USD",
    "rate": 1,
    "fixed": false
  },
  "date": "2012-09-04",
  "desc": "Entry description",
  "account": "45",
  "category": "42",
  "tags": ["42", "43"],
  "location": {
    "id": "44",
    "latitude": 46.051426,
    "longitude": 14.505966
  },
  "modified": "2012-09-04T13:55:15Z",
  "repeat": {
    "id": "41",
    "frequency": "monthly",
    "interval": 1,
    "start": "2012-09-04",
    "count": 10,
    "iteration": 1,
    "template": true
  },
  "images": [{
    "id": "43",
    "path": "https://img.toshl.com/12/1404134603-ab820800-954f-46a7-95ff-fee7d961b31f/",
    "status": "uploaded"
  }],
  "reminders": [{
    "period": "week",
    "number": 2,
    "at": "11:25"
  }],
  "completed": false
}