Source
- API: ECB Data Portal
- Endpoint pattern:
https://data-api.ecb.europa.eu/service/data/EXR/D..EUR.SP00.A?startPeriod=YYYY-MM-DD&endPeriod=YYYY-MM-DD&detail=dataonly&format=jsondata - Reference: ECB API docs
Storage
- Table:
exchange_rates - Fields:
base_currency:EURquote_currency: target currency (e.g.,USD)rate: quote per 1 EURstart_date(UTC 00:00:00.000)end_date(UTC 23:59:59.999)source:ECBraw: minimal JSON fragment with series/observation ids (for traceability)
- Uniqueness:
(base_currency, quote_currency, start_date)
Sync
- Core function:
syncEcbFxRates({ date? }) - Temporal activity:
syncEcbFxRatesActivity - Workflows:
dailyFxSyncWorkflow({ dateIso? })(one-shot)fxDailySchedulerWorkflow()(simple daily loop; prefer Temporal Schedules in prod)
- Task queue:
FX_GLOBAL_TASK_QUEUE
Consumption
- Helper:
getFxRateForDate({ baseCurrency, quoteCurrency, at }) - DATEV export: when
WKZ Umsatzdiffers from export header WKZ,Kursis populated using FX rate for document date (UTC). Kurs is formatted with comma and 4 decimals.
Error handling
- Sync returns
ActionResponse; Temporal activity throws on failure. - If no rate is available for the exact day,
getFxRateForDateselects the latest available rate on or before the date; for cross pairs, triangulates via EUR. - Network/structure errors are logged and surfaced via
error.
Notes
- All dates are handled in UTC.
- Use JSON format from the ECB (
format=jsondata).