#tusharvaswani_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1324854916208136312
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- tusharvaswani_webhooks, 1 day ago, 8 messages
Hello, can you send me a request ID from when you get this error? Also can you tell me more about how the extra usage makes it difficult to find the cycle length?
Also coming to your other question:
I want to show users the meter total count during the duration of billing cycle which might not be possible because I can't get meter events summary on any random start and end date
Sorry I could have been more clear
Our subscription's billing cycles should be gettable in the API
https://docs.stripe.com/api/subscriptions/object#subscription_object-current_period_start
https://docs.stripe.com/api/subscriptions/object#subscription_object-current_period_end
We also include it on past invoices if you are looking for historical data
https://docs.stripe.com/api/invoices/object#invoice_object-period_start
https://docs.stripe.com/api/invoices/object#invoice_object-period_end
Can you use those sets of timestamps?
yes i was using that only
let me try again
didnt work got this error @plain echo :
StripeInvalidRequestError: start_time 1735941318 should be aligned with daily boundaries (expected 1735862400) because the value_grouping_window is day.
Ah gotcha, so it looks like we are expecting you to pass a timestamp that is at UTC midnight for the days you want to look at. If you pass in UTC midnight for your start and end dates, this call should work
yeah but that then just creates the problem where I cant get total usage
I think I see what you are saying. If the subscription is cycling in the middle of the day, you are trying to see the usage before and after 12:00 UTC on that specific day?
no I am trying to see usage between start and end of billing cycle
like stripe also calculates it right?
Trying to figure out, but that may not be how it works when you set your meter to aggregate by the day
That is from the billing meter creation page. It looks like we only count one value for each day if you set the event time window setting to aggregate daily
Oh I see the error mentions that value_grouping_window was set to day, which is a setting on the list call but not the meter itself. Are you passing that parameter? If so, do things change when you remove it?
https://docs.stripe.com/api/billing/meter-event-summary/list#list_billing_meter_event_summaries-value_grouping_window
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Nice! Glad I could help
Sorry to hear, happy we could figure it out now at least