Multi-Currency
OneFive supports selling in multiple currencies from a single project. Prices are stored in your base currency and automatically converted using daily exchange rates.
How it works
- Base currency - set when you create your project (e.g.
USD). All variant prices are stored in this currency as integers in the smallest unit (cents). - Enabled currencies - up to 20 additional currencies your storefront can display and accept. Managed via the Store API.
- Exchange rates - updated daily from live foreign exchange data.
- Conversion margin - an optional percentage markup applied on top of the exchange rate (e.g.
2.5adds 2.5% to converted prices). - Rounding - controls how converted prices are rounded for display.
Configuring currencies
Enable additional currencies and set conversion options through the Store API:
curl -X PATCH https://api.hydrajs.dev/v1/store \
-H "Authorization: Bearer sk_your_key" \
-H "Content-Type: application/json" \
-d '{
"enabled_currencies": ["USD", "EUR", "GBP", "CAD"],
"currency_conversion_margin": 2.0,
"currency_rounding": "up"
}'Rounding options
| Value | Description |
|---|---|
none | No rounding (exact conversion) |
up | Round up to next whole unit |
down | Round down to nearest whole unit |
Direct per-currency pricing
For markets where you want exact control instead of automatic conversion, set prices directly on each variant using currency_prices:
const { data: product } = await hydra.products.create({
title: 'Classic T-Shirt',
variants: [
{
title: 'Default',
price: 2999,
currency_prices: {
EUR: 2799,
GBP: 2399
}
}
]
})When a variant has a currency_prices entry for the requested currency, that value is used instead of automatic conversion.
Fetching prices in a currency
Use the currency query parameter on product endpoints to get prices in the customer's preferred currency:
curl "https://api.hydrajs.dev/v1/products?currency=EUR" \
-H "Authorization: Bearer pk_your_key"The response includes converted prices alongside the base currency values.
All amounts are integers
OneFive stores all monetary values as integers in the smallest currency unit (cents for USD/EUR, pence for GBP, etc.). This avoids floating-point rounding errors.
| Display price | Stored value | Currency |
|---|---|---|
| $19.99 | 1999 | USD |
| €14.50 | 1450 | EUR |
| ¥1500 | 1500 | JPY |
For zero-decimal currencies like JPY, the stored value equals the display value.
Best practices
- Set a conversion margin to absorb exchange rate fluctuations between conversion and settlement.
- Use direct pricing for important markets. Automatic conversion is convenient, but strategic markets deserve hand-set prices.
- Display the currency code. Always show the ISO 4217 code (USD, EUR) alongside the amount so customers know which currency they are paying in.