#zach_api

1 messages · Page 1 of 1 (latest)

digital matrixBOT
#

👋 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.

sullen crag
#

Hi there

lucid agate
#

Hello

sullen crag
#

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)

lucid agate
#

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

sullen crag
lucid agate
#

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

sullen crag
#

I recommend testing this out in test mode so you can see the changes in action.

lucid agate
#

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?

sullen crag
#

Correct. If you reset to the current time, that means you should make the update on 2024-11-30, 23:59:00

lucid agate
#

but that will be too late right

#

the period would of already ended

#

and the customer invoiced

sullen crag
#

Sure but that would put you on the right path for the next billing period

lucid agate
#

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?

sullen crag
#

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

lucid agate
#

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

sullen crag
#

You'd have to keep track of usage during that hours' period then add that usage to the next period

lucid agate
#

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

sullen crag
#

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

lucid agate
#

so there is nothing that can be done on the backend of stripe to help me fix this?

sullen crag
#

That's right, we can't change these Subscriptions on your behalf

lucid agate
#

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.

sullen crag
#

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)

lucid agate
#

i see

#

not looking good for us

sullen crag
#

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

lucid agate
#

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

sullen crag
#

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

lucid agate
#

yea, beyond prominent

#

i think a warning you cannot change this easily later on