#ihatetomatoes_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
đ 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/1212204877879447572
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
â˛ď¸ 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. Thank you for your patience!
anybody free to suggest the correct approach?
It's totally up to you. You can report on whichever frequency you want, we will calculate a the end of period
Thanks.
What is the difference between Most recent usage during period and Most recent usage value?
hmm which parameter you are referring to?
There is a dropdown when I am creating price.
my app helps property managers manage properties and I want to change based on how many properties they manage
lets say I send a weekly update to Stripe about how many properties the company manages
I guess Sum of usage values during period is not suitable, but not sure which of the other 3 options are best.
sorry there was a typo: I want to charge*
Oh I think those are last_during_period vs last_ever here https://docs.stripe.com/api/prices/create#create_price-recurring-aggregate_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So for aggeration strategy, they will look for either the last reported within that period, or within all time.
ok so I send usage every week and set the value to Most recent usage value, Stripe will charge the customer based on the last reported value?
yes monthly
lets say the company manages 500 properties for the first half of the month, then they import another 500 properties
at the end of the month they manage 1000 properties
will they get invoice for 1000 * unit_price or will it be calculated based on how long they managed the different amount of properties?
I need to know because my customers will ask me.
In that case you likely need "Sum of usage values during period"
Because if you use "Most recent" it will only count the last reported 500 properties
Anw, please test in Test mode
I thought I will be reporting the usage with the action: 'set' , not increment
so the last reported value from my end to stripe would be 1000
but as I said the customer would only manage 1000 properties for 2 weeks, the first two weeks they only managed 500 properties
Hmm okie, and you send 2 API to Stripe, first reports 500 and next reports 1000, correct?
With Most recent usage during period, we will calculate that as 1000, with sum, we will calculate that as 1500, for the whole month
yes, if I send it weekly it's possible that some of the api calls will have the same value
ok so looks like Most recent usage during period is the correct option and the customer will be charged 1000*unit_price even though they only imported 500 properties later in the month
Yeah it all depends on how you report to Stripe