#coherence-metered-billing
1 messages · Page 1 of 1 (latest)
@tidal palm yeah we don't have a "decrement" feature. You don't really decrement usage, you "correct" past usage by explicitly setting the quantity of a past record at a specific timestamp to be a different amount
Can you say a bit more about "most recent usage"?
Did you mean last_during_period for aggregate_usage: https://stripe.com/docs/api/prices/create#create_price-recurring-aggregate_usage ?
In that case you can set the newer "sum" at that point and we'd always use the latest
Yes for "most recent usage" i ment when creating a volume pricing product we select charge for metered usage
So in dropdown we have options like
- Sum of usage during period
- Most recent usage value during period
- Most recent usage value
- Maximum usage value during period
2, 3 and 4 are extremely rare and something I almost always discourage. What are you really trying to do? What's your billing schedule like?
Yes basically my product is related to kids platform
Whenever a user adds a kid I am incrementing a usage by 1, which is working perfectly fine, the stripe dashboard shows correct usage
But when I want to decrement I am not sure how to do that, I am using "set" action but it is not decrementing rather adding in the usage value
Can you please help me how should I decrement the usage ?
What you describe doesn't seem related to metered billing though right?
Usually metered billing is used to track the number of emails sent, or number of minutes on a phone call, etc.
Your seems more like "number of users on that netflix account" and in that case most businesses just use quantity on the Subscription
Can you please explain more about it like you said "quantity" what approach should I follow?
I am currently using metered billing
How did you decide on metered billing in the first place? that's usually a more advanced flow and used less. If a kid is $10 a month and I add 20 kids mid-month, do I pay $200 at the end of the month? Or do I pay half the month for the extra 19 kids?
$200 at month end
can I ask why?
wouldn't I cheat by adding 20 kids on the second day and moving back to 1 on a last day to only pay for one each time?
I was thinking it based on subscription mechanism
Basically when I added 20 kids I pay $200 at end of billing period
And when I wanted to remove kids (lets say now I have 10 kids and 10 are removed) it will still charge $200 for the month and from next month it will charge according to 10 kids which would be $100
yeah that's not really how it works since you want to explicitly unset the 20
I worry you're mis-designing your billing logic here
It's not easy to tell you how to fix it in code if you haven't yet exactly decided how/when to charge and for how much
basically I created this pricing model for volume based pricing
Tiers and metered billing are orthogonal
What you need to do is come up with concrete examples of when someone pays and when the number of kids changes who pays what/when
Does that make sense @tidal palm ?
Yes I was figuring out how to approach it now
The best option is to take a basic example: I sign up for your service on October 1st for one kid. What do I pay? $29.99 upfront, or nothing until next month?
$29.99 for month
upfront or at the end?
well that's the thing, the basic subscription (the 99% use-case) charge upfront