Official and Customs Exchange Rates in Dynamics 365 Finance & Operations
Load central-bank and customs-authority exchange rates into Dynamics 365 Finance & Operations: a Customs exchange rate type, the Exchange rates data entity from a CSV, or a custom exchange rate provider in X++ that calls the AllRatesToday API.
Dynamics 365 Finance & Operations keeps rates per exchange rate type, and its built-in providers (OANDA, ECB, Central Bank of Russia, CBRT) fill one type at a time. Customs valuation needs a different number from accounting: the table the customs authority of the clearance country set for the declaration date. Give it its own type and load it from the customs exchange rate API, or load any of the 124 central banks the same way.
1. Create a Customs exchange rate type
Exchange rate types are shared data in F&O, so a type named Customs (one per clearance
country if you clear in several) sits next to your default type without touching ledger revaluation.
Rates are stored with a start date only; the latest rate on or before a transaction's
date applies, which matches how customs tables are in force until the next one. A conversion factor of
1 or 100 is set per pair, and a reciprocal pair (EUR→USD and USD→EUR) cannot both exist in one type.
2. No code: the Exchange rates data entity
Data management's Exchange rates entity (ExchangeRateEntity) imports
RateTypeName, FromCurrency, ToCurrency, StartDate,
EndDate, Rate and ConversionFactor. Download the table, map it to
those columns, and import it as a recurring data job.
# The Dutch customs table in force on 1 December 2026, as CSV
curl "https://allratestoday.com/api/v1/customs/NL/2026-12-01?format=csv" \
-H "Authorization: Bearer art_live_your_key" -o customs-nl-2026-12.csv Customs tables come in the authority's own direction: Dutch, German and French customs quote foreign currency per 1 EUR, Japan Customs quotes yen per unit. F&O wants one direction per type, so normalise to "foreign currency → home currency" before importing:
import csv, requests
API = "https://allratestoday.com/api/v1/customs"
HEADERS = {"Authorization": "Bearer art_live_your_key"}
def dmf_rows(country, date, home_ccy, rate_type="Customs"):
"""Rows for the 'Exchange rates' data entity: FromCurrency -> home currency."""
t = requests.get(f"{API}/{country}/{date}", headers=HEADERS).json()
for r in t["rates"]:
if r["quote"] == home_ccy: # table quoted home per foreign
frm, rate = r["base"], r["value"]
elif r["base"] == home_ccy: # table quoted foreign per home: invert
frm, rate = r["quote"], 1 / r["value"]
else:
continue
yield {"RateTypeName": rate_type, "FromCurrency": frm, "ToCurrency": home_ccy,
"StartDate": t["rate_date"], "Rate": round(rate, 6), "ConversionFactor": 1}
with open("exchange-rates.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=["RateTypeName", "FromCurrency", "ToCurrency", "StartDate", "Rate", "ConversionFactor"])
w.writeheader()
w.writerows(dmf_rows("NL", "2026-12-01", "EUR")) 3. Automated: a custom exchange rate provider
F&O's provider framework lets a developer add a provider class in X++ that implements
IExchangeRateProvider and extends the ExchangeRateProvider enum. Once deployed,
it appears under General ledger > Currencies > Configure exchange rate providers
(key/value settings such as the API key and the source code), and the
Import currency exchange rates page runs it as a batch job for a chosen exchange rate
type, for the current date or a date range. Microsoft's OANDA provider
(ExchangeRateProviderOanda) is the reference implementation.
// Sketch of the provider contract (names from Microsoft's documentation).
[ExportMetadataAttribute(enumStr(ExchangeRateProvider), enumLiteralStr(ExchangeRateProvider, AllRatesToday)),
ExportAttribute('Microsoft.Dynamics.ApplicationSuite.FinancialManagement.Currency.Framework.IExchangeRateProvider')]
public class ExchangeRateProviderAllRatesToday implements IExchangeRateProvider
{
// get_Name, get_Id (a fixed GUID), set_Factory, GetSupportedOptions,
// GetConfigurationDefaults (e.g. ApiKey, Source = 'zollde' or Country = 'DE'),
// ValidateConfigurationDetail, EnumNameForLookup ...
public IExchangeRateResponse GetExchangeRates(IExchangeRateRequest _request, IExchangeRateProviderConfig _config)
{
// 1. Read the API key and source from _config.
// 2. For CurrentDate: GET /api/v1/central-bank/{source}/latest
// For DateRange: GET /api/v1/central-bank/{source}/history?from=&to=
// 3. For each pair: set_FromCurrency, set_ToCurrency, set_ExchangeRateDisplayFactor;
// for each rate: set_ValidFrom(rate_date), set_ExchangeRate(value).
}
} Schedule the batch on the authority's cadence: daily for Canada or Australia, weekly for Japan, Korea or the US, monthly for most EU customs offices. Turn on Create necessary currency pairs on the first run.
Keep the evidence
- Store the response's
rate_dateas the start date, not the day you imported. - Pairs the table did not print come back
"derived": truewith themethod; US CBP and China customs tables are built by rule and say"method": "rule"with abasis. - History downloads (
/history, paid plans) let you rebuild a type for a past period before an audit.
Rolling this out across legal entities?
Tell us your clearance countries and rate types and we will map the sources.
Talk to us All integration guides