How to Load RBA Exchange Rates into Oracle NetSuite

Load official Reserve Bank of Australia rates into NetSuite's Currency Exchange Rate records every business day. A working SuiteScript 2.1 scheduled script, the rate direction NetSuite expects, OneWorld notes and a CSV Import alternative.

NetSuite stores rates as Currency Exchange Rate records and applies the most recent effective rate to each transaction. Its built-in Currency Exchange Rate Integration uses a commercial provider, which may not match the RBA rates your auditors or the ATO expect.

A SuiteScript 2.1 scheduled script can fetch the RBA rates from the Exchange Rates API and create those records directly. This guide gives you the script, the deployment steps and a no-code CSV alternative.

Using a different system? See the ERP integration overview for SAP, Xero, Business Central, Odoo and Excel.

Before You Start

The API returns rates as units of foreign currency per 1 AUD, which is how the RBA publishes them:

{
  "success": true,
  "timestamp": 1725080400,
  "base": "AUD",
  "date": "2025-08-31",
  "rates": {
    "USD": 0.643512,
    "EUR": 0.562934,
    "JPY": 96.8321
  }
}

Four things to get right for NetSuite:

  • Direction. NetSuite quotes rates as base currency per 1 unit of transaction currency, so with AUD as the base currency you load 1 / rate.
  • TWI and SDR. TWI is an index, not a currency, so skip it. SDR's ISO code is XDR; skip it unless you have XDR set up. The script skips both, and any currency your account doesn't have.
  • Weekends and public holidays. The RBA doesn't publish on those days. NetSuite uses the most recent effective rate, so you only need to load the days the RBA publishes. Use the date from the response as the effective date, never today's date.
  • Timing. The RBA publishes around 4 PM AEST. Schedule the script for 5 PM Sydney time or later on business days.

The Scheduled Script

/**
 * @NApiVersion 2.1
 * @NScriptType ScheduledScript
 * @description Loads daily RBA exchange rates into NetSuite currency exchange rates.
 */
define(['N/https', 'N/record', 'N/search', 'N/runtime', 'N/log'], (https, record, search, runtime, log) => {
  const API_URL = 'https://api.exchangeratesapi.com.au/latest';
  const SKIP = new Set(['TWI', 'SDR']);

  // Map ISO code -> NetSuite currency internal ID
  const getCurrencyIds = () => {
    const ids = {};
    search
      .create({ type: search.Type.CURRENCY, columns: ['symbol'] })
      .run()
      .each((result) => {
        ids[result.getValue('symbol')] = result.id;
        return true;
      });
    return ids;
  };

  const execute = () => {
    const apiKey = runtime.getCurrentScript().getParameter({ name: 'custscript_rba_api_key' });
    // In production, prefer an API Secret: https.createSecureString({ input: '{custsecret_rba_api_key}' })

    const response = https.get({
      url: API_URL,
      headers: { Authorization: `Bearer ${apiKey}`, Accept: 'application/json' },
    });
    if (response.code !== 200) {
      throw new Error(`Exchange Rates API returned ${response.code}: ${response.body}`);
    }

    const data = JSON.parse(response.body);
    const [year, month, day] = data.date.split('-').map(Number);
    const effectiveDate = new Date(year, month - 1, day); // local date, no UTC shift

    const currencyIds = getCurrencyIds();
    const audId = currencyIds.AUD;

    Object.entries(data.rates).forEach(([code, rate]) => {
      if (SKIP.has(code) || !currencyIds[code] || !rate) return;

      const fxRecord = record.create({ type: record.Type.CURRENCY_RATE });
      fxRecord.setValue({ fieldId: 'basecurrency', value: audId });
      fxRecord.setValue({ fieldId: 'transactioncurrency', value: currencyIds[code] });
      fxRecord.setValue({ fieldId: 'exchangerate', value: Number((1 / rate).toFixed(8)) });
      fxRecord.setValue({ fieldId: 'effectivedate', value: effectiveDate });
      const id = fxRecord.save();

      log.audit('RBA rate loaded', `${code} ${data.date}: ${(1 / rate).toFixed(8)} (record ${id})`);
    });
  };

  return { execute };
});

Deployment

  1. Upload the script, create a Script record and add a custscript_rba_api_key parameter (Password type), or use API Secrets.
  2. Create a deployment scheduled daily at 5:00 PM with the time zone set to Australia/Sydney.
  3. If Currency Exchange Rate Integration is enabled (Setup → Accounting → Accounting Preferences), make sure its automatic update won't overwrite your RBA rates. Either turn it off or run your script after it.
  4. For OneWorld accounts with more than one base currency, repeat the loop for each subsidiary base currency, using AUD cross-rates where needed (e.g. USD→EUR = rates.EUR / rates.USD).

Field IDs can vary slightly between accounts and features, so check them in the Records Browser for the Currency Exchange Rate record before you deploy.

No SuiteScript? Use CSV Import

NetSuite's CSV Import also supports currency exchange rates. Generate a daily CSV from the API with a small script on any server (the SAP Business One guide shows the fetch pattern in Python), apply 1 / rate, and import it with a saved import map.

Before You Go Live

  • Test in a sandbox account and compare a few loaded rates against the RBA's published table.
  • Duplicates. The script creates a new record each run. If the deployment might run twice for the same date, search for an existing rate for that currency and effective date first and skip it.
  • Alerting. Watch the script's execution log, or add an email on failure, so a missed day is caught before month-end. The API's /status endpoint helps when troubleshooting.
  • Backfill. When you first go live, load historical rates for open periods using /timeseries. Full history back to 2018 is on Professional and above.

Which Plan Do You Need?

A daily load uses about 22 requests a month, so Starter covers it. Move to Professional if you need history beyond the last 30 days for a backfill, or want a rate-published webhook to trigger the load as soon as rates arrive.

Ready to automate NetSuite's exchange rates? Get your free API key and try the script in a sandbox account today.


Data sourced from the Reserve Bank of Australia. We are not affiliated with or endorsed by the Reserve Bank of Australia.

Oracle and NetSuite are trademarks of Oracle and/or its affiliates. Code samples are provided as starting points. Test them in a sandbox account and review them with your NetSuite administrator before using them in production.

For API documentation, visit Exchange Rates API Docs