Skip to main content
Every Fluid order stores its totals twice. Once in the currency the shopper paid in, and once in US dollars, Fluid’s base currency, in the fields that end in _in_base. To report revenue across countries and currencies, add up amount_in_base. Every order’s amount_in_base is in US dollars, so the sum is too.

The two sets of amounts

The base currency is Fluid’s, not the company’s. A company that sells only in euros still gets its _in_base amounts in US dollars.

How an order is converted

When an order is created, Fluid records the exchange rate between US dollars and the order’s currency in base_to_currency_rate: how many units of the order’s currency make one US dollar. Each base amount is the order amount divided by that rate, rounded to the cent. For example, a German shopper pays €92.00 when the euro rate is 0.92:
The rate is set once, when the order is created, and never changes. So an order’s amount_in_base stays the same as exchange rates move, and last quarter’s revenue reads the same today as it did then.

Report revenue across currencies

  • Sum amount_in_base, not amount. Adding amount across orders mixes currencies, so €92 and ¥15,000 add up to a meaningless 15,092.
  • Don’t convert with today’s rate. Use the base amounts the order already has. They were converted at the rate in effect when each order was placed.
  • To show a total in another currency, convert the US dollar sum once, at the end. Fluid’s own analytics work this way. They add up the orders’ amount_in_base, then convert.
  • Orders in the same currency can be added directly. When every order you’re adding has the same currency_code, their amount values add up correctly in that currency.
Amounts in API responses can be decimal strings. Parse them with a decimal type, not a floating-point number, before you add them.

Edited orders

The base amounts describe the order as it was placed. An order edited after checkout keeps its original amount_in_base. Its new total is current_amount, in the order’s own currency, and has no US dollar field. To report an edited order’s new total in US dollars, divide current_amount by the order’s base_to_currency_rate, the same rate its base amounts used. Don’t use a current exchange rate.

Where you’ll find these fields

The order responses in the API reference carry currency_code, amount_in_base, and, on most of them, base_to_currency_rate: Each page lists the exact fields that operation returns.
Some generated reference pages describe amount_in_base as being in “the company’s base currency”. It’s in Fluid’s base currency, US dollars, for every company.