2026-11-16 · 6 min read

Multi-Currency Storefront Architecture: Geo-IP & Base-Currency Ledgers

Changing currency symbols is easy; keeping wallets, promotions, and refunds reconciled across exchange rates requires ledger discipline.

1. Edge Country Mapping & Cookie Persistence

  • Read Cloudflare CF-IPCountry at middleware level to map deterministic defaults (US→USD, KR→KRW, ID→IDR, VN→VND, fallback USD).
  • Immediately persist a 1-year cookie when the visitor manually changes locale or currency—never override explicit intent.
  • Default new channels to English (en) so international paid traffic never lands on an unreadable screen.

2. Why Every Balance Must Live in One Base Currency

DomainStored LedgerDisplay & Settlement
Wallet BalancesExact decimal in Base Currency (e.g. USD)Converted dynamically at session rate
Orders & CreditsOrder currency snapshot + base debitRefunds reverse against immutable snapshot
PromotionsRules authored once in base currencyRendered cleanly in active local currency

3. Fragment Caching & Runtime Dependency Checks

Avoid blind full-page caching on currency-aware pages and validate intl formatting extensions during startup health checks to eliminate silent 500 failures.

Planning a similar architecture?

Share your core workflow on Telegram or configure a scope estimate to receive a clear architecture & delivery plan.

Estimate Telegram ↗