DEV Community

allratestoday
allratestoday

Posted on Originally published at allratestoday.com

Loading ECB, HMRC and Customs Exchange Rates into NetSuite: REST, CSV and Rate Types

NetSuite's built-in Currency Exchange Rate Integration fills the exchange rate table from a market data provider once a day. That works until a regulation names the publisher: the ECB rate for EU VAT, the HMRC monthly rate, a central bank's month-end rate for statutory accounts. Then the number in NetSuite has to be that institution's rate, dated with the day that institution set it, and the daily provider feed doesn't give you that.

This post covers two ways to load official rates yourself (REST and CSV import), the direction trap that breaks most first attempts, and what NetSuite's exchange rate types can and can't do if you want customs rates next to your accounting rates. The rates come from the AllRatesToday central bank and customs endpoints. The full guide is at allratestoday.com/docs/integrations/netsuite/.

All of this needs the Multiple Currencies feature turned on in NetSuite.

Route 1: the currencyrate REST record

SuiteTalk REST exposes exchange rates as the currencyrate record:

POST /services/rest/record/v1/currencyrate
Enter fullscreen mode Exit fullscreen mode

The fields you set:

  • baseCurrency and transactionCurrency: internal IDs of the two currencies in your account
  • exchangeRate: base currency units per 1 unit of the transaction currency
  • effectiveDate
  • externalId (optional)

SuiteScript creates the same record with record.create({ type: 'currencyrate' }).

One thing to know before you design a sync job: rates are added, not edited. A new rate is a new record with a new effective date. So there's no "update today's row" step; each table the bank issues becomes new records.

Here is the fetch-and-map step in Python. It asks for the official ECB rate for USD to EUR on the table in force on 2026-11-12:

import requests

API = "https://allratestoday.com/api/v1/central-bank"
HEADERS = {"Authorization": "Bearer art_live_your_key"}

# Official ECB rate for USD -> EUR on the table in force on 2026-11-12
r = requests.get(f"{API}/ecb/2026-11-12", params={"source": "USD", "target": "EUR"}, headers=HEADERS).json()

record = {
    "baseCurrency": {"id": "1"},          # internal ID of EUR in your account
    "transactionCurrency": {"id": "2"},   # internal ID of USD
    "exchangeRate": r["rate"],            # base currency units per 1 transaction currency
    "effectiveDate": r["rate_date"],      # the bank's own date, YYYY-MM-DD
    "externalId": f"ecb-USD-EUR-{r['rate_date']}",
}
# POST https://<account>.suitetalk.api.netsuite.com/services/rest/record/v1/currencyrate
# with OAuth 2.0 (or token-based) authentication and Content-Type: application/json
Enter fullscreen mode Exit fullscreen mode

The internal IDs ("1", "2") are placeholders; look up the IDs of EUR and USD in your own account.

The direction trap

NetSuite wants base per foreign: how many units of the base currency one unit of the transaction currency buys. The ECB and EU customs offices quote the other way round, foreign per 1 EUR. If you copy the ECB's USD figure straight into exchangeRate for a EUR-base subsidiary, every converted amount is wrong.

The fix in the code above is in the query string: ask for source=USD&target=EUR. The API returns the inverse of the bank's quote and flags it in the response with "derived": true, "method": "inverse", so it's visible later that the number was computed from the bank's table rather than printed in it.

Use the bank's date, not the run date

effectiveDate is set from the response's rate_date, the date the bank put on its table. If your job runs late, or you're backfilling, the record still lands on the correct date. Putting the source and date into externalId (ecb-USD-EUR-2026-11-12) means anyone looking at the record later can see where the number came from without opening the integration code.

Route 2: no code, CSV import

If you don't want to maintain a script, NetSuite's CSV import takes exchange rates directly:

Setup > Import/Export > Import Tasks > Import CSV Records, record type Accounting, then Currency Exchange Rates.

The importable fields are:

  • Currency
  • Exchange Rate
  • Effective Date
  • Base Currency (OneWorld)
  • Exchange Rate Type (when that feature is on)

The API can hand you a whole table as CSV, which you then map to those fields in the import's field-mapping step. For example, the customs table in force for goods cleared in the UK (HMRC monthly rates):

# Customs table in force for goods cleared in the UK (HMRC monthly rates), as CSV
curl "https://allratestoday.com/api/v1/customs/GB/latest?format=csv" \
  -H "Authorization: Bearer art_live_your_key" -o hmrc-latest.csv
Enter fullscreen mode Exit fullscreen mode

Like the REST route, the import adds rates; it does not change existing ones.

Customs rates: what a separate rate type can and can't do

NetSuite OneWorld has Currency Exchange Rate Types (Lists > Accounting > Currency Exchange Rate Types). The obvious idea is a Customs type holding the customs authority's table next to the default type. Before you set that up, two documented limits decide whether it helps:

  1. The automatic provider update fills just the default type. Your Customs type is filled by you, through REST or CSV as above.
  2. Transactions use the default type. Types other than the default are used for intercompany cross charges.

Also note that the feature can't be switched off once enabled.

In practice, that means customs rates in NetSuite are usually kept as reference data for landed cost and broker reconciliation, loaded by the REST or CSV route, rather than as the rate transactions post at. If your plan was "post customs entries at the customs rate automatically", check those two limits against your process first.

Keep the evidence

Exchange rates get questioned at audit time, so build the job so that each number can be traced:

  • Book under the response's rate_date, and put the source and date in externalId.
  • US CBP and China customs tables are built by rule, and the response says so in a basis field.
  • History on paid plans lets you rebuild a past period when an auditor asks what rate applied on a given date.

Links

Rates are redistributed from each institution's own publication. They are reference rates for accounting, tax and compliance, not dealing quotes.

Top comments (0)