#tobias-metered-subs
1 messages · Page 1 of 1 (latest)
Hey karbi
Just to make sure I understand - you're using usage-based billing subscriptions, correct?
A subscription with a subscription item that has metered usage on it
Either on the price or the plan, it would say metered as I understand it
In short correct .
Gotcha - I think you could accomplish this by creating a metered price with an initial tier up to "200" that costs $0 and then an additional tier that charges for any additional usage
You can read a bit more about tiers here https://stripe.com/docs/products-prices/pricing-models#tiered-pricing
While that is a nice way to do it, and I thankfully thought of it, but didn't establish that for the discussion because I'm not that clever.
But I would be forced to create a fair amount of prices, if the usage is dynamically set based on the previous years usage.
E.g. first year the usage is 100, and the prebought is 20
next year the usage is 200, and the prebought 100
The next prebought is 200, and so on.
Ah, I see - your issue is that the prebought amount can vary based on Subscription
Heavily and from year to year, or month to month, accumulating as the usage was some amount the prior period.
I was looking into establishing what period a subscription would be in, as to maybe traverse those in time, but the only interval I saw was on the price, and I don't quite want to make it more complicated than it has to be.
When you say "establishing what period a subscription would be in" are you asking how to check what the current time range of the subscription is? Or do you mean somethign else?
Subscription created
subscription would be in period 0
then the following period 1
monthly from jan to feb, e.g.
then next jan would be 12 (note first jan was 0)
If I do make many prices, I hope there is no limit to how many I can create
Gotcha - you're trying to figure out how many period have passed since the start of the subscription. Yeah there isn't really a good way to get that from our API unless you're tracking it yourself.
Generally, the only way I can think of handling this is that you'd have to track on your end how much a customer has already prepaid for and then only report usage to stripe for the ADDITIONAL usage that exceeds the prepaid amount
tobias-metered-subs
Roger. Yeah, I naively ask questions I know the answer too.
I suppose I could add items that corelate to some amount of prepaid
e.g. some item is bought in x quantity, and then use that quantity to establish if it is reported or not
But it doesn't solve accumulation ofc, unless you can schedule the next period to have a higher item quantity on it
With the accumulation are you talking about how the usage is being aggregated over the period? Are you using sum for recurring.aggregate_usage or somethign else?
Over the periods, in plural, so that the usage is stacking higher and higher.
So carries over from period to period, hoping it would be on the first invoice of the new period
Do you want the usage to carry over from each period? Or do you want it to be reset?
We essentially split an usage into two parts,
Hole usages, you had the item the entire month
and partial usage, you had it for e.g. half a month aka pay half the price
so at the start of the new period, those usages would be considered whole usages
and I would like those to be paid as the first invoice is generated, but I am thinking more and more usages api isn't well equipped for it.
Yeah if you want thing to be paid at the start of a period then the metered billing/ the usages API is not what you want
Can I schedule a new quanitty for the next subscription period? or is that not a thing?
You can - you'd do that with Subscription Schedules (https://stripe.com/docs/billing/subscriptions/subscription-schedules) if you aren't using metered billing
Invoice items would work if you only want to add an additional cost to the next subscription invoice, but it won't actually change the subscription's quantity moving forward