market_rate current without anyone entering rates by hand. It is off by default. You switch it on with the update_market_rate setting, and Omneo schedules the daily update for your tenant.
What runs each day
Once a day, at the time Omneo schedules for your tenant, and only while bothenabled and update_market_rate are true, the extension:
- Lists the currency pairs your tenant holds, narrowed by
market_rate_currenciesif you set it. A pair from a currency to itself is skipped. - Looks up the latest published market rate for each pair.
- Records it on the pair as
market_rate, rounded to six decimal places, withmarket_rate_dateset to the day the published rate belongs to.
market_rate_date can be earlier than today when the rate service has not yet published rates for today.
Choosing the currencies
By default every pair your tenant holds is updated. If your tenant holds pairs for currencies you do not trade in, setmarket_rate_currencies to the currencies you use, for example AUD,GBP. A pair is updated only when both of its currencies are in the list, so AUD,GBP updates AUD to GBP and GBP to AUD and nothing else.
Pairs outside the list keep their last
market_rate. If one of them has use_market_rate set to true, it is no longer kept current, so add its currencies to the list or switch it back to a manual rate. Set market_rate_currencies before you switch on update_market_rate, so the first update does not cover every pair.
Which pairs are updated
The run only ever writes
market_rate and market_rate_date. It never changes manual_rate or use_market_rate.
How it affects conversions
Each pair converts at a singlerate. The pair’s use_market_rate flag decides where that rate comes from:
This lets you watch the market rate for a pair before you switch it over. A pair switched to
use_market_rate before its first market rate arrives keeps converting at its existing rate until one is recorded. See Localisation for how pairs and their reverse directions resolve.
Loading market rates yourself
The extension writes through the Add market rates endpoint. You can call the same endpoint to load rates from your own source instead. Leaveupdate_market_rate off so the two sources do not overwrite each other.