- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I would like to understand how to get the ID of a donation button from a transaction ID. Using
v1/reporting/transactions?fields=all
shows the account of who made the donation / transfer, but does not include any fields that identify which donation button was used.
Why --> I have a charity with +60 donation buttons. I need a way to track which project (donation button) the funds should be designated too using the rest api.
My three donation buttons in my sandbox
https://www.sandbox.paypal.com/donate/?hosted_button_id=QS7YJUKLG5G4L
https://www.sandbox.paypal.com/donate/?hosted_button_id=5CAA5CDSHVZPJ
https://www.sandbox.paypal.com/donate/?hosted_button_id=C6VJSALE5Y9GJ
How to know if the transfer came from QS7YJUKLG5G4L, 5CAA5CDSHVZPJ or C6VJSALE5Y9GJ?
Solved! Go to Solution.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good day @asj549fh3mgf90,
Thank you for posting to the PayPal community.
Merchants can use the Transaction Search REST API to get the history of transactions for a PayPal account.
https://developer.paypal.com/docs/api/transaction-search/v1/#search_get
Based on your requirement, I would suggest to please pass a custom value in your donate buttons. Using the custom ID you can track the particular donation.
custom Optional | Pass-through variable for your own tracking purposes, which buyers do not see. By default, no variable is passed back to you. |
Donation button is a legacy integration.
Sincerely,
Chiranjeevi
PayPal/Braintree MTS
If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good day @asj549fh3mgf90,
Thank you for posting to the PayPal community.
Merchants can use the Transaction Search REST API to get the history of transactions for a PayPal account.
https://developer.paypal.com/docs/api/transaction-search/v1/#search_get
Based on your requirement, I would suggest to please pass a custom value in your donate buttons. Using the custom ID you can track the particular donation.
custom Optional | Pass-through variable for your own tracking purposes, which buyers do not see. By default, no variable is passed back to you. |
Donation button is a legacy integration.
Sincerely,
Chiranjeevi
PayPal/Braintree MTS
If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. Adding a html variable to the donation button
custom=QS7YJUKLG5G4L
shows up in the json in the transaction search api. Exactly what I needed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have discovered that this only works for one time donations. If the donation button is set to re-occurring monthly, then the custom_field element in the json that contains the button ID is missing. This makes it impossible to do automated donation processing on our website.

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- How to prompt a "thank you" after using donate button on a website in PayPal Payments Standard
- Add parameters to custom auto return url? in PayPal Payments Standard
- Add Venmo button to PayPal Donation setup in PayPal Payments Standard
- Cant get mobile number from details. object even though my paypal button mandates submission in Sandbox Environment
- PayPal Redirection Issue After Successful Payment in Photobooth Integration in Sandbox Environment