How to get donation button id used in a transaction

asj549fh3mgf90
Contributor
Contributor

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?

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Chiranjeevi
Moderator
Moderator

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.

 

https://developer.paypal.com/api/nvp-soap/paypal-payments-standard/integration-guide/Appx-websitesta... 

 

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.

View solution in original post

Login to Me Too
4 REPLIES 4
Solved

MTS_Chiranjeevi
Moderator
Moderator

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.

 

https://developer.paypal.com/api/nvp-soap/paypal-payments-standard/integration-guide/Appx-websitesta... 

 

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.

Login to Me Too

asj549fh3mgf90
Contributor
Contributor

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.

Login to Me Too

MTS_Chiranjeevi
Moderator
Moderator

@asj549fh3mgf90 Sure, Happy to hear that it worked. Thank you.

Login to Me Too

asj549fh3mgf90
Contributor
Contributor

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.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.