#edutomesco
1 messages · Page 1 of 1 (latest)
The difference between this:
sum—The default value (passed if you don’t specify the parameter). The total billed is based on the sum of all usage records for the billing period.
last_during_period—The total billed is based on the most recent usage record for the billing period. If no usage is reported for the billing period, the total billed is based on a usage quantity of 0.
last_ever—The total billed is based on the most recently provided usage record. If no usage is reported during the current billing period, Stripe looks for a previous usage record. If no usage record is found, the total billed is based on a usage quantity of 0.
max—The total billed is based on the usage record with the largest usage quantity for the billing period. If no usage is reported for the billing period, the total billed is based on a usage quantity of 0.
with an example because it's difficult to see the differences
👋 Thanks for reaching out
Is there a specific use case you're trying to account for?
Are you talking about the Aggregate metered usage in the pricing models :
https://stripe.com/docs/products-prices/pricing-models#aggregate-metered-usage
yees
but I don't understand the difference
Im using the sum option, but because I don't understand difference against the others, and maybe are more fixable
OK so let's assume that you offer a video conferencing service where they charge based on how many minutes the meetings last.
You have a user that has used your solution couple of times during June, for example:
- 10 minutes on 2nd of June
- 20 minutes on 5th of June
- 1 minute on 16th of June
- 5minutes on 25th of June
Based on the aggregate_usage value the user will billed as following:
sum=> 10+20+1+5 = 36 minuteslast_during_period=> 5minutes, if the user didn't use the solution this month then 0minuteslast_ever=> 5minutes; if the user didn't use the solution this month, then the last recorded of the previous month will be usedmax=> 20 minutes
Glade to hear that 🙂