Skip to content
Finance use case

Exchange rates for accounting and IAS 21 reporting

Transaction-date rates, closing rates and period averages for IAS 21 and ASC 830 foreign currency reporting – as JSON or CSV, with an audit trail you can hand to your auditors.

Last updated: · fxapi team

Every company that buys, sells or owns subsidiaries in another currency needs exchange rates for accounting: a rate for each transaction date, a closing rate for each reporting date and, usually, an average rate for each month. Pulling those numbers by hand from different websites is slow and hard to defend in an audit. fxapi gives finance teams one consistent source of mid-market reference rates for 190+ currencies back to 1999, with endpoints built around the way IAS 21 and ASC 830 use them.

Not accounting advice. This page describes common practice at a high level. The rates you must use depend on your accounting policies, your functional currency and local requirements. Agree your approach with your auditor or accounting advisor.

Which IAS 21 exchange rates you need

IAS 21 The Effects of Changes in Foreign Exchange Rates (IFRS Foundation) and ASC 830 Foreign Currency Matters (FASB) distinguish between rate types. Simplified:

SituationIAS 21 (high level)ASC 830 (high level)fxapi endpoint
Recording a foreign-currency transactionSpot rate at the transaction date; an average rate may approximate itRate at the transaction date; averages allowed as an approximation/v1/historical with date
Monetary items at period end (receivables, payables, cash)Closing rateCurrent rate at the balance sheet date/v1/historical with the period-end date
Translating a foreign operation – balance sheetClosing rateCurrent rate/v1/historical
Translating a foreign operation – income statementTransaction-date rates or an average rateWeighted-average rate as an approximation/v1/average with period=month

The difference between the two rate types is explained in closing vs. average exchange rates.

How fxapi supports month-end close

  • /v1/historical returns end-of-day (UTC) rates for any date from 1999-01-01 up to yesterday. Use it for transaction-date rates and for the closing rate on the last day of the period.
  • /v1/average returns one average per period – month, quarter, year or total – for spans up to 1,830 days, with min, max, days and a source label in the meta. It costs one request regardless of how many periods it returns. Add format=csv to get a file that drops into a spreadsheet or consolidation tool.
  • /v1/range (Professional and up) returns a full daily series as CSV if you prefer to store every day’s rate yourself.

All three accept any base_currency, so you can request rates directly against your functional or presentation currency – EUR, GBP, CHF or anything else – instead of converting from USD yourself. See the average exchange rates API and historical exchange rates API for full parameter lists.

Month-end close workflow

  1. Write down the policy. Functional currency per entity, which rate type applies to which line item, and how “closing rate” is defined (fxapi historical values are end-of-day UTC).
  2. Collect transaction-date rates. A daily job stores /v1/historical for the previous day, or your ERP looks up each invoice date on demand.
  3. Run the close on the first business day of the new month. /v1/historical and /v1/average only accept dates up to yesterday, so the last day of the month is available from the 1st onward.
  4. Fetch the closing rate with date set to the last day of the period.
  5. Fetch the period average with date_from and date_to covering the month and period=month, as CSV.
  6. Check volatility. Compare min and max in the average response; if a currency moved sharply, your policy may require transaction-date rates instead of the average.
  7. Import the rate pack into your ERP, consolidation tool or Excel workbook.
  8. Archive the evidence – request parameters, raw responses and a hash – next to the close file.

Code example: build a monthly rate pack

The first step in the shell, to see what the CSV looks like:

curl -G "https://api.fxapi.com/v1/average" \
  -H "apikey: $FXAPI_KEY" \
  -d base_currency=EUR \
  -d currencies=USD,GBP,CHF,PLN \
  -d date_from=2026-09-01 \
  -d date_to=2026-09-30 \
  -d period=month \
  -d format=csv

The CSV columns are period,date_from,date_to,days,source,base_currency,currency,average,min,max. The Python script below builds a complete pack for the previous month – closing rates plus averages – and stores the raw files with a SHA-256 hash:

