Real-time currency exchange rates and multi-currency transaction support for global payment processing through Cyrexa IPG API
// Get current exchange rates const rates = await fetch('/api/exchanges/rates', { method: 'GET', headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'application/json' }, params: { base: 'USD', target: ['EUR', 'GBP', 'JPY'], amount: 100.00 } });
// Get historical exchange rates const historicalRates = await fetch('/api/exchanges/historical', { method: 'GET', headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'application/json' }, params: { base: 'USD', target: 'EUR', date: '2024-01-15', period: '7d' } });
// Set up rate alerts const alert = await fetch('/api/exchanges/alerts', { method: 'POST', headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'application/json' }, body: JSON.stringify({ baseCurrency: 'USD', targetCurrency: 'EUR', threshold: 0.85, direction: 'below', notificationUrl: 'https://yoursite.com/webhooks/rate-alert' }) });
// Create payment request with currency conversion const paymentRequest = { amount: 100.00, currency: 'USD', customerCurrency: 'EUR', exchangeRate: 0.85, convertedAmount: 85.00, conversionFee: 1.50, totalAmount: 86.50 }; const payment = await fetch('/api/payment-requests', { method: 'POST', headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'application/json' }, body: JSON.stringify(paymentRequest) });
// Generate multi-currency transaction report const report = await fetch('/api/reports/transactions', { method: 'GET', headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'application/json' }, params: { startDate: '2024-01-01', endDate: '2024-01-31', currencies: ['USD', 'EUR', 'GBP'], includeConversions: true } });