Quantcast
Channel: Active questions tagged paypal - Stack Overflow
Viewing all articles
Browse latest Browse all 471

Get Transaction Data via PayPal REST API V2

$
0
0

I am implementing a PayPal Donate button into a project for a charity. That is working great, and I am grabbing the JS response object which includes the Transaction ID. I store that for future API calls. With consent, we need to store donor name and email. So I am trying to use the PayPal API with the transaction ID to get these. It seems straightforward.

Per the PayPal REST API V2 docs, the relevant endpoint seemed to be /checkout/orders with the Order ID which admittedly I assumed was the Transaction ID, but having delved deeper appears not.

I am using Postman to test (auth is working fine), and the /checkout/orders endpoint returns Resource Not Found with a valid Transaction ID. It is the same account, correct API credentials etc.

I think that is now the wrong endpoint and I would need an Order ID. BUT the Donate buttons do not return Order ID, they return Transaction ID, as it is a 'sale' not an 'order'. I now understand the difference, though frankly I would like to have a talk with PayPal developers on meanings and documentation.

So I just cannot find the correct REST V2 endpoint to use for these 'sales' with Transaction IDs - can anyone help please?

I saw an older SO question with an answer here which said the v1/payments/sale endpoint worked - but this endpoint does not exist in V2!

I have looked at transaction search, but that grabs a list by date, not with an existing transaction ID. I know the transaction I want.

I really have tried to go over the documentation, find guidance, and have tested with Postman, but I'm getting nowhere for what seems a basic API usage! Thank you all for any guidance.


Viewing all articles
Browse latest Browse all 471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>