Skip to main content

exchangeRate

Requires an authenticated session.

Returns the exchange rate between two currencies for a date. The organization's own rate in force on that day wins over the platform-wide rate. It is a rate for documents, not a price.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query ExchangeRate($fromCurrency: String!, $toCurrency: String!) {
exchangeRate(fromCurrency: $fromCurrency, toCurrency: $toCurrency) {
id
createdAt
fromCurrency
inverseRate
lastUpdated
rate
}
}

Variables:

{
"fromCurrency": "string",
"toCurrency": "string"
}

Response:

{
"data": {
"exchangeRate": {
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"fromCurrency": "string",
"inverseRate": 0,
"lastUpdated": "2025-01-15T00:00:00Z",
"rate": 0
}
}
}
exchangeRate(
date: String
fromCurrency: String!
toCurrency: String!
): ExchangeRate!

Arguments​

exchangeRate.date ● String scalar​

The document's date (YYYY-MM-DD or ISO). The tenant's rate in force on that day wins over the global feed; omitted = today.

exchangeRate.fromCurrency ● String! non-null scalar​

The currency code to convert from.

exchangeRate.toCurrency ● String! non-null scalar​

The currency code to convert to.

Type​

ExchangeRate object​

The current exchange rate between two currencies.