ExpensesGet the exchange rate between two currencies on a date

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"
{
  "Properties": {
    "Amount": 3.14
  },
  "Links": [
    {
      "Href": "example_string",
      "Rel": "example_string"
    }
  ],
  "Actions": [
    {}
  ]
}
GET
/v2/exchange-rate
GET
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

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.

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
datestring
Required

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

Format: date-time
query
fromCurrencyIDinteger
Required

The currency converted FROM (a CurrencyID from GET /v1/currency). Omitting it → 404 (no action matches).

Format: int32
query
toCurrencyIDinteger
Required

The currency converted TO. Omitting it → 404 (no action matches).

Format: int32
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

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

datestring
Required

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

fromCurrencyIDinteger
Required

The currency converted FROM (a CurrencyID from GET /v1/currency). Omitting it → 404 (no action matches).

toCurrencyIDinteger
Required

The currency converted TO. Omitting it → 404 (no action matches).

Responses

Propertiesobject

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.

Linksarray
Actionsobject[]