#shainkey
1 messages · Page 1 of 1 (latest)
Hi there
i want to fetch the email id for that user that has some subscription with product id and price id
What do you mean by "email id" ?
Want to fetch email for that user
using webhook events
want to fetch what is the user email, subs_id, product_id and price id for that user
for ex: i buy any subscription from front-end and make payment successfully now want to store all data in our database after completing the payment
You can monitor the event invoice.paid
https://stripe.com/docs/billing/subscriptions/webhooks#active-subscriptions
You'll get the customerId:
https://stripe.com/docs/api/invoices/object#invoice_object-customer
Then you do an API call in order to get their details (including their email):
https://stripe.com/docs/api/customers/retrieve
is it necessary to store customer_id in our local database or else any other way ?
to fetch that necessary information
It depends on your integration flow, but from the invoiceId or the subscriptionId, you can retrieve the Customer, as I mentioned above
ok