Skip to content

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_prices table (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)

SettingDescription
StatusTurn sync on/off
API keyYour ExchangeRate-API key
Base currencyBase code for latest rates (e.g. USD)
Update intervalHours 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 ​

IssueFix
Sync returns errorVerify API key, base currency code, outbound HTTPS from server
Rates staleEnsure cron runs; check interval in settings
Wrong codesCurrency codes must match ISO-style codes supported by provider

Need help? support@xorinlab.com · Website: xorinlab.com