DEV Community

viraj geeth
viraj geeth

Posted on Originally published at allratestoday.com

Official Central Bank Exchange Rates in Dynamics 365 Business Central (No Extension Needed)

If your finance team has to book foreign-currency transactions at the rate a specific central bank publishes, Business Central can do it without a single line of AL. The product has shipped a URL-driven importer since NAV 2015, the Currency Exchange Rate Service, and all it needs is an XML feed it can parse and a field mapping.

This post walks through pointing that importer at an official central-bank table. The full procedure with every field is in the Business Central guide on AllRatesToday.

The two limits of the built-in importer

The Currency Exchange Rate Service has two constraints that rule out most rate APIs:

  1. It reads XML, not JSON.
  2. It cannot send request headers, so an API key has to travel on the URL.

Both are covered by two query parameters on the AllRatesToday central-bank endpoint:

https://allratestoday.com/api/v1/central-bank/ecb/latest?format=xml&api_key=art_live_your_key
Enter fullscreen mode Exit fullscreen mode

Swap ecb for any of the 121 bank codes on the coverage map: rbi for the Reserve Bank of India, boe for the Bank of England, cbuae for the UAE, bsp for the Philippines, and so on.

The response is the bank's complete latest table:

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <bank>ecb</bank>
  <name>European Central Bank</name>
  <rate_date>2026-10-09</rate_date>
  <rates>
    <rate><base>EUR</base><quote>USD</quote><type>reference</type><value>1.1206</value></rate>
    <rate><base>EUR</base><quote>GBP</quote><type>reference</type><value>0.84763</value></rate>
    ...
  </rates>
</response>
Enter fullscreen mode Exit fullscreen mode

Want to try before you sign up? The keyless copy at https://allratestoday.com/api/open/central-bank/ecb returns the same table as JSON.

Create the service

  1. Search for Currency Exchange Rate Services, choose New.
  2. Code it ECB-OFFICIAL, paste the URL into Service URL, click Preview. Business Central fetches the feed and shows the XML tree.
  3. On Field Mapping, set the Parent Node to the repeating rate element and map the fields below.
  4. Enable the service and give the Job Queue entry a run time after the bank's publication time. The ECB publishes around 16:00 CET; every bank's cadence is on its page.

The field mapping, and why direction matters

Business Central stores each rate as Exchange Rate Amount (foreign) against Relational Exch. Rate Amount (local). Which of the feed's two sides goes where depends on how the bank quotes.

Business Central field Bank quotes foreign per 1 home (ECB, BoE, RBA) Bank quotes home per 1 foreign (RBI, CBN, BSP)
Currency Code quote base
Starting Date rate_date rate_date
Exchange Rate Amount value 1
Relational Exch. Rate Amount 1 value

The ECB says "1 EUR = 1.1206 USD", so USD is the quote and the value is the foreign amount. The RBI says "1 USD = 96.6149 INR", so USD is the base and the value is the local amount. Map it once per bank and the importer handles every currency in the table the same way.

If you would rather not think about direction at all, the endpoint can resolve a single pair for you: ?source=USD&target=EUR returns one rate in exactly that direction, with derived and method fields that say whether it was published as-is, inverted, or crossed through the home currency. That is the audit trail an external auditor asks for.

When you do want an extension

The built-in service imports a whole table on a schedule. If you need per-company bank codes, a "run now" action, or a log of currencies skipped because they are not set up in the Currency table, an AL codeunit using HttpClient against the JSON endpoint is about 150 lines. The rate_date, stale and age_days fields in the JSON tell the codeunit whether the bank has published a new table yet, so you never post a stale rate as today's.

Links

Rates are redistributed from each institution's public publication. They are reference rates for accounting, tax and compliance, not dealing quotes.

Top comments (0)