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
| Domain | Stored Ledger | Display & Settlement |
|---|---|---|
| Wallet Balances | Exact decimal in Base Currency (e.g. USD) | Converted dynamically at session rate |
| Orders & Credits | Order currency snapshot + base debit | Refunds reverse against immutable snapshot |
| Promotions | Rules authored once in base currency | Rendered 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.