# Currencies

Your store keeps its prices in its own currency: Australian dollars, euros,
yen, or any of the currencies below. OpenReceive does the conversion. When a
customer checks out, OpenReceive turns the order total into a Bitcoin amount at
the current exchange rate and puts that amount on the invoice. You do not need
a currency plugin, an exchange-rate setting or a second price list.

## How the conversion works

1. The order total stays in your currency, for example A$49.95. Your store or
   app still owns the price.
2. OpenReceive looks up the price of Bitcoin in that currency. The primary
   source is CoinGecko's public price API, and the fallback is a mirror on
   openreceive.org. A rate is reused for at most 60 seconds.
3. It divides the total by that price and rounds up to a whole satoshi. The
   invoice is for that exact amount of Bitcoin, and the quote it used (the
   currency, the total and the rate) is saved with the payment.
4. The customer pays that amount. If they pay in a stablecoin through a swap
   provider, they send the amount the provider quotes for that invoice.
   Either way the payment lands in your wallet in Bitcoin over Lightning.

The amount is fixed when the invoice is created. If the payer comes back after
the invoice has expired, a new invoice is created at the rate of that moment.

OpenReceive never converts the Bitcoin you receive back into your currency, and
it charges no conversion fee. Your wallet holds Bitcoin. If you want local
currency, withdraw or sell it from your wallet.

If neither price source answers, or the newest rate is too old, OpenReceive
refuses to create the invoice and the payer can try again in a moment. It never
guesses a rate.

## Supported currencies

<!-- generated:price-currencies -->
<!-- Generated by tools/docs/generate-spec-tables.mjs from spec/. Edit the spec, then rerun the generator; never edit this block by hand. -->

The price feeds quote these 45 currencies:

| Code | Currency |
| --- | --- |
| `AED` | United Arab Emirates Dirham |
| `ARS` | Argentine Peso |
| `AUD` | Australian Dollar |
| `BDT` | Bangladeshi Taka |
| `BHD` | Bahraini Dinar |
| `BMD` | Bermudan Dollar |
| `BRL` | Brazilian Real |
| `CAD` | Canadian Dollar |
| `CHF` | Swiss Franc |
| `CLP` | Chilean Peso |
| `CNY` | Chinese Yuan |
| `CZK` | Czech Koruna |
| `DKK` | Danish Krone |
| `EUR` | Euro |
| `GBP` | British Pound |
| `GEL` | Georgian Lari |
| `HKD` | Hong Kong Dollar |
| `HUF` | Hungarian Forint |
| `IDR` | Indonesian Rupiah |
| `ILS` | Israeli New Shekel |
| `INR` | Indian Rupee |
| `JPY` | Japanese Yen |
| `KRW` | South Korean Won |
| `KWD` | Kuwaiti Dinar |
| `LKR` | Sri Lankan Rupee |
| `MMK` | Myanmar Kyat |
| `MXN` | Mexican Peso |
| `MYR` | Malaysian Ringgit |
| `NGN` | Nigerian Naira |
| `NOK` | Norwegian Krone |
| `NZD` | New Zealand Dollar |
| `PHP` | Philippine Peso |
| `PKR` | Pakistani Rupee |
| `PLN` | Polish Zloty |
| `RUB` | Russian Ruble |
| `SAR` | Saudi Riyal |
| `SEK` | Swedish Krona |
| `SGD` | Singapore Dollar |
| `THB` | Thai Baht |
| `TRY` | Turkish Lira |
| `TWD` | New Taiwan Dollar |
| `UAH` | Ukrainian Hryvnia |
| `USD` | US Dollar |
| `VND` | Vietnamese Dong |
| `ZAR` | South African Rand |
<!-- /generated:price-currencies -->

You can also set prices in Bitcoin itself (`BTC` or `SATS`). Those amounts go
on the invoice as they are, with no rate lookup.

## Store plugins

Store plugins read the currencies from your store's own settings. There is
nothing to set up in OpenReceive:

| Store | Currencies OpenReceive accepts |
| --- | --- |
| WooCommerce | The store currency (WooCommerce → Settings → General) |
| Easy Digital Downloads | The store currency (Downloads → Settings → Payments → Currency) |
| PrestaShop | The shop's active currencies, limited to the ones ticked for OpenReceive under Payment → Preferences |
| Magento / Adobe Commerce | Every store view's base and allowed display currencies. When the shopper's display currency is not on the list, the order is charged in the base currency |
| Shopware | The currencies of your sales channels |
| HikaShop | The published currencies |
| Paymenter | The currencies set up in Paymenter |
| FOSSBilling | The currencies set up in FOSSBilling, limited to the ones ticked under the gateway's accepted currencies |
| Odoo | The companies' currencies and every other active currency, for website pricelists |
| Medusa | Every currency on the list above, the store's own first |
| Vendure | Every currency on the list above, the channels' own first |
| nopCommerce | The primary store currency and the published currencies. An order in a currency the feeds do not quote is charged in the primary currency |
| Sylius | Each channel's base currency, plus any in the bundle's `price_currencies` |
| BTCPay Server | BTCPay converts with its own rate settings |

An order is always charged in the currency it was placed in. If your store
sells in Australian dollars, the invoice is priced from the BTC/AUD rate,
never through US dollars.

A store can sell in a currency that is not on the list above. Every plugin
then leaves OpenReceive out of the checkout for an order in that currency, so a
customer never picks a method that cannot price their order. Medusa has no way
to hide a payment provider by currency, so there the payment step refuses with
the reason instead. Each plugin's `doctor` names the store currencies that are
not on the list.

nopCommerce reads your currencies when the app starts. After you add one,
restart the app.

## Frameworks and your own code

With a framework package, you name the currencies your app sells in.
OpenReceive accepts checkouts in those currencies only, and uses `USD` when you
name none:

| Stack | Setting |
| --- | --- |
| Node, Next.js, Express, Fastify, NestJS, Nuxt | `createOpenReceive({ priceCurrencies: ["AUD", "USD"] })` |
| Rails | `price_currencies` |
| Python (Django, FastAPI, Flask) | `price_currencies=["AUD", "USD"]` |
| PHP and Laravel | the `Service` constructor's `$priceCurrencies`, or `price_currencies` in `config/openreceive.php` |
| Symfony | `openreceive.price_currencies` |
| ASP.NET Core | `PriceCurrencies` |

Your server passes each order's real currency and total, for example
`amount: { currency: "AUD", value: "49.95" }`. An order in a currency you did
not name is refused, so a mistake shows up as an error instead of a wrongly
priced invoice. So is a currency that is not on the list above: the error says
that the price feeds do not quote it, and the payer is not asked to try again. [Price Feeds](/guides/price-feeds.md) covers the feed itself: sources,
caching and how to replace the URLs.

## How we test it

Tests use a fixed price list instead of the live feeds: 1 BTC is 50,000.00 US
dollars or 80,000.00 Australian dollars. Every engine checks that list against
the same shared file, and the store tests place real orders in Australian
dollars. The WooCommerce browser test, for example, buys a A$5.00 item and
checks that the invoice is for 6,250 sats. Read as US dollars, it would be
10,000.
