Update an employee expense
Replaces the amounts, date, currency, type, payment method, billability, comment and project of an unapproved employee expense.
A full replacement (PUT) of the expense's ten writable fields, addressed by EmployeeExpenseID in the body. Read the expense first and send every field back — an omitted Comment is cleared and an omitted Amount becomes 0. The owner and the contract cannot be changed; changing ProjectID fails when the expense has a contract. Approved, invoiced, closed-period and completed-project expenses are refused. The response body is JSON null: GET the expense to see the result.
Use it to:
- Expense app letting an employee correct an expense before approval
- Receipt-capture integration filling in amount / VAT / currency after OCR of the uploaded receipt
Not for:
- Changing the owner or contract — delete and re-create the expense
- Changing receipts — the attach / delete image and file operations
Rules across fields:
- R1: When the expense has a contract, ProjectID must be a project that contract belongs to — i.e. ProjectID cannot be changed.
- R2: ExpenseTypeID must belong to the owner's legal entity.
- R3: Date must be inside the owner's employment and not in a closed accounting period.
Behaviour:
- Idempotent.
- Same body → same stored values; last write wins (no concurrency token).
- Safe to retry.
- Duplicates: n/a
- Changes are visible to the next read immediately.
Call first: GET /v1/employee-expense/{employeeExpenseID}
Next: GET /v1/employee-expense/{employeeExpenseID}
See also: DELETE /v1/employee-expense/{employeeExpenseID}
Not yet documented: behaviour → side effects; examples.
curl -X PUT "https://app3.timelog.com/your-account/api/v1/employee-expense" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"EmployeeExpenseID": 123,
"Date": "2024-12-25T10:00:00Z",
"Amount": 3.14,
"VatAmount": 3.14,
"IsBillable": true,
"Comment": "null",
"ExchangeRate": 3.14,
"CurrencyID": 123,
"ExpenseTypeID": 123,
"PaymentMethodID": 123,
"ProjectID": 123
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/employee-expense"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"EmployeeExpenseID": 123,
"Date": "2024-12-25T10:00:00Z",
"Amount": 3.14,
"VatAmount": 3.14,
"IsBillable": true,
"Comment": "null",
"ExchangeRate": 3.14,
"CurrencyID": 123,
"ExpenseTypeID": 123,
"PaymentMethodID": 123,
"ProjectID": 123
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v1/employee-expense", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"EmployeeExpenseID": 123,
"Date": "2024-12-25T10:00:00Z",
"Amount": 3.14,
"VatAmount": 3.14,
"IsBillable": true,
"Comment": "null",
"ExchangeRate": 3.14,
"CurrencyID": 123,
"ExpenseTypeID": 123,
"PaymentMethodID": 123,
"ProjectID": 123
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"EmployeeExpenseID": 123,
"Date": "2024-12-25T10:00:00Z",
"Amount": 3.14,
"VatAmount": 3.14,
"IsBillable": true,
"Comment": "null",
"ExchangeRate": 3.14,
"CurrencyID": 123,
"ExpenseTypeID": 123,
"PaymentMethodID": 123,
"ProjectID": 123
}`)
req, err := http.NewRequest("PUT", "https://app3.timelog.com/your-account/api/v1/employee-expense", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app3.timelog.com/your-account/api/v1/employee-expense')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"EmployeeExpenseID": 123,
"Date": "2024-12-25T10:00:00Z",
"Amount": 3.14,
"VatAmount": 3.14,
"IsBillable": true,
"Comment": "null",
"ExchangeRate": 3.14,
"CurrencyID": 123,
"ExpenseTypeID": 123,
"PaymentMethodID": 123,
"ProjectID": 123
}'
response = http.request(request)
puts response.body
"null"
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/v1/employee-expense
Target server for requests. Edit to use your own host.
OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
> Not yet documented: how to obtain a token.
> Not yet documented: token lifetime.
Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
> Not yet documented: how to obtain a token.
> Not yet documented: token lifetime.The media type of the request body
The expense to update (from GET /v1/employee-expense). Identifier of this object, unique per TimeLog site. - ≤ 0 — 400, Code 200. - unknown ID — 500, Code 100 (the expense lookup throws a data-access exception).
The expense (receipt) date. Date only — no time component. - a time component is sent — Truncated to the date (DateTime.Date). Must be inside the owner's employment (38022) and not in a closed accounting period (37699). > Not yet documented: constraints → timezone.
The expense amount, in the currency CurrencyID. Unit: currency of CurrencyID - omitted — Written as 0 (full replacement). NotNull on a non-nullable double never fails: 0 and negative amounts pass.
The VAT part, in the currency CurrencyID. Unit: currency of CurrencyID - omitted — Written as 0 (full replacement).
Whether the expense is billable to the customer. - omitted — Written as false (full replacement). > Not yet documented: behaviour.
Free-text comment. Null: Omitted or null clears the stored comment (full replacement). > Not yet documented: constraints → max length.
Exchange rate from CurrencyID to the owner's legal-entity currency. > Not yet documented: constraints → unit.
Currency of Amount and VatAmount.
Refers to CurrencyRead.CurrencyID. Look up valid values with GET /v1/currency/{status}.
Valid values come from GET /v1/currency/{status}.
The expense type; must belong to the owner's legal entity.
Refers to ExpenseTypeRead.ExpenseTypeID.
> Not yet documented: values → lookup op.
How the employee paid.
Refers to PaymentMethodRead.PaymentMethodID. Look up valid values with GET /v1/payment-method/{status}.
The project the expense is booked on.
Refers to ProjectHeaderRead.ProjectID. Look up valid values with GET /v1/project-header/search-for-expense-travel-registration-order-by-recent-registration.
- changed, and the expense has a contract (ProjectSubContractID > 0) — The stored contract is not on the new project → 37042. In practice the project cannot be changed.
- unchanged — Project must not be Completed (38006).
Valid values come from GET /v1/project-header/search-for-expense-travel-registration-order-by-recent-registration.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
Not yet documented: how to obtain a token.
Not yet documented: token lifetime.
Body
The expense to update (from GET /v1/employee-expense).
Identifier of this object, unique per TimeLog site.
-
≤ 0 — 400, Code 200.
-
unknown ID — 500, Code 100 (the expense lookup throws a data-access exception).
The expense (receipt) date.
Date only — no time component.
- a time component is sent — Truncated to the date (DateTime.Date).
Must be inside the owner's employment (38022) and not in a closed accounting period (37699).
Not yet documented: constraints → timezone.
The expense amount, in the currency CurrencyID.
Unit: currency of CurrencyID
- omitted — Written as 0 (full replacement).
NotNull on a non-nullable double never fails: 0 and negative amounts pass.
The VAT part, in the currency CurrencyID.
Unit: currency of CurrencyID
- omitted — Written as 0 (full replacement).
Whether the expense is billable to the customer.
- omitted — Written as false (full replacement).
Not yet documented: behaviour.
Free-text comment.
Null: Omitted or null clears the stored comment (full replacement).
Not yet documented: constraints → max length.
Exchange rate from CurrencyID to the owner's legal-entity currency.
Not yet documented: constraints → unit.
Currency of Amount and VatAmount.
Refers to CurrencyRead.CurrencyID. Look up valid values with GET /v1/currency/{status}.
Valid values come from GET /v1/currency/{status}.
The expense type; must belong to the owner's legal entity.
Refers to ExpenseTypeRead.ExpenseTypeID.
Not yet documented: values → lookup op.
How the employee paid.
Refers to PaymentMethodRead.PaymentMethodID. Look up valid values with GET /v1/payment-method/{status}.
The project the expense is booked on.
Refers to ProjectHeaderRead.ProjectID. Look up valid values with GET /v1/project-header/search-for-expense-travel-registration-order-by-recent-registration.
-
changed, and the expense has a contract (ProjectSubContractID > 0) — The stored contract is not on the new project → 37042. In practice the project cannot be changed.
-
unchanged — Project must not be Completed (38006).
Valid values come from GET /v1/project-header/search-for-expense-travel-registration-order-by-recent-registration.
Responses
*Success without content: HTTP 200 with the literal JSON body null. Body is the JSON literal null.
Order: none
Empty result: none*