#fran_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1247904927230201947
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello
Hi
Hmm sounds like you are doing things correctly here
Can you provide the Subscription ID that you tested with?
And explain a bit more about what is unexpected?
The way metered billing works is that it does track during the period
Yeah give me a sec cause i deleted doing test but i have another one
sub_1POJhfLPUpdyowFEnVReCF37
That Sub looks to be on trial currently
So any usage won't be attributed during that period
You would need to advance time past the trial period
And then record usage
Yeah but i want to persist during time
let me explain
A customer register a user this increase the meter, but this increased have to be permanent cause the user is on the system registered, the customer have to pay for the total number of user that he has registered on the system
I dont know if i can setup billing meter to work like that
Yeah you wouldn't use metered billing for that
You would just use a normal licensed Price for that
If you want to persist the same amount of users across every period then that is just a normal licensed model
Yes
It would basically be https://docs.stripe.com/products-prices/pricing-models#per-seat
But i can change the amount on mid period?
You would decide on whether to handle proration or not
Or to invoice immediately on an update
Okey
Hmm actually wait
This actually will be easier with metered billing
What you want is to use aggregate_usage: 'last_ever' when you create your Price: https://docs.stripe.com/api/prices/create#create_price-recurring-aggregate_usage
That will carry your usage across period boundaries
oh okey, so in the meter event i have to pass the max value always
Nope
But for example, I register 2 user it increase the meter and on the same period i decrease 1 user, i want to bill the max of the period, but if no change on the period the last
Oh I see
Yeah if you want to still bill for the max during that period then you would need to wait until the next period to decrease
If you are going to use aggregate_usage: 'last_ever'
The other option would be to record the starting usage at the beginning of every period (based on the ending usage of the previous period)
using webhook to track when the customer period is ending and setting the meter on that moment, no?
Yeah you would use a Webhook to know when the next period is starting and then you could go ahead and record usage for that next period with the amount that you want them to start with (if you want to go that route)
Thanks so much for the information