If you accept international payments, you are paying a hidden tax every single day. Payment processors like Stripe and PayPal apply their own exchange rate markups -- typically 1% to 3% on top of the mid-market rate -- and most merchants never question the numbers. By integrating an independent currency exchange rates API into your payment stack, you can see exactly what the mid-market rate is, decide whether to absorb or pass on conversion costs, and give your customers transparent pricing that builds trust.
This guide walks through why you need your own rate source, how the major gateways handle foreign exchange behind the scenes, and step-by-step integration patterns for Stripe, PayPal, and general payment flows.
Why Payment Gateways Mark Up Exchange Rates
Every time a customer in Tokyo pays for a product priced in USD, a currency conversion happens somewhere in the chain. The gateway, the card network, or the issuing bank applies a spread -- the difference between the real interbank rate and the rate the customer actually pays.
Here is a rough breakdown of typical markups:
| Provider | Markup Over Mid-Market | Update Frequency | Transparency |
|---|---|---|---|
| Stripe | ~1% (varies by currency pair) | Internal, not published | Low -- rate shown only at settlement |
| PayPal | 1.5%--3.5% | Internal | Medium -- shown at checkout but not negotiable |
| Wise Business | 0.3%--0.6% | Real-time | High |
| Adyen | 0.5%--1.2% | Near real-time | Medium |
| Your own API source | 0% (mid-market reference) | You control | Full |
The issue is not that markups exist -- gateways need to cover their own FX risk. The issue is that you have no way to audit or compare those markups unless you have an independent reference rate from a currency exchange rates API.
What an Independent Rate Source Gives You
Plugging a currency exchange rates API into your payment flow provides three concrete advantages:
- Rate auditing. Compare the rate your gateway charged against the mid-market rate at the same timestamp. Over time you will spot patterns -- certain currency pairs carry higher markups, certain days of the week see wider spreads.
- Dynamic pricing. Instead of setting a single USD price and letting the gateway convert, you can pre-convert prices on your storefront using real-time rates and display local currency amounts. This removes checkout surprise and improves conversion rates.
- Settlement optimization. If you hold multi-currency balances (Stripe supports this), you can decide when to convert based on rate movements rather than accepting the automatic daily settlement rate.
Integration Pattern: Stripe Multi-Currency Checkout
Stripe allows you to create PaymentIntent objects in any of 135+ currencies. The standard approach is to price in your base currency and let Stripe handle conversion. Here is how to take control instead.
Step 1: Fetch the Current Rate
curl -X GET "https://api.allratestoday.com/v1/convert?from=USD&to=JPY&amount=49.99" \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"from": "USD",
"to": "JPY",
"amount": 49.99,
"result": 7648.47,
"rate": 153.0012,
"timestamp": "2026-05-21T10:30:00Z"
}
Step 2: Create a PaymentIntent in the Customer's Currency
import stripe
stripe.api_key = "sk_live_..."
# Use the rate from AllRatesToday to price in JPY
jpy_amount = 7648 # Stripe expects integer for zero-decimal currencies
intent = stripe.PaymentIntent.create(
amount=jpy_amount,
currency="jpy",
metadata={
"base_currency": "USD",
"base_amount": "49.99",
"fx_rate": "153.0012",
"fx_source": "allratestoday",
"fx_timestamp": "2026-05-21T10:30:00Z"
}
)
Storing the rate and timestamp in metadata gives you an audit trail. When Stripe settles to your USD balance, you can compare their conversion rate against the AllRatesToday rate you originally fetched.
Step 3: Monitor the Spread
After settlement, pull the actual conversion from Stripe's balance transaction and compare:
# Your recorded mid-market rate
api_rate = 153.0012
# Stripe's effective rate (from balance transaction)
stripe_rate = jpy_amount / settlement_usd_amount
spread_pct = ((stripe_rate - api_rate) / api_rate) * 100
print(f"Stripe markup: {spread_pct:.2f}%")
Over thousands of transactions this data helps you negotiate better terms or decide to hold JPY balances and convert manually.
Integration Pattern: PayPal Adaptive Payments
PayPal gives merchants less control over presentment currency. However, you can still use a currency exchange rates API to show customers the expected local amount before they click the PayPal button.
// Fetch rate client-side (or server-side and pass to template)
const res = await fetch(
"https://api.allratestoday.com/v1/convert?from=USD&to=GBP&amount=79.00",
{ headers: { "Authorization": "Bearer YOUR_API_KEY" } }
);
const data = await res.json();
document.getElementById("local-price").textContent =
"Approximately " + data.result.toFixed(2) + " GBP at today's mid-market rate";
This transparency alone can lift PayPal conversion rates by 5--12% according to Baymard Institute research, because customers are no longer blindsided by the final amount.
Choosing Your Settlement Currency
If you sell globally, you often have a choice: settle everything in one base currency, or hold balances in multiple currencies. A currency exchange rates API helps you model the impact.
Scenario: USD vs. Multi-Currency Settlement
Suppose 30% of your revenue comes from EUR transactions. You can use the time-series endpoint to check recent EUR/USD volatility:
curl -X GET "https://api.allratestoday.com/v1/timeseries?start=2026-04-21&end=2026-05-21&base=EUR&symbols=USD" \
-H "Authorization: Bearer YOUR_API_KEY"
If EUR/USD has moved 2% in the last month, auto-converting to USD daily means you are exposed to that swing on every settlement. Holding EUR and converting in bulk when rates are favorable can save significant money at scale.
Decision Framework
| Revenue Share in Foreign Currency | Recommended Strategy |
|---|---|
| < 10% | Settle everything in base currency -- the convenience outweighs the markup. |
| 10%--30% | Hold top 2--3 currencies, convert weekly using rate alerts. |
| > 30% | Full multi-currency treasury management with a currency exchange rates API feeding your conversion decisions. |
Handling Rate Expiry and Guaranteed Quotes
One risk of showing a converted price at checkout is that the rate may shift between display and capture. Here are two approaches:
Approach 1: Short TTL with buffer. Fetch rates every 60 seconds (AllRatesToday updates every 60 seconds, which is ideal) and add a 0.5% buffer to the displayed price. This absorbs typical intra-minute fluctuations.
Approach 2: Lock at intent creation. Fetch the rate, create the PaymentIntent immediately with the converted amount, and set capture_method: "manual". You have up to 7 days to capture, and the amount is fixed in the customer's currency.
Most merchants find Approach 2 cleaner because the customer sees exactly what they will pay.
Rate Comparison: Are You Overpaying?
Here is a practical exercise. Pick your top 5 currency pairs by transaction volume and run this comparison once a week:
- Fetch the mid-market rate from your currency exchange rates API at 12:00 UTC.
- Pull your gateway's effective rate from that day's settlements.
- Calculate the spread.
After a month you will have a clear picture. If the average spread exceeds your tolerance (most businesses target under 1%), you have data to negotiate or switch providers.
| Currency Pair | Mid-Market (AllRatesToday) | Gateway Effective Rate | Spread |
|---|---|---|---|
| USD/EUR | 0.9142 | 0.9051 | 1.00% |
| USD/GBP | 0.7823 | 0.7745 | 1.00% |
| USD/JPY | 153.00 | 151.47 | 1.00% |
| USD/CAD | 1.3641 | 1.3777 | 1.00% |
| USD/AUD | 1.5203 | 1.5355 | 1.00% |
Illustrative data. Your actual spreads will vary.
Beyond Stripe and PayPal
The same pattern works with any payment processor:
- Adyen: Use their
/paymentsendpoint withamount.currencyset to the local currency, priced using your own API conversion. - Square: Square's international payments respect the currency you pass in the
CreatePaymentrequest. - Braintree: Their
salemethod accepts amerchant_account_idtied to a specific currency -- pair it with API-driven pricing. - Checkout.com: Their multi-currency support allows you to present in 150+ currencies when you supply the amount.
In every case the workflow is the same: fetch the real rate, convert, present, capture, then audit.
Implementation Checklist
Before going live, make sure you have covered these points:
- Rate caching with a TTL matching your API's update frequency (60 seconds for AllRatesToday)
- Fallback logic if the API is temporarily unreachable (use last known rate with a wider buffer)
- Metadata logging on every transaction (rate, source, timestamp)
- Weekly spread analysis comparing your reference rate to gateway settlement rates
- Compliance review -- some jurisdictions require you to disclose the exchange rate applied at checkout
Getting Started with AllRatesToday
AllRatesToday provides the rate data that makes all of this possible. The free tier gives you 1,500 requests per month -- enough to prototype and validate the approach. Key advantages for payment gateway integration:
- 60-second updates mean your displayed prices are never stale (most competitors update hourly or daily).
- 160+ currencies cover every market Stripe and PayPal support.
- Reuters and central bank sourcing gives you audit-grade data for compliance.
- Simple REST API with convert, latest, historical, and time-series endpoints.
Sign up for a free API key at allratestoday.com/pricing and start auditing your payment gateway's FX markups today. Full endpoint documentation is available at allratestoday.com/developers.