#ajay
1 messages ยท Page 1 of 1 (latest)
Hello ๐
What have you tried so far?
const usageRecordSummaries = await stripe.subscriptionItems.listUsageRecordSummaries(
subscriptionId,
{ limit: 1 },
);
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
there is no option to provide start time and end time
Ah I see. Hmm I don't think the endpoint supports that filter yet.
The list is sorted in reverse-chronological order (newest first) so you may be able to perform filters quickly by doing a binary search.
Do we have any other alternative for it?
Is there a way to get last 30 days reported usage?
I want this data
i am getting per month summary
Hi, stepping in and catching up here.
I was able to get caught up here. What you're looking for is currently not possible via the 'List all subscription item period summaries' API: https://stripe.com/docs/api/usage_records/subscription_item_summary_list. Looking through an alternative on my end
I hit this url in developer tools and get the required data on dashboard. Is there anything api endpoint for developers to fetch the same data?https://dashboard.stripe.com/v1/subscription_items/si_MGThJVt674SHrA/usage_records?timestamp[gt]=1664607399×tamp[lte]=1667285926&include[]=total_count&limit=30
There is not, the Dashboard functionality and the API are different. Some overlap and some do not. You'd want to list, https://stripe.com/docs/api/usage_records/subscription_item_summary_list and look at the sated on your end for that usage. There is not a workaround via the API.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So there is no way to get the following data?
That is correct, not via the API unless you list it and look at the dates yourself.