Skip to main content
The FX Rates API exposes the currency conversion rates Sintropix uses across every Entity. Rates are pulled from Banco Central de Chile per ADR 0029; the sync endpoint refreshes the local cache and is restricted to staff. The read endpoints are Entity-independent because rates are global.
Source: apps/erp-backend/src/fx/fx.controller.ts. Base path: /api/fx-rates.

GET /fx-rates

Return the FX rate for a currency pair on a given date.
  • Query: FxRateQueryDto (fromCurrency, toCurrency, date).
  • Response: fxRateSchema.

GET /fx-rates/recent

List the most recent published rates across all tracked currency pairs.
  • Response: array of fxRateSchema.

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.
  • Body: FxSyncRequestDto.
  • Response: fxSyncResultSchema.
  • Status: 200.
This route requires role = staff. Client callers receive 403.

Status codes

Unverified: the exact fields of FxSyncRequestDto (typically a date range or a “since” cursor). Refer to the DTO and @sintropix/api-contract for authoritative shapes.