LosmiNCL
LosmiNCL

Reputation: 307

PayPal API for currency conversion

In my Java Spring Boot application, I have a summed value of money from invoices. Those values are separated and grouped by different currencies. I want to convert all currencies into USD then to sum all those values, and that summed value to be in a new variable. I need to convert it using PayPal conversion rates (e.g. from EUR to USD). When I look into the PayPal API, I can't find is there any method where I can use the currency converter. Do you have an information where I can find it?

Upvotes: 1

Views: 2265

Answers (1)

Matthias
Matthias

Reputation: 2775

Unfortunately, Paypal does not offer such functionality via API anymore. There used to be such an API as part of the Adaptive Payments product. But that product is retired and not available for new customers anymore.

However - what you are asking for is most likely not achievable. Money exchange rates are fluctuant and in constant change throughout a business day. That means, the conversion rate EUR to USD is going to be different at 9am than to what it is at 9pm.

Therefore, what counts most likely is the exchange rate at the time of each individual payment. If your goal is to create a report for all payments - you'd need to put into consideration, that the exchange rate at the time of report creation is going to be a different one than what it was when the payments happen. therefore your numbers are going to be inaccurate.

In most cases the inaccuracies are not going to be substantial, so an approximation to the current exchange rate is good enough. If that is not the case, well.. then the effort grows significally. You'd need to check the rates at the time of the purchase or find a way to link the payments in a foreign currency to transactions in your paypal account and get the data from there.

Upvotes: 1

Related Questions