#jasonkuhrt_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/1235293434684768298
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
It sounds like the error message is fairly clear. Have you tried passing a timestamp for after the last invoice period?
The error message is clear in theory. But another subscription will receive a usage record for the exact same timestamp. Why?
While here though, is it wrong that at <date>T11:59:59:999 we run a cron to capture usage and report a usage record. On the last day of the billing cycle, it is normal that a usage record will be send after the billing cycle technically, is it not?
Here is the "other subscription" I'm referring to for example: req_LOaXfIc3gYxkCt
Likely becuase there's a different invoice period
Why does req_LOaXfIc3gYxkCt succeed but req_ZQ15QKbNDYHxEN fails.
The invoice periods are the same. See screenshot. The billing anchor is identical.
We pulled down the subscription objects of both because we were confused, looking for a meaningful difference, found none.
The fact that each subscription started on a different day in April seems irrelevant to me. Am I wrong to think that?
Huh... that's a good point. Let me check in with my team to dig a bit deeper
Just checking in to let you know we're still looking into this. @snow smelt is taking over though, so he'll circle back once we have a more meaningful update
Great, thanks
Just so I understand: the new period starts on 1714521600 for both Subscriptions, so why are you passing in 1714521599 to your usage record POST requests?
I agree that it's odd that it works in one case and not the other, so I'm still looking into why that is, but I would actually expect it to fail for both requests
Hey
I agree that it's odd that it works in one case and not the other, so I'm still looking into why that is, but I would actually expect it to fail for both requests
Ah I see, ok that's good to know.
Just so I understand: the new period starts on 1714521600 for both Subscriptions, so why are you passing in 1714521599 to your usage record POST requests?
This is because the usage is for the 24 period between April 30 00:00:00 to 23:59:999.
So example: Once May 1 00:00:00 occurs is it supposed to be impossible to send usage records for any timestamp in April?
Yes, because at the end of the billing period, Stripe automatically calculates the total price and invoices for all usage during that billing period.
That being said, I seem to recall that there was a grace period of 5 minutes for the old usage reporting. Are you migrating your usage-based Billing system from the legacy model (https://docs.stripe.com/billing/subscriptions/usage-based-legacy) to the current model (https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide) by chance?
Or have you recently implemented the new usage-based billing model?
That being said, I seem to recall that there was a grace period of 5 minutes for the old usage reporting.
I think I remember this too. Is that documented?
Are you migrating your usage-based Billing system from the legacy model (https://docs.stripe.com/billing/subscriptions/usage-based-legacy) to the current model (https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide) by chance?
We would like to, but no immediate plans right now. Is there a benefit it brings in regards to this issue?
I'm looking around for it, but I can only find reference in this StackOverflow thread: https://stackoverflow.com/a/73853206/18637382 it was probably something we did at one point and then changed later on, but I'm not sure
I would just read through the new docs and compare it to what you're doing now. The benefit is clear for new users, but that may or may not translate to users with big SaaS systems already running on the legacy usage Billing model
So at the end of a billing period, it feels a bit risky to try and get the usage all calculated before the end of the cycle. We have a cron set to run, but it can take time to go through all system usage, or if any fail, a retry may come in hours time.
There's a (not very descriptive) explanation of the differences here: https://docs.stripe.com/billing/subscriptions/usage-based-legacy/migration-guide
Ah it has one hour grace period
What does
Collect usage before creating a subscription
mean, or rather, why
Some edge-case where there's a reason to aggregate usage before the customer commits to a subscription, I would guess.
Summary: sales things probably
There is another issue we did not understand. Why does the usage record April 30 23:59 show up for the May invoice :/
It seems that the April invoice stops at April 29 23:59. Why is that?
Helping look into this
Can you share the invoice id and usage record you're referring to
Yeah
usage rec req id req_PaM0IryJu4aKem
there is no invoice yet, its the upcoming for sub_1P4m9FIhnflvQVbiPuFL6LBF
Assuming that's because when you created that usage record it was already May
Not sure why one of those requests succeeded and the other failed though
I think at this point we need the owning team to investigate this issue
So, I recommend writing into support, providing both requests (the successful one and the one that failed) and asking why one succeeded and the other failed. Can you mention my username codename_duchess in the email and ping here once you've written in? That way I can loop in the proper folks to investigate
When sending a usage record, I thought the timestamp determines the billing period it becomes part of.
You can write in here: https://support.stripe.com/contact/email
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
It should, but also the request that succeeded shouldn't have worked
As far as I know
Ok
We'll reach out to support and then return to this thread when we get a reply. Thanks.
No not when you get a reply
Just ping here once you've written in
That way I can find the ticket and loop in the proper folks
Then, you'll receive further support via that email ticket
What's your account id?
That's fine. What's the account id I can get it from that
acct_1Kec6HIhnflvQVbi