Skip to content
SaaS billing use case

Currency conversion for invoicing and SaaS billing

Set localized price tables, invoice customers in their own currency and report revenue in your base currency – with the rate and date stored on every invoice.

Last updated: · fxapi team

Selling software internationally means customers expect a price list, a checkout and an invoice in their own currency – while your finance team wants revenue reported in one base currency. Currency conversion for invoicing ties both together: one consistent source of exchange rates, applied at defined moments, with the rate stored on every document. fxapi provides mid-market rates for 190+ currencies, any base currency and daily history back to 1999, so you can build localized pricing, multi-currency invoices and base-currency reporting on one API.

Three places SaaS billing needs exchange rates

1. Localized price tables

Most SaaS companies don’t convert list prices on every page view. They publish fixed price points per currency – $49, €45, £39 – and review them a few times a year. Exchange rates drive that review: compare the current and average rate with the rate your price table was built on, and adjust when the gap gets too large. The average exchange rates API smooths out short-term noise for this decision.

2. Invoices in the customer’s currency

Usage-based charges, overages, one-off services and reseller invoices often start in your base currency and need converting at invoice time. Use the rate for the invoice date and print it on the invoice when helpful, for example “1 EUR = 1.0850 USD (reference rate, 2026-10-07)”.

3. Revenue reporting in your base currency

Your MRR dashboard and your books need one currency. Convert each invoice at its transaction-date rate, or apply a monthly average if your policy allows it. The details are covered in exchange rates for accounting.

A note on tax. VAT, GST and sales tax rules – including whether tax amounts must also be shown in a local currency and which rate source applies – differ by country. fxapi supplies exchange rates; your tax engine and tax advisor determine what the invoice must contain.

Which endpoints fit which billing step

Billing stepEndpointPlan
Review localized price points/v1/average (period=month or quarter) and /v1/latestAll plans
Convert an invoice amount on the invoice date/v1/convert with value and dateBasic and up
Look up the rate for any past date/v1/historicalAll plans
Format amounts and symbols/v1/currencies (symbol, decimal_digits)All plans
Monthly revenue conversion/v1/average with format=csvAll plans

An invoicing workload is light: even a few thousand invoices a month fit Basic’s 15,000 requests if you cache one rate set per day instead of calling once per invoice. See the pricing page.

Workflow: from price list to revenue report

  1. Define your base currency (for example USD) and the customer currencies you invoice in.
  2. Build the price table. For each plan, set a price point per currency using a recent monthly average from /v1/average, then round to a clean number.
  3. Generate invoices. For each line not already priced in the customer’s currency, convert at the invoice-date rate. Cache the day’s rates so all invoices on that date use the same values.
  4. Store the evidence. Save currency, amount, base_amount, rate, rate_date and the API timestamp on the invoice record.
  5. Report revenue. Sum base-currency amounts for dashboards; for statutory reporting, follow your accounting policy (transaction-date or average rates).
  6. Review price tables quarterly. Compare the rate behind each price point with the latest quarterly average and adjust when drift exceeds your threshold.

Code example: convert an invoice in PHP

Plain PHP with cURL and the key in the apikey header. /v1/convert requires the Basic plan or higher; on Free, fetch /v1/historical and multiply instead.

<?php
function convertForInvoice(float $amount, string $from, string $to, string $date): array
{
    $query = http_build_query([
        'base_currency' => $from,
        'currencies'    => $to,
        'value'         => $amount,
        'date'          => $date, // invoice date, YYYY-MM-DD (must be a past date)
    ]);

    $ch = curl_init("https://api.fxapi.com/v1/convert?$query");
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER     => ['apikey: ' . getenv('FXAPI_KEY')],
        CURLOPT_TIMEOUT        => 10,
    ]);
    $body   = curl_exec($ch);
    $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    if ($status !== 200) {
        throw new RuntimeException("fxapi returned HTTP $status");
    }

    $json      = json_decode($body, true);
    $converted = $json['data'][$to]['value'];

    return [
        'currency'      => $to,
        'amount'        => round($converted, 2), // use decimal_digits for non-2-decimal currencies
        'base_currency' => $from,
        'base_amount'   => $amount,
        'rate'          => $converted / $amount,
        'rate_date'     => $date,
    ];
}

// Overage charge of 120.00 USD invoiced to a customer billed in EUR
$line = convertForInvoice(120.00, 'USD', 'EUR', '2026-10-07');

Store the returned array with the invoice line. More PHP patterns in the PHP guide.

Pitfalls and best practices

  • Don’t silently re-convert subscriptions. Customers notice when a “€45” plan becomes €46.12 next month. Keep fixed price points and change them deliberately, with notice.
  • Round once, at the right level. Decide whether you round per line or on the total, and apply it consistently, using decimal_digits from /v1/currencies. See currency rounding and precision.
  • Use one rate per day. Cache the day’s rates so two invoices issued minutes apart don’t use different values.
  • Keep the original amount. Store the customer-currency amount and the base-currency amount; never overwrite one with the other.
  • Remember the “past date” rule. /v1/historical and the date parameter accept dates up to yesterday. For same-day invoices, use the cached /v1/latest rate and store its last_updated_at.
  • Keep the key server-side. Billing runs on your backend; the API key should never reach a browser or customer-facing PDF generator running client-side.

Ship multi-currency invoicing

Prototype price tables and historical lookups on the Free plan, then switch to Basic when you want /v1/convert and hourly updates. Compare plans on the pricing page or create a free API key and convert your first invoice today.

Everything on this page runs on the fxapi foreign exchange rates API: one key, 190+ currencies, data back to 1999.

Frequently asked questions

Should SaaS prices be converted live or set per currency?
Most SaaS companies set fixed price points per currency and review them periodically using average rates. Live conversion suits usage-based line items or one-off invoices where the amount isn’t known in advance.
Which exchange rate should appear on an invoice?
Typically the rate for the invoice date. Fetch it with /v1/historical or /v1/convert with a date, and store the rate, date and timestamp with the invoice. Your tax advisor can confirm whether a specific official rate is required in your jurisdiction.
How do I report revenue in my base currency?
Convert each invoice at its transaction-date rate, or use a monthly average from /v1/average if your accounting policy allows it. Keep the original currency amount as well.
Can fxapi calculate VAT or sales tax?
No. fxapi provides exchange rates only. Calculate tax in your billing or tax engine, then use fxapi for any currency conversion the invoice needs.
Which plan do I need for invoicing?
Historical rates are available on every plan. The /v1/convert endpoint, which returns converted amounts directly, starts at Basic ($9.99 per month).
Free plan · no credit card

Get your free exchange rate API key

300 requests a month, latest and historical rates, fluctuation and averages – free forever. Upgrade when you need faster updates or more requests.