Skip to content

Use cases_

Dynamic pricing & FX

Price in local currency at a live central-bank rate.

Present prices in the buyer’s own currency, converted at a rate you can attribute to a central bank, with staleness reported. Reconcile historical orders at the rate that actually applied on the day.

Why it works_

Local prices, defensible rates

01

Central-bank rates

No reseller markup; each rate names its source and date.

02

Money-safe conversion

bcmath at scale 12, strings end to end — never a float.

03

Historical reconciliation

The rate as it stood on any past date, on the Business tier.

The data behind it

One call, these response blocks.

This page maps to these blocks of the same response every other page reads:

  • Live FX
  • Currency
dynamic-pricing-fx.sh
curl "https://api.localesense.com/v1/fx?base=USD" \
  -H "Authorization: Bearer ls_live_..."
In practice

What your code sees, per request.

The sample on the right is the shape of the real response for a visitor in Karachi — every value attributable, nothing guessed. Point the same call at any of the 197 markets.

Try it live in the docs
GET /v1/self 200 OK · sample
  • FX vs USD 278.02 · SBP · today
  • Currency PKR · 2dp · Rs 123,456.78

Keep exploring_

Related use cases

FAQs

Dynamic pricing & FX — frequently asked

How do I show prices in a visitor's local currency?

Detect their currency from the same call that localizes the rest of the checkout, then convert your base price at a live central-bank rate. Amounts are strings converted in bcmath, so the figure you display is exact, not a rounded float.

Can I reconcile past orders at the rate that applied that day?

Yes — on the Business tier you can query the historical rate for any past date, so refunds, chargebacks and accounting reconcile against the rate that actually applied on the order date, not today's.

Is a central-bank rate the right one for pricing?

It is the most defensible reference rate: public, attributable and free of reseller markup. For display and reconciliation it gives you a number you can point to a source for. If you need a margin, you add your own spread on top of a rate you can name.

Get started

Try it free

10,000 requests a month, no card. Every tier includes live FX and the full formatting engine.

Get your API key