1
votes

Is there any way to retrieve the transaction fee charged by Paypal using the REST API?

I've got a mobile application that makes a charge using the Paypal SDK, and then posts the transaction ID to the server. I'm trying to use this to get the transaction fee from Paypal.

Looking at the documentation, it looks like the fee should be returned as part of the details object, though it's not clear how to get this from the payment.

For example, if I get the payment using the following endpoint: /v1/payments/payment/PAY-XXXXXXX

The response returns information about the transaction, including the amount and currency, but nothing about the Paypal fee.

enter image description here

I've also tried looking up the sale (/v1/payments/sale/XXXXXXX) but that doesn't return anything about the Paypal fees either.

enter image description here

Interestingly enough, I don't seem to be able to view this information either from the transactions grid in the web interface, but I'm sure this information was definitely available in the old version of the web interface (before the redesign).

Not sure if I'm missing something obvious here.

2

2 Answers

2
votes

Unfortunately, despite being documented, it seems this hasn't been implemented. According to PayPal Merchant Technical Support, on 02/16/2015:

"Kindly take note that transaction fees will not be returned in REST APIs response and I am not being able to ensure whether this will be implemented in future."

I learned that fee tracking was a requirement for my company's PayPal implementation, and I ended up switching to SDKs as a result.

0
votes

The details object of the amount object has a fee field, which when you look up the sale using the URL you mentioned above should be in each transaction in the transactions array.

This should return the value you are looking for.