#marve-subscription-metered
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- marve, 14 minutes ago, 6 messages
Hi, you report usage, https://stripe.com/docs/products-prices/pricing-models#reporting-usage and at end the end of the billing period, the total usage is multiplied by the 'unit_amount' to calculate what the customer owes. We discuss more about this here, https://stripe.com/docs/products-prices/pricing-models#reporting-usage. Can you share where you read this? I'm unsure that I understand what you mean here.
Yes, in my case, action is set. I see stripe doesnt recommend using that grace period for reporting. Im just wondering, since im not using action increments, are there any stripe webhook events that may come in before the billing period ends that I could use to trigger set usage?
Not sure if im being clear here
We document some of the Subscription webhook events here, https://stripe.com/docs/billing/subscriptions/webhooks#events. There is not a specific event is sent when billing period ends.
Okay thanks. Maybe I could listen for invoice.upcoming instead of setting up a cron job
What method do you usually recommed?
Theres not one method thats more popular than the other right?
I mean practically same thing, I'll try both. Thanks again
in most cases, people using metered usage will just report usage in real time as it happens
But thats mostly for increments right? Im reporting cloud storage so each billing period has to start with the amount of the last, thats why I was thinking about using set for action instead of increment. But increment would be smoother for sure
Can this be done:
new billing period has to start with total usage of previous billing period?
no that won't really work, but if you just report the usage of the previous billing period you just need to create a UsageRecord when a new period starts no?
Yes true, but then not sure which solution is simpler. Also adding to complexity, im charging per 5gb stored (so rounding up every 5 gbs)
I can't really tell you what's simpler sorry. To me all those solutions are straightforward to use and build at least
okay thanks
Sorry last thing, if i use increments, can i input a negative quantity (so if something is deleted)?
Usually you track the time at which you created the UsageRecord you want to "undo" and you use action: 'set' to override it to the lower value
or you use logic to "sum" all usage over a period
Sorry there are many ways to integrate usage-based billing and it's importnat to carefully read the whole doc first
I see. Thanks, just read through docs. I'll just specify last_during_period for aggregate_usage
yeah that could work for your use case