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:
| Field | Meaning | Where it comes from |
|---|---|---|
| From currency | Currency being converted | base_currency or the response key |
| To currency | Target currency, often the company currency | Response key or base_currency |
| Rate type | Daily/spot, month-end, average, budget | Your mapping |
| Valid-from date | Date the rate applies from | date parameter or period start |
| Rate | Exchange rate value | data[CODE].value |
| Quotation / factor | Direct 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 ERP | Endpoint | Plan |
|---|---|---|
| Daily rate (previous day’s end of day) | /v1/historical with date = yesterday | All plans |
| Intraday / current rate | /v1/latest | All plans (hourly on Basic, 60 s on Professional+) |
| Month-end closing rate | /v1/historical with the last day of the month | All plans |
| Monthly, quarterly or yearly average | /v1/average with period and format=csv | All plans |
| Backfill of a full daily series | /v1/range with format=csv | Professional 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
- Schedule. Run the job each morning after midnight UTC – for example 06:00 local time – via cron, a cloud scheduler, or your integration platform.
- Fetch per company currency. For each legal entity, call
/v1/historicalwithbase_currencyset to the company currency,dateset to yesterday andcurrencieslimited to the currencies you transact in. - 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).
- 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.
- Import. Push via the ERP’s API or drop a CSV into its import folder.
- Log. Store request parameters, the raw response and the ERP import result for audit.
- Monthly. On the first day of each month, call
/v1/averagewithperiod=monthfor 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}¤cies={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/historicaland/v1/averageaccept 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/averageand/v1/rangesupportformat=csvfor 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?
Which rates should I import daily?
/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?
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.