Skip to content

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 ​

  1. 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).
  2. Enabled currencies - up to 20 additional currencies your storefront can display and accept. Managed via the Store API.
  3. Exchange rates - updated daily from live foreign exchange data.
  4. Conversion margin - an optional percentage markup applied on top of the exchange rate (e.g. 2.5 adds 2.5% to converted prices).
  5. Rounding - controls how converted prices are rounded for display.

Configuring currencies ​

Enable additional currencies and set conversion options through the Store API:

bash
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 ​

ValueDescription
noneNo rounding (exact conversion)
upRound up to next whole unit
downRound 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:

typescript
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:

bash
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 priceStored valueCurrency
$19.991999USD
€14.501450EUR
¥15001500JPY

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.