Skip to content
ERP use case

Exchange rates ERP integration: automate your daily rate import

Replace manual rate entry with a scheduled daily import of spot, closing and monthly average rates into your ERP’s currency tables – one base currency per company, JSON or CSV.

Last updated: · fxapi team

Somewhere in many finance teams, someone still copies exchange rates into the ERP every morning. It is slow, error-prone and impossible to audit. An exchange rates ERP integration replaces that with a scheduled job: fetch the rates, map them to the ERP’s rate table format, import, verify. fxapi supplies the rates – 190+ currencies, any base currency, end-of-day history back to 1999 and monthly averages – as JSON or CSV over a plain REST API that any integration tool can call.

How ERPs store exchange rates

Whether you run SAP, Oracle NetSuite, Microsoft Dynamics 365, Odoo, Sage or a homegrown system, rate tables look similar. A row typically has:

FieldMeaningWhere it comes from
From currencyCurrency being convertedbase_currency or the response key
To currencyTarget currency, often the company currencyResponse key or base_currency
Rate typeDaily/spot, month-end, average, budgetYour mapping
Valid-from dateDate the rate applies fromdate parameter or period start
RateExchange rate valuedata[CODE].value
Quotation / factorDirect vs. indirect, sometimes a ratio like “per 100 JPY”Your mapping

The ERP’s import mechanism varies – REST or SOAP APIs, CSV upload, scheduled file import, or an integration platform – but the data is the same. fxapi does not ship official ERP connectors; you own a small job that bridges the two. Check your ERP vendor’s documentation for its exact import format.

Which fxapi endpoints to use

Rate type in your ERPEndpointPlan
Daily rate (previous day’s end of day)/v1/historical with date = yesterdayAll plans
Intraday / current rate/v1/latestAll plans (hourly on Basic, 60 s on Professional+)
Month-end closing rate/v1/historical with the last day of the monthAll plans
Monthly, quarterly or yearly average/v1/average with period and format=csvAll plans
Backfill of a full daily series/v1/range with format=csvProfessional and up

Monthly averages and closing rates are explained in closing vs. average exchange rates and the average exchange rates API.

Integration pattern: daily rate import

  1. Schedule. Run the job each morning after midnight UTC – for example 06:00 local time – via cron, a cloud scheduler, or your integration platform.
  2. Fetch per company currency. For each legal entity, call /v1/historical with base_currency set to the company currency, date set to yesterday and currencies limited to the currencies you transact in.
  3. Transform. Map each value to the ERP’s row format: rate type, from/to, valid-from date, and invert or scale where the ERP expects indirect quotation or a factor (for example rates per 100 JPY).
  4. Validate. Reject the batch if a currency is missing or a rate moved more than a threshold versus the previous day; alert a human instead of importing.
  5. Import. Push via the ERP’s API or drop a CSV into its import folder.
  6. Log. Store request parameters, the raw response and the ERP import result for audit.
  7. Monthly. On the first day of each month, call /v1/average with period=month for the previous month and import the result as your average rate type.

Code example: generate an ERP import file in C#

Plain HttpClient with the apikey header. The job writes one CSV row per currency in a generic format you can adapt to your ERP’s template.

using System.Globalization;
using System.Net.Http.Json;
using System.Text;

var companyCurrency = "EUR";
var currencies = "USD,GBP,CHF,PLN,JPY";
var date = DateTime.UtcNow.Date.AddDays(-1).ToString("yyyy-MM-dd");

using var http = new HttpClient { BaseAddress = new Uri("https://api.fxapi.com/") };
http.DefaultRequestHeaders.Add("apikey", Environment.GetEnvironmentVariable("FXAPI_KEY"));

var url = $"v1/historical?base_currency={companyCurrency}&currencies={currencies}&date={date}";
var response = await http.GetFromJsonAsync<FxResponse>(url)
               ?? throw new InvalidOperationException("Empty response");

var csv = new StringBuilder("rate_type,from_currency,to_currency,valid_from,rate\n");
foreach (var (code, rate) in response.Data)
{
    // ERP stores "1 foreign unit = x EUR" (indirect to the API's direction), so invert
    var perUnit = 1m / rate.Value;
    csv.AppendLine(string.Join(",", "DAILY", code, companyCurrency, date,
        perUnit.ToString("0.########", CultureInfo.InvariantCulture)));
}

await File.WriteAllTextAsync($"erp_rates_{companyCurrency}_{date}.csv", csv.ToString());

record FxRate(string Code, decimal Value);
record FxResponse(Dictionary<string, FxRate> Data);

GetFromJsonAsync uses case-insensitive property matching by default, so data, code and value map to the records. More C# patterns in the C# guide.

Multiple companies, multiple base currencies

Groups with entities in several countries have one company currency per entity. Two options:

  • One request per company currency. Simple mapping, exact values per base. A group with EUR, GBP and USD entities makes three calls a day.
  • One USD-based request plus cross rates. One call per day, then compute rate[to] / rate[from] for each pair – see base currency and cross rates. Round consistently to the precision your ERP stores.

Either way, a daily import is light: about 31 requests per base currency per month, plus 1 for averages. The Free plan’s 300 requests cover roughly nine company currencies; note its 10 requests/minute limit if you fetch many bases at once. Basic, Professional and Enterprise have no per-minute limit – see pricing.

Pitfalls and best practices

  • Know your quotation direction. The most common ERP rate bug is an inverted rate. Test with one known pair before going live.
  • Mind factors and ratios. Some systems store JPY, HUF or KRW rates per 100 or 1,000 units; scale accordingly.
  • Respect the “yesterday” rule. /v1/historical and /v1/average accept dates up to yesterday, which matches a morning import of the prior day.
  • Don’t import silently on failure. If the API returns 4xx/5xx or a currency is missing, stop and alert rather than leave yesterday’s rate looking current.
  • Use a dedicated key. Paid plans allow multiple keys, so the ERP job can have its own; Enterprise adds IP whitelisting for fixed integration servers.
  • Keep CSV and JSON options open. /v1/average and /v1/range support format=csv for file-based imports; JSON suits API-based imports.

Automate your rate import

The full pattern – daily rates, month-end rates and monthly averages – runs on the Free plan, so you can build and test it before choosing a paid tier. Need a custom volume or contractual terms? Contact us. Otherwise, create a free API key and retire the manual rate entry this month. Finance-specific guidance is in exchange rates for accounting.

Everything on this page runs on the fxapi foreign exchange rates API: one key, 190+ currencies, data back to 1999.

Frequently asked questions

Does fxapi have an official SAP, NetSuite or Dynamics connector?
No. fxapi is a REST API. ERPs import exchange rates through their own APIs, file imports or integration platforms, and the pattern on this page works with any system that accepts a rate table.
Which rates should I import daily?
Most companies import the previous day’s end-of-day rates from /v1/historical each morning, plus a monthly average from /v1/average after month end for rate types that need it.
How do I handle several companies with different base currencies?
Request rates once per company currency with base_currency=EUR, base_currency=GBP and so on, or fetch one USD-based set and compute cross rates. Both approaches work on every plan.
My ERP expects indirect quotation. What do I do?
fxapi returns units of the target currency per one unit of the base. For the opposite direction, either swap the base currency in the request or invert the value (1 / value) before import.
How many API requests does a daily ERP import use?
About one request per base currency per day, plus one per month for averages – roughly 32 a month for a single company currency. The Free plan’s 300 requests cover around nine company currencies.
Free plan · no credit card

Get your free exchange rate API key

300 requests a month, latest and historical rates, fluctuation and averages – free forever. Upgrade when you need faster updates or more requests.