createTenantExchangeRate
Requires at least one of the permissions settings:currency:update or settings:tenant:update.
Adds an exchange rate of the organization's own, with a start date and an optional stop date, in the organization's time zone. It only decides what later documents default to: existing documents keep the rate they were created with, and no price is ever produced by converting currency. Requires permission to update currency or tenant settings.
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:
- GraphQL
- cURL
mutation CreateTenantExchangeRate($input: CreateTenantExchangeRateInput!) {
createTenantExchangeRate(input: $input) {
id
status
createdAt
effectiveFrom
effectiveTo
fromCurrency
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateTenantExchangeRate($input: CreateTenantExchangeRateInput!) {\n createTenantExchangeRate(input: $input) {\n id\n status\n createdAt\n effectiveFrom\n effectiveTo\n fromCurrency\n }\n}",
"variables": {
"input": {
"effectiveFrom": "string",
"fromCurrency": "string",
"rate": "string"
}
}
}
EOF
Variables:
{
"input": {
"effectiveFrom": "string",
"fromCurrency": "string",
"rate": "string"
}
}
Response:
{
"data": {
"createTenantExchangeRate": {
"id": "id",
"status": "string",
"createdAt": "2025-01-15T00:00:00Z",
"effectiveFrom": "2025-01-15T00:00:00Z",
"effectiveTo": "2025-01-15T00:00:00Z",
"fromCurrency": "string"
}
}
}
createTenantExchangeRate(
input: CreateTenantExchangeRateInput!
): TenantExchangeRate!
Arguments
createTenantExchangeRate.input ● CreateTenantExchangeRateInput! non-null input
The currency, the rate, the start date, an optional stop date and a note.
Type
TenantExchangeRate object
One of the organization's own dated exchange rates. The rate is an exact decimal string meaning 1 unit of the foreign currency equals the rate in the base currency.