Home Documentation Pricing API Status Blog About FAQ Support

Currency API for Ecommerce — Multi-Currency Checkouts

Add live multi-currency pricing to your store. AllRatesToday provides real-time mid-market exchange rates for Shopify, WooCommerce, custom carts, and headless commerce.

Selling internationally? Showing customers prices in their local currency lifts conversion — but only if the rates are fresh. AllRatesToday gives you a real-time mid-market exchange-rate API that drops cleanly into any storefront, headless commerce setup, or custom cart.

Where it fits in your stack

The pattern that works

  1. Detect the visitor's currency (geo, browser locale, or cookie).
  2. Fetch /v1/rates?source=YOUR_BASE&target=EUR,GBP,... once per cache window (60s–5min).
  3. Display all prices client-side using the cached rate map.
  4. At checkout, charge in your store's base currency. Display the converted amount as a "guide" — your payment processor handles final FX.
Display ≠ settlement. Always make it clear to the buyer that the converted price is indicative and the actual charge depends on their card's FX rate.

Code: a Next.js server route

// app/api/rates/route.ts (Next.js App Router)
import { NextResponse } from 'next/server';
import AllRatesToday from '@allratestoday/sdk';

const client = new AllRatesToday({ apiKey: process.env.ALLRATES_API_KEY });

export const revalidate = 60; // cache for 60s

export async function GET() {
  const data = await client.latest({
    base: 'USD',
    symbols: ['EUR', 'GBP', 'JPY', 'CAD', 'AUD'],
  });
  return NextResponse.json(data);
}

Code: a Shopify Liquid + JS pattern

<!-- shopify section: currency-switcher.liquid -->
<script>
  fetch('/apps/proxy/rates') // your app proxy hits AllRatesToday
    .then(r => r.json())
    .then(({ rates }) => {
      document.querySelectorAll('[data-price-usd]').forEach(el => {
        const usd = parseFloat(el.dataset.priceUsd);
        const cur = window.SHOP_CURRENCY;
        el.textContent = (usd * rates[cur]).toFixed(2) + ' ' + cur;
      });
    });
</script>

Why ecommerce teams pick AllRatesToday

FAQ

Do I need to charge in the buyer's currency?

Not necessarily. Many stores display in local currency but settle in their base currency, letting the payment processor handle conversion at the card network rate.

How often should I refresh rates for ecommerce?

60 seconds to 5 minutes is plenty for display purposes. Mid-market rates don't move enough between page views to justify per-request fetches.

Can it handle Black Friday traffic?

With proper caching, even our Small plan covers most stores. For very high traffic, the Large plan (100,000 req/mo) plus 5-minute caching scales to millions of page views.

Add multi-currency in an afternoon

Get free API key Read integration docs

Related