Retrieve subscription data after approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Morning
I am a bit of a PayPal integration newbie and having been working on a project where customer use a subscription button to purchase goods. Everything works well however I need to retrieve subscription data after approval for further use. Initially I need the email address so we can send a customised automated email thanking the customer for their purchase but going forward would like the majority of the data so it can be placed in an SQL database.
The onApprove: function(data, actions) seems to be the place to enter code but not overly sure where to start. The subscriptionID seems to be pulled and used within the default code, but when I try and pull another piece of data nothing happens.
onApprove: function(data, actions) {
//alert('You have successfully created subscription ' + data.subscriptionID);
alert('Here is the email address ' + data.subscriber.email_address);
}
Is my reference to the email address wrong or does paypal only give you access to the subscriptionID which can then be passed to another PHP page and I can use do a REST API request for the subscription data??
Many thanks chris

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Approval Link for Subscription shows System Error if opened in a browser in Sandbox Environment
- Passing Internal Order ID Between Webhooks (CHECKOUT.ORDER.APPROVED & PAYMENT.CAPTURE.COMPLETED) in REST APIs
- Unable to Retrieve Plan ID Related to a Subscription in REST APIs
- How to get amount next recurring subscription in REST APIs
- Sandbox: Revise subscription returns success but subscription not modified? in REST APIs