FX
Exchange rates per tenant, manual overrides, and a conversion calculator that posts nothing.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /fx/rates | List stored exchange rates for the tenant |
| POST | /fx/rates | Store a manual exchange-rate override |
| GET | /fx/rates/{from}/{to} | Get the current resolved rate for a pair |
| GET | /fx/rates/{from}/{to}/history | List stored rate history for a pair |
| GET | /fx/convert | Convert an amount between two currencies (calculator, posts nothing) |
Store a manual rate
rate means 1 base_currency = rate quote_currency; the inverse is derived.
curl -X POST https://ledga.io/api/v1/fx/rates \
-H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
-H "Content-Type: application/json" \
-d '{ "base_currency": "EUR", "quote_currency": "USD", "rate": "1.081" }'
Convert
curl "https://ledga.io/api/v1/fx/convert?from=EUR&to=USD&amount=100.00" \
-H "Authorization: Bearer sk_xxxxxxxx_your_secret"
Rules
GET /fx/rates/{from}/{to}resolves manual override → live provider → stored fallback.effective_atdefaults to now;expires_atends an override.GET /fx/rates/{from}/{to}/historylists stored rates for the pair, newest first.- Conversions inside a string use
POST /strings/{code}/convert.