Multi-Currency Pricing for E-commerce: How to Show Local Prices Without Surprises
6 min read
Multi-currency pricing means showing and charging shoppers in their own currency instead of making them do the math. Done well, it lifts trust at checkout. Done badly, it produces prices that drift, totals that change between the cart and the receipt, and refunds that don't match the original charge.
The core decision is not which API to call. It is which price is the source of truth, when the exchange rate gets frozen, and who absorbs the movement in between. This guide walks through the three common models, how to lock a rate at checkout, and how to round prices so they look right and stay exact.
Three models for multi-currency pricing
Most stores end up with one of these approaches, or a mix.
| Model | How it works | Strength | Weakness |
|---|---|---|---|
| Fixed price lists | You set an explicit price per currency (49.00 USD, 45.00 EUR, 39.00 GBP) | Predictable, marketing-friendly | Manual upkeep; prices go out of sync with the market |
| Live conversion | You hold one base price and convert on demand | Always consistent with the market | Prices change from visit to visit |
| Hybrid | Convert from a base price, then snap to a price point and refresh on a schedule | Stable-looking prices that follow the market | More logic to build and test |
Fixed price lists suit a small catalog and a few currencies. Once you support dozens of currencies or thousands of SKUs, hand-maintained lists stop scaling. That is where conversion from a base price makes sense.
The hybrid model is the usual sweet spot. You compute local prices from a live rate, round them to a clean price point, and only recompute when the rate has moved enough to matter, or on a fixed schedule such as hourly.
Display price versus charged price
A shopper sees a price on a product page, adds to the cart, and pays a few minutes later. Treat these as separate moments.
- Display price is indicative. It can come from a cached rate and be recomputed regularly.
- Quoted price is what the cart or checkout session shows. Freeze it when the session starts.
- Charged price is what you actually collect. It must equal the quoted price, not a fresh conversion.
The rule is simple: once a customer has seen a total in checkout, never silently recalculate it. Store the rate you used on the order, so you can explain, audit and refund it later.
A useful order snapshot contains:
- the base amount and base currency
- the quote currency and the rate, stored as a string or decimal
- the rate's
as_oftimestamp and itsstatus - the margin you applied, if any
- the final rounded amount in the quote currency
Refunds are then a lookup, not a recalculation. If you refund in the currency the customer paid, you never need to ask what the rate "would have been."
Converting a catalog price step by step
GetRatesAPI returns each rate as a JSON string, with its observation time and freshness. Here is an example response for one pair (the numbers are illustrative):
{"base":"USD","quote":"EUR","rate":"0.9213","as_of":"2026-01-02T10:00:00Z","status":"fresh","type":"direct"}
Fetching it looks like this. See the current rate endpoint docs for the full reference.
curl -H "Authorization: ApiKey $GETRATESAPI_KEY" \
"https://api.getratesapi.com/v1/rates/USD/EUR"
Because the rate is a string, parse it into a decimal type, not a float. In Python, that means Decimal:
import os
import requests
from decimal import Decimal, ROUND_CEILING
def fetch_rate(base: str, quote: str) -> dict:
resp = requests.get(
f"https://api.getratesapi.com/v1/rates/{base}/{quote}",
headers={"Authorization": f"ApiKey {os.environ['GETRATESAPI_KEY']}"},
timeout=5,
)
resp.raise_for_status()
return resp.json()
def local_price(base_amount: str, rate: str, margin: str = "0.02") -> Decimal:
raw = Decimal(base_amount) * Decimal(rate) * (Decimal(1) + Decimal(margin))
# Snap up to the next .99 price point
return (raw + Decimal("0.01")).to_integral_value(rounding=ROUND_CEILING) - Decimal("0.01")
data = fetch_rate("USD", "EUR")
price = local_price("49.00", data["rate"])
print(price) # 46.99 with the example rate above
Walk through the example numbers: 49.00 × 0.9213 = 45.1437. Add a 2% buffer and you get 46.0466. Snap to the next .99 price point and the shopper sees 46.99.
The same logic in JavaScript, keeping the snapshot you will store on the order:
async function quote(base, target, amount) {
const res = await fetch(`https://api.getratesapi.com/v1/rates/${base}/${target}`, {
headers: { Authorization: `ApiKey ${process.env.GETRATESAPI_KEY}` },
});
if (!res.ok) throw new Error(`rate lookup failed: ${res.status}`);
const r = await res.json();
return {
baseAmount: amount,
baseCurrency: base,
quoteCurrency: target,
rate: r.rate, // keep as a string
asOf: r.as_of,
status: r.status,
type: r.type,
};
}
Do the multiplication with a decimal library on the server side and keep the rate as a string until then. The rounding article covers why floats cause cent-level drift.
If you only need an exact conversion for a single amount, the convert endpoint returns a converted_amount without any multiplication on your side. Results are not rounded, so you still choose how to round for display.
Margins, rounding and price points
Three rules keep local prices sane.
Respect each currency's minor units
Not every currency has two decimals. JPY has none in everyday use, and some currencies use three. Round to the right number of decimals for each currency, and keep a small table in your code rather than assuming 2.
Add a buffer, not a guess
Rates move between the moment you compute a price and the moment a customer pays. A small margin, such as 1% to 3%, can absorb that movement and any conversion cost on your side. Make it a configuration value per currency or per market, and record it on the order. This is a business decision about your own costs, not a recommendation about the market.
Round last, and round once
Do all arithmetic at full precision, then round a single time at the end. Rounding at each step compounds errors. If a cart has several lines, decide whether you round per line or on the total, apply that rule consistently, and show the same total in the cart, the confirmation email and the invoice.
For price points, choose a rule per currency:
- 2-decimal currencies: end in .99 or .00
- JPY and similar: round up to the nearest 10 or 100
- High-value items: round to a whole unit and drop the cents
Handling stale rates and failures
Every rate from GetRatesAPI carries as_of and a status of fresh or stale. Fiat rates are flagged stale after 5 minutes, and crypto after 1 minute. Stale rates are still returned, so your code decides what to do.
A sensible policy for a store:
- Product pages: show the price even if the rate is stale, since it is only indicative.
- Starting checkout: if
statusisstale, prefer your last fresh stored rate, or retry briefly. - After retries fail: fall back to the base currency, or to your last known local price list, rather than showing nothing.
Check type too. A derived rate is built through USD, EUR or BTC when no market quotes the pair directly, and its as_of is the oldest of its inputs. That is fine for pricing, but it is worth knowing when you debug a number that looks slightly off.
For errors, match on the code field in the JSON body, not on the message text. rate_limit_exceeded includes retry_after_seconds, and temporarily_unavailable is a good candidate for a short retry with backoff. unsupported_pair and invalid_asset_symbol usually mean a bad configuration and should not be retried. See the error reference for the full list.
Fetch once, price many
You don't need a request per product, or even per shopper. A catalog priced in one base currency needs one rate per target currency, and those rates can be shared by every visitor.
- Use
GET /v1/rates/USD?quote=EUR,GBP,JPYto get up to 20 quotes against one base in a single call. It costs 1 request unit, and unsupported quotes are listed separately instead of failing the whole call. - Cache the result for a short time and refresh it on a schedule. The caching guide shows how to do this without serving old prices.
- Check supported codes for free with
/v1/assets/fiat. Catalog calls are not billed.
With a handful of currencies refreshed every few minutes, even a modest monthly quota goes a long way. Compare plans on the pricing page and check what you have used with GET /v1/account/usage.
Try it with your own catalog
Pick your base currency, list the five or six markets you want to add, and run the conversion for a handful of real products. You can test every endpoint in the dashboard playground, with no credit card needed on the free plan. Create a free account to get an API key, then read the REST documentation to wire it into your checkout.