Appearance
Currency rate API (ExchangeRate-API)
Automatic currency price sync uses the third-party ExchangeRate-API service. Buyers need their own API key (free tier available).
What gets synced
- Records in
currency_pricestable (reference rates per currency code) - Triggered manually from admin or hourly via scheduler when enabled
Operational buy/sell rates on exchange currencies may still be edited manually per currency.
Enable in admin
Admin → Settings → Currency Rate API (or Currencies → Price area depending on your menu)
| Setting | Description |
|---|---|
| Status | Turn sync on/off |
| API key | Your ExchangeRate-API key |
| Base currency | Base code for latest rates (e.g. USD) |
| Update interval | Hours between automatic syncs (1–168) |
Manual sync
Admin → Currencies → Price — use Sync to pull latest rates immediately.
Scheduler (production)
routes/console.php:
php
Schedule::call(function (CurrencyRateSyncService $syncService): void {
$syncService->syncSilentlyIfEnabled();
})->hourly();Add cron entry — see Cron & queue.
API request format (reference)
The service calls:
text
GET https://v6.exchangerate-api.com/v6/{API_KEY}/latest/{BASE_CODE}Implemented in App\Services\CurrencyRateSyncService.
Without external API
Leave sync disabled and set buy/sell rates manually on each currency. The platform works fully offline for rate management.
Troubleshooting
| Issue | Fix |
|---|---|
| Sync returns error | Verify API key, base currency code, outbound HTTPS from server |
| Rates stale | Ensure cron runs; check interval in settings |
| Wrong codes | Currency codes must match ISO-style codes supported by provider |