#numericity-subscription

1 messages · Page 1 of 1 (latest)

quaint nova
#

👋 happy to help

spice furnace
#

Hey @quaint nova

#

I'm using Stripe subscriptions, and I'd like to be able to group some other data based upon Stripe's billing periods

quaint nova
#

could you please elaborate?

spice furnace
#

For example, a user gets billed monthly, and in each of those billing periods, they are allowed to enrol on X number of classes. Is there a way I can get a list of billing periods past/upcoming?

#

So that I can group the enrolments by the billing period they belong to. That way, I can calculate whether they are within their limit for the specific billing period

quaint nova
#

why not use metered billing in that case

spice furnace
#

As far as I understand it, metered billing adjusts the price based on the usage?

#

These users pay a flat fee for up to X enrolments per period

quaint nova
#

and after that would they have to pay if they want more?

spice furnace
#

They are not allowed more

#

They would have to wait until the next billing period

quaint nova
#

Oh I see

#

I guess you'd have to build this logic in your system

#

what you can do is listen to customer.subscription.updated events

#

and save the cycle start/end dates

#

and then check the info in your own database

spice furnace
#

That's what I thought. Can Stripe only provide the current period?

#

Some classes might be weeks/months in the future, and therefore outside the current cycle

quaint nova
#

you can see the upcoming invoice which will give you a preview of the next invoice/billing cycle

spice furnace
#

Ok, thanks. I assume failed payments don't affect the current_period_start and current_period_end?

unreal musk
#

They won't, no