#marve-subscription-metered

1 messages · Page 1 of 1 (latest)

modern sedgeBOT
#

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
jovial edge
still matrix
#

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

jovial edge
still matrix
#

Okay thanks. Maybe I could listen for invoice.upcoming instead of setting up a cron job

modern sedgeBOT
still matrix
#

What method do you usually recommed?

rain shoal
#

marve-subscription-metered

#

@still matrix that's up to you really

still matrix
#

Theres not one method thats more popular than the other right?

#

I mean practically same thing, I'll try both. Thanks again

rain shoal
#

in most cases, people using metered usage will just report usage in real time as it happens

still matrix
#

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?

rain shoal
#

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?

still matrix
#

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)

rain shoal
#

I can't really tell you what's simpler sorry. To me all those solutions are straightforward to use and build at least

still matrix
#

okay thanks

#

Sorry last thing, if i use increments, can i input a negative quantity (so if something is deleted)?

rain shoal
#

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

still matrix
#

I see. Thanks, just read through docs. I'll just specify last_during_period for aggregate_usage

rain shoal
#

yeah that could work for your use case