#Sumit1993
1 messages · Page 1 of 1 (latest)
You can look at the Report API: https://stripe.com/docs/reports/api Or simply utilize List PaymentIntent API
will the data from reports api include the revenue generated from subscriptions also?
@coral jolt
It should
i am still unable to get the api ... can u help me with some sample request to get revenue ?
this is all i got with the payout reconcilation endpoint
That's Payout Report. I think you want Balance Report instead: https://stripe.com/docs/reports/balance
this endpoint is also not providing me the figures
You would need to wait for a webhook event reporting.report_run.succeeded, then find the URL and download it
Please follow above Doc
so it cant be done through simple api calls ... i have to use webhook right ?
Yes that's how report API works. You can try the List Payment Intent API if you only use PaymentIntent: https://stripe.com/docs/api/payment_intents/list?lang=node
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
we are charging through subscriptions at the moment
will the paymentintents work for that purpose ?
Subscription should create PaymentIntent under the hood, so I think yes, but please test via Test mode
sure ... so we are developing a dashboard for our application where we would list out the revenue generated through subscriptions for today , last 30 days , last year .... what way u wud suggest me to fetch all this data as it might be accessed frequently
i mean subscription is charged one time but the payment is done every month/year as per plan.... how can i fetch all that revenue
Every billing cycle will generate the invoice which has Payment Intent under the hood. You can List Payment Intent to get the payment amount to calculate the revenue
so if i save all the data from payment_intent.succeeded webhook to our database and then run queries to get sum of those records... it will solve the purpose right ?
@hollow storm @solid stirrup
ok sure awaiting you
So you have a few options (as mentioned above):
- Use the reporting API, that will give you all the numbers you need (recommended)
- Or compute the numbers by yourself by listening to payment_intent.succeeded for example (not recommended, because that's a lot more work (how do you take into account refunds, coupons, disputes, etc.?)
but reporting api i cant call every time user visits our dashboard right
i will have to push realtime updates then to the frontend everytime reports webhook completes
If you want a real time dashboard, I guess you are right. But if you dashboard is updated every N hours, you could use the reporting API and cach the results on your end.
ok great.... thanks for the support guys... you guys have brilliant support system