1

I am using the PayPal REST API.

I need to get the PayPal fee charged from an Invoice.

I have an Invoice ID: INV2-XXXX-XXXX-XXXX

I can get invoice details using and from that, I can get a transaction ID.

var invoice = Invoice.Get(apiContext, "INV2-XXXX-XXXX-XXXX");
string transactionId = invoice.payments.First().transaction_id;

Now, how can I get the transaction fee from the transaction ID?

I see that a transaction object is returned as part of a payment object, however, I don't have a payment ID from the invoice.

I also don't see a way to get a transaction object from a transaction ID.

How can I get the fees charged by PayPal for an invoice?

References:

https://developer.paypal.com/docs/api/invoicing/#invoices_get

Matt Houser
  • 33,983
  • 6
  • 70
  • 88

0 Answers0