source:
A line in one of these currencies, booked in a CLP Entity, gets the pair’s rate as its default. A pair outside this list has no stored rate, so a lookup for it returns
404.
Rates are stored exactly as Banco Central de Chile publishes them, with at most two decimals. For currencies worth less than one Chilean peso, such as COP and ARS, the rate is below one (for example "0.24"), and the published rounding carries through to the converted amount.
The FX Rate object
GET /fx-rates
Return the FX rate for a currency pair on a given date. The date is the date being valued (an Invoice’s issue date, for example), not necessarily a publication date: the response is the most recent rate published on or before it, and rateDate tells you which day that was.
Query parameters
- Response: an FX Rate object.
GET /fx-rates/recent
List the most recent published rates across all tracked currency pairs: up to 100 rates, newest rateDate first.
- Response: array of FX Rate objects.
POST /fx-rates/sync (staff only)
Force a sync of published rates from Banco Central de Chile. The response summarizes what was fetched and stored. Every tracked series is fetched independently, so one failing series does not withhold the others.
Body
An empty body (or no body) syncs the default trailing window: the last 10 days ending today, on the Chilean calendar.
Response:
{ series: [...] }, one entry per tracked series in fetch order:
- Status:
200.
This route requires the
staff Role in at least one Organization. Other callers receive 403 with PERMISSION_DENIED_ERROR.Status codes
A sync doesn’t fail when Banco Central de Chile does: a series it can’t fetch comes back with
failureMessage in the 200 response.
