Get the exchange rate between two currencies on a date
Returns the conversion rate (per 100) between two currencies on a date, as TimeLog's expense form uses it to prefill an expense's exchange rate.
If the FROM currency was created by the account, the rate is computed from the stored rates of both currencies instead, and the date is ignored.
Use it to:
- Expense or receipt-capture app suggesting ExchangeRate for a foreign-currency receipt before POST /v2/employee-expense (
POST /v2/employee-expense)
Not for:
- The currency list with today's rate against the caller's legal-entity currency —
GET /v1/currency/{status}
Behaviour:
- Idempotent.
- Safe to retry.
- Side effect: One outbound HTTP GET {CurrencyExchangeServiceAddress}/api/CurrencyExchange/{fromISO}/{toISO}/{yyyy-MM-dd} per try, with the TimeLog-Authorization header; each failure is written to the error log.
- Changes are visible to the next read immediately.
Call first: GET /v1/currency/{status}
Next: POST /v2/employee-expense, PUT /v2/employee-expense
See also: GET /v1/currency/{status}
Not yet documented: errors; examples; response → success.
curl -X GET "https://app3.timelog.com/your-account/api/v2/exchange-rate?date=2024-12-25T10%3A00%3A00Z&fromCurrencyID=123&toCurrencyID=123" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://app3.timelog.com/your-account/api/v2/exchange-rate?date=2024-12-25T10%3A00%3A00Z&fromCurrencyID=123&toCurrencyID=123"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v2/exchange-rate?date=2024-12-25T10%3A00%3A00Z&fromCurrencyID=123&toCurrencyID=123", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://app3.timelog.com/your-account/api/v2/exchange-rate?date=2024-12-25T10%3A00%3A00Z&fromCurrencyID=123&toCurrencyID=123", nil)
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/v2/exchange-rate?date=2024-12-25T10%3A00%3A00Z&fromCurrencyID=123&toCurrencyID=123')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"Properties": {
"Amount": 3.14
},
"Links": [
{
"Href": "example_string",
"Rel": "example_string"
}
],
"Actions": [
{}
]
}
{
"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
}
{
"Message": "No HTTP resource was found that matches the request URI 'https://app{server-number}.timelog.com/{account}/api/v2/exchange-rate'.",
"MessageDetail": "No action was found on the controller 'ExchangeRate' that matches the request."
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/v2/exchange-rate
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 rate date. Only the calendar date is sent to the provider (yyyy-MM-dd); ignored when the FROM currency is account-created. Omitting it means no action matches (404).
The currency converted FROM (a CurrencyID from GET /v1/currency). Omitting it → 404 (no action matches).
The currency converted TO. Omitting it → 404 (no action matches).
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.
Query Parameters
The rate date. Only the calendar date is sent to the provider (yyyy-MM-dd); ignored when the FROM currency is account-created. Omitting it means no action matches (404).
The currency converted FROM (a CurrencyID from GET /v1/currency). Omitting it → 404 (no action matches).
The currency converted TO. Omitting it → 404 (no action matches).
Responses
The conversion rate between two currencies on a date, quoted per 100 units, as the TimeLog expense form uses it to prefill an expense's exchange rate. One field.