for my project I'm trying to list my end user's transactions when they log into my app. I want to get all the transactions for a user by their email (because it's the most unique identifier I have for them). I've looked through the paypal api docs for a way to search transactions by a payee's email via the /v1/reporting/transactions but I don't see any parameters that would allow that.
Am I missing something? is there really no way to search paypal for transactions by payee's email (or any payee info for that matter)?
There is no way. Keep a record of completed transactions in your own database.
For past transactions, the user can do an Activity Download of a CSV file from their account which you can import.
Related
In our app user is paying for one year of use during checkout and then after a year we are staring to charge subscription.
Let's say that users are identified by email. So, how can I verify that user have now an active subscription ?
I have seen a few posts that suggest to build webhook and listen to PayPal events.
In our flow the initial purchase will be on WordPress website with one of the subscriptions Plugins and then I need to "activate" subscription in the App.
Is the "webhook" the only possible option with PayPal?
I have seen something in Braintree SDK related to subscription, can this work?
Seems to me too complicated to build the whole system only to verify subscription. In Stripe, for example, you can proactively ask if the user has subscription.
The webhook PAYMENT.SALE.COMPLETED informs of every completed subscription payment. Use this information to continuously update your records of whether a user has a paid-for subscription.
If you need metadata for reconciliation of which subscription corresponds to which user (since however they are identified at PayPal may not correspond to however you identify them), you can set the parameter custom_id when creating the subscription, to any value of up to 127 characters.
If you need to download a transaction history of previous payments, you can get a report in CSV format from the https://www.paypal.com account interface, typically under Activity -> All Reports -> Activity Download. This can then be imported to a database to backfill any gap in your records that you don't have webhook events for.
The goal is to list all the past transactions of a paypal account. The information that should be filtered out is: date of the transaction, amount, payer, receiver, purpose.
I experimented with paypal's "transaction search api" but the responses include a lot of unnecessary information. Furthermore, it only returns account_ids, e.g. "X005GHT889F". Is there a way to match the account_id with an email address or the account owner's name?
As this is a very general question, any help or hint into the right direction would be appreciated!
The transaction search API can return payer_info with the email; see its documentation.
Alternatively, you can trigger an Activity Download in CSV format via https://business.paypal.com/merchantdata/reportHome
I want to add Payment History to a user's account.
On this page, a user should see payments received (via PayPal) and payments made (via Stripe or PayPal). I want them to be able to download the receipts in PDF form as shown here in a mockup: Mock Image of Payment History
The details on the PDF should simply include: Date, Reference Number, Amount Paid or Amount Received.
What would be the best way to generate these statements?
For PayPal there is a transaction search API: https://developer.paypal.com/docs/api/transaction-search/v1
If the user creates a new live Rest API APP and checks the box for the permission needed and copy-pastes the clientid/secret into the config of your system, you'd be able to run this call on their behalf and assemble some history with repeat API calls.
It'd be simpler for them to log into their account and generate an activity download as a CSV file, though.
I own a personal PayPal account and am coming up with the design for a personal financing application. I intend to use the APIs provided by PayPal to fetch recent activity on my account to automate some of the information entry (at the moment, most of my transactions go through PayPal).
I've rooted through the API documentation, and I haven't been able to find any sort of endpoint I could use to fetch my recent account history.
I did find a question previously asked and answered about two years ago stating that the only way to do this was by getting a Premier account, which I'd rather avoid due to not knowing if there's any costs associated with such. I'd also like to note that despite my Personal status, I still get notifications on my Android phone stating that I've spent money.
Which brings me to the title question: does PayPal's API expose some endpoint I missed that allows me (the user) to programmatically browse my history, find new transactions, and mark them down with little input from me, or at the very least register to receive notice from PayPal that a new transaction has appeared?
You can pull transaction history using the TransactionSearch API. Then you can get individual transaction details using GetTransactionDetails.
You may also want to look into IPN, which will automatically POST transaction data to a URL you specify as a listener. That listener can receiver the data from PayPal and update your own database, send custom email notifications, hit 3rd party web services, etc.
I am working with the relatively new Paypal REST api and have successfully been able to create billing plans, approve billing plans, get a list of my billing plans, create billing-agreements (subscriptions), execute billing-agreements, and find specific billing-agreements.
I would like to be able to retrieve (GET) a list of billing-agreements, similar to how I can get a lit of billing-plans. This is not shown in the documentation as being available. Does anyone know of a way of doing this? Since there is no webHook available for subscription cancellations (or any subscription events) and no way to get a list of agreements, this leaves developers with no efficient way to handle cancellations (especially since users can cancel via Paypal without visiting the site). My current method/plan to handle this is to loop through all subscriptions that I have stored in my MongoDB (I store them when they are executed successfully), and send a request to Paypal for that specific agreement. I check its 'state' and update my MongoDB if they don't match.
There must be a better way.
I had the same problem, my first solution was almost identical to yours: I query the state of agreement upon user login and update the state in my db accordingly.
Later, I start to use IPN as my solution as suggested in this github comment by Tony: https://github.com/paypal/PayPal-Python-SDK/issues/69#issuecomment-69647946