#jacob_billing-metered

1 messages ¡ Page 1 of 1 (latest)

hexed umbraBOT
#

👋 Welcome to your new thread!

⏲️ 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.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1296499469973459068

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

serene peak
#

jacob_billing-metered

#

@random gazelle yes that's normal. You report usage with a MeterEvent over time and next month we'll charge that usage + the base price for next month.

random gazelle
#

Additional context, I am currently testing in Dashboard, but intend to programatically create a checkout session in the app logic and want to make sure I'm setting up the subscription properly for the user

#

--
So the correct approach is to attach the usage based products to the subscription with the base price product?

serene peak
#

I'm not sure Checkout supports metered usage, so make sure to take the time to test this first

#

And yes that's the right approach

random gazelle
#

Ok, will test the checkout. But glad to know I'm on the right track for usage in the subscription

#

I had a few other questions..

#

--

  1. Part of the base price provides an initial amount of usage for each of the 3 products.

However the usage products just count all usage and then bill accordingly. Taking no account to the usage "included" in the plan...

My current solve is to attach a coupon to the subscription that counters the cost of the initial usage, up the limits I have.

But then it shows the coupons on the invoice and it doesn't look as polished....

Is there a way to hide those specific coupons from the invoice and ui? Or is there a better approach?

I explored tiered pricing, but the price per grouped units is much better for the model I neede

#
  1. In the test clocks, is there a way to manipulate usage meters to simulate future invoices with usage??
serene peak
#

For #2: TestClocks are here to manipulate time and advance time basically. Everything else you need to do such as creating your own MeterEvents

random gazelle
#

Yes! I just requested access via a email input. Do you know if there is an email I could reach out to or way to get that escalated?

Had that thought. I was hoping to keep all usage since stripe will be the usage source of truth.. Discounts on specific products should work for now though right?

serene peak
#

no email no, this is brand new so will take a while to get access. In the meantime not reporting that usage is the easiest. Coupons work too but are not as logical to end users

random gazelle
#

Gotcha. Excited to see it come out, credit burn is exactly what I need.

#

Re: 2.

How do I create a MeterEvent that would run during time test clock?

If you're saying the test clock simply runs time into the future, how, during that test, do I run a MeterEvent? Just from Stripe CLI?

serene peak
#

I recommend writing real code and doing the steps you care about. I have a one-time script that does the whole logic

  1. Create a TestClock
  2. Create a Customer and Subscription
  3. Advance time by a day
  4. Report usage
  5. Advance time by another day
  6. Report usage
  7. Advance time until next month
  8. Check the Invoice
  9. etc.
random gazelle
#

Awesome! That makes sense

#

Thank you so much for the help!!!