#zach_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/1310729699772727316
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
Hello
Billing periods on Stripe are calculated down to the second. I see the current_period_end on this Subscription is 1732977835 (2024-11-30 14:43:55 UTC), which aligns with the Subscription having been created at that same time of day (14:43:55 UTC)
correct, but what I want is for it to bill all over november
which would be the entire day on the last day
perhaps a better example would be this:
sub_1QGQsMCYEIkFpocTjIjNmplS
you can see the subscription was backdated to Nov 1 12:00 AM UTC
now my expection for monthly billing, is this would do 11/01/2024 00:00:00-> 12/01/2024 00:00:00
We try to explain this here: https://docs.stripe.com/billing/subscriptions/billing-cycle#use-billing_cycle_anchor_config
I see you are using billing_cycle_anchor_config but you'll need to also pass hour, minute, and second if you want the billing cycle to be anchored to a specific time of day
Is there a way to fix this?
without sending a partial month invoice to customers?
what im reading is you can use a trial period, but that doesnt work for metered billing
The only options for existing Subscriptions are to reset the anchor to the current time or to add a trial. You can set proration_behavior to none for these updates so a partial invoice isn't created as part of these changes: https://docs.stripe.com/billing/subscriptions/billing-cycle#changing
I recommend testing this out in test mode so you can see the changes in action.
But current time wont work right
ill be in the same position
and then the trial, makes sense for a normal subscription, but for a usage based subscription, would it work?
Correct. If you reset to the current time, that means you should make the update on 2024-11-30, 23:59:00
but that will be too late right
the period would of already ended
and the customer invoiced
Sure but that would put you on the right path for the next billing period
Hm, im trying to fix this months, this is our first month live with stripe.
Is there anyway this can be done from the backend? If i reach out to stripe support?
No, the support team can't edit Subscriptions on your behalf
Hm, you can also look into using Schedules. You can edit the Subscription to add a few hours' trial then start a new phase on your desired billing anchor date
but during trial period im not sure how usage would be collected
trial makes sense for non usage based
where u are just giving them the x days difference "free"
but in this case we need ussage to continue to be added to this months bill
You'd have to keep track of usage during that hours' period then add that usage to the next period
yea.... but then conceptually ur billing the wrong amount for november
and adding the delta to december
which is the same as leaving the period as it is
Right but that would still put you on the right path for the next period since the December period would end on 23:59:00
so there is nothing that can be done on the backend of stripe to help me fix this?
That's right, we can't change these Subscriptions on your behalf
and theres no API that will let me change billing period now on an existing subscription, besides doing a reset billing anchor at exactly 00:00:00 on Dec 1, across 100+ subscriptions.
Correct. The only options for changing the billing cycle anchor on existing Subscriptions were discussed above (trials or setting billing_cycle_anchor to now, which doesn't help in this case)
I understand it might be confusing for this first cycle but you may want to test out the Schedules option. You can add a few hours' trial period so you can get back to the start/end time stamp you have in mind for all subsequent billing periods
yea, thats great and all, but the problem is going to be how to capture that usage
i just dont really understand why there would be a limitation to change the current period end date
start date i kind of get, but end date
as well as the end date should of been 1 month from the subscription backdate
Right, you'd have to keep track of that usage then create usage records or meter events (depending on which usage billing flow you're using) once the subscription is in its next billing period. I see how that might be confusing for the month of December but it would put you on the right path for January
We mention the billing cycle anchor for subscription creation date here but this could be more prominent: https://docs.stripe.com/billing/subscriptions/billing-cycle#changing:~:text=The default value is either the subscription creation date or the trial end date (if you’re using a trial period). You can also explicitly set this value at the time you create the subscription.