How to Load RBA Exchange Rates into SAP Business One
SAP Business One stores daily rates in its Exchange Rates and Indexes table. Many Australian B1 users fill it in by hand from the RBA website, which is slow and easy to get wrong at month-end.
Through the Service Layer you can set those rates with the SBOBobService_SetCurrencyRate action. This guide gives you a Python job that fetches the RBA rates from the Exchange Rates API and loads them every business day.
Using a different system? See the ERP integration overview for SAP S/4HANA, Xero, NetSuite, 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 Business One:
- Direction. With B1's default direct rate setting, rates are stored as local currency (AUD) per 1 unit of foreign currency, so you load
1 / rate. - Currency codes. B1 currency codes are user-defined, so map ISO codes to the codes in your company. Leave out TWI (an index, not a currency) and SDR unless you have it set up as XDR.
- Weekends and public holidays. The RBA doesn't publish on those days. Use the
datefrom the response as the rate date, never today's date. - Timing. The RBA publishes around 4 PM AEST. Schedule the job for 5 PM Sydney time or later on business days.
The Python Job
This runs on any server that can reach both the API and your B1 Service Layer:
import requests
RBA_API = "https://api.exchangeratesapi.com.au"
RBA_KEY = "your_api_key_here"
B1_URL = "https://your-b1-server:50000/b1s/v1"
B1_LOGIN = {"CompanyDB": "SBODEMOAU", "UserName": "manager", "Password": "..."}
# B1 currency codes are user-defined - map ISO codes to the codes in your company
CURRENCY_MAP = {"USD": "USD", "EUR": "EUR", "GBP": "GBP", "NZD": "NZD", "JPY": "JPY"}
def fetch_rba_rates():
response = requests.get(
f"{RBA_API}/latest",
headers={"Authorization": f"Bearer {RBA_KEY}"},
params={"symbols": ",".join(CURRENCY_MAP.keys())},
timeout=30,
)
response.raise_for_status()
return response.json()
def load_into_b1(data):
session = requests.Session()
session.verify = True # point at your CA bundle if B1 uses an internal cert
session.post(f"{B1_URL}/Login", json=B1_LOGIN).raise_for_status()
rate_date = data["date"].replace("-", "") # YYYYMMDD
try:
for iso_code, rate in data["rates"].items():
b1_code = CURRENCY_MAP.get(iso_code)
if not b1_code:
continue
# Direct rate setting: local currency (AUD) per 1 unit of foreign
direct_rate = round(1 / rate, 6)
session.post(
f"{B1_URL}/SBOBobService_SetCurrencyRate",
json={"Currency": b1_code, "Rate": str(direct_rate), "RateDate": rate_date},
).raise_for_status()
print(f"{b1_code} {rate_date}: {direct_rate}")
finally:
session.post(f"{B1_URL}/Logout")
if __name__ == "__main__":
load_into_b1(fetch_rba_rates())
Direct or Indirect Rates?
Check your setting under Administration → System Initialization → Company Details → Basic Initialization. The script above assumes direct rates. If your company is set to indirect rates, post rate without inverting it.
Scheduling
Run the script with cron (Linux) or Windows Task Scheduler at 5 PM Sydney time on weekdays. Keep the API key and B1 password in environment variables or your server's secret store rather than in the script.
Before You Go Live
- Test in a demo company. Run the script against
SBODEMOAUor a copy of your company first and compare a few rates against the RBA's published table. - Safe to re-run.
SetCurrencyRatereplaces the rate for that currency and date, so a job that runs twice won't create duplicates. - Alerting. If the job fails, someone should know before month-end. Send the script's output to email or Teams, and check the API's
/statusendpoint 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 job as soon as rates arrive.
Ready to automate your B1 exchange rates? Get your free API key and try the script against a demo company today.
Data sourced from the Reserve Bank of Australia. We are not affiliated with or endorsed by the Reserve Bank of Australia.
SAP and SAP Business One are trademarks of SAP SE. Code samples are provided as starting points. Test them in a sandbox or non-production environment and review them with your B1 partner before using them in production.
For API documentation, visit Exchange Rates API Docs