import datetime as dt, hashlib, json, os, pathlib, requests

API = "https://api.fxapi.com/v1"
HEADERS = {"apikey": os.environ["FXAPI_KEY"]}
BASE, CURRENCIES = "EUR", "USD,GBP,CHF,PLN"

today = dt.date.today()
last_day = today.replace(day=1) - dt.timedelta(days=1)
first_day = last_day.replace(day=1)
out = pathlib.Path(f"rate-pack/{last_day:%Y-%m}")
out.mkdir(parents=True, exist_ok=True)

def save(name, params, resp):
    resp.raise_for_status()
    body = resp.content
    (out / name).write_bytes(body)
    return {"file": name, "params": params, "sha256": hashlib.sha256(body).hexdigest(),
            "retrieved_at": dt.datetime.utcnow().isoformat() + "Z"}

closing_params = {"base_currency": BASE, "currencies": CURRENCIES, "date": last_day.isoformat()}
average_params = {"base_currency": BASE, "currencies": CURRENCIES, "period": "month",
                  "date_from": first_day.isoformat(), "date_to": last_day.isoformat(), "format": "csv"}

manifest = [
    save("closing.json", closing_params, requests.get(f"{API}/historical", headers=HEADERS, params=closing_params, timeout=30)),
    save("average.csv", average_params, requests.get(f"{API}/average", headers=HEADERS, params=average_params, timeout=30)),
]
(out / "manifest.json").write_text(json.dumps(manifest, indent=2))

Two requests per base currency per month – well inside the Free plan. More patterns in the Python guide.

Building an audit trail

Auditors want to know where a rate came from and that it was not changed afterwards. Keep, for every rate set you use:

  • the endpoint and parameters (never the API key),
  • the raw response body and meta.last_updated_at where present,
  • the retrieval timestamp and the user or job that ran it,
  • a hash of the stored file, plus the ERP import log.

Storing the evidence yourself means you can reproduce every posted figure independently of any later lookup.

Pitfalls and best practices

  • Use one base consistently. Request rates against the entity’s functional currency instead of mixing EUR-based and USD-based tables.
  • Respect the “yesterday” rule. Running the close on the last day of the month will fail validation for that day; schedule it for the 1st.
  • Keep historical codes. Legacy codes such as HRK, LTL or VEF remain available for history, so restating prior periods still works. Background in currency redenominations and code changes.
  • Don’t mix rate types silently. Label every rate as closing, average or spot in your system.
  • Document approximations. If you use averages for P&L, keep the min/max evidence that rates did not fluctuate significantly.

Close the month with consistent rates

Historical and average rates are on every plan, so you can test the whole workflow on the Free plan today. If you want complete daily series via /v1/range, Professional adds it from $34.99 per month – see pricing. Get a free API key and generate last month’s rate pack in a few minutes.

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

Frequently asked questions

Which exchange rate does IAS 21 require?
At a high level: the spot rate at the transaction date for initial recognition, the closing rate for monetary items at the reporting date, and – when translating a foreign operation – closing rates for assets and liabilities and transaction-date or average rates for income and expenses. Your accounting policy and auditor decide the details.
Can I use a monthly average rate instead of daily rates?
IAS 21 and ASC 830 both allow an average rate as a practical approximation when exchange rates do not fluctuate significantly. fxapi’s /v1/average returns the average together with the min and max of the period, which helps you document that judgment.
How does fxapi calculate the monthly average?
Daily rates are first converted to your base currency and then averaged per period (month, quarter or year). The response includes the number of days used, and the first and last periods are clipped to your requested date span.
Which fxapi plan do I need for month-end close?
Historical and average rates are available on every plan, including Free with 300 requests per month. If you want full daily series as CSV in one call, /v1/range is available on Professional and up.
Is fxapi an official or statutory rate source?
No. fxapi provides mid-market reference rates from market data. Some jurisdictions or tax authorities prescribe specific official rates; check which source your policy and local rules require.
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.