#markos-billing

1 messages ยท Page 1 of 1 (latest)

onyx bramble
#

Hello! give me a minute and I'll take a look

#

Can you give me a slightly more detailed example of what you're trying to accomplish? It's not quite clicking in my brain, so hopefully an example will help

wary dome
#

For sure! @onyx bramble

We're allowing our subscribers to have 3 free units (units in this case # of moving violations/traffic tickets)** for the year** if they subscribe to our monthly plan or $30/mo or our annual plan of $250/year ($25/mo). It's easy to set this up obviously for the annual billing cycle, but not sure how to do it with the monthly billing cycle. Does that make sense?

#

After their 3 free units (moving violations) we'll charge them $50 per additional unit

onyx bramble
#

I think I'm following - what is your expectation of how much is charged each month though? Don't you want the charged usage there to be just what was accumualated in the past month?

wary dome
#

the standard rate monthly plan which is $30/mo. I guess it's more of an "add-on charge" than usage? You pay $30/mo no matter what, but as soon your "usage" is above 3+ units, it's $50 per additional unit.

0-3 units (for the year) => $30/month
3+ (for the year) => $30/month +$50 per unit.

onyx bramble
#

Thinking out loud - what if you split this into two prices?

  • $30/month price that will charge this no matter what the usage
  • another price that has a free tier for a 0-3 quantity, and then charges $50 per unit after that?
wary dome
#

Ok I think you're onto something!

can the 0-3 quantity be based on yearly usage but still billed monthly? Or do we simply pass in the usage count based on our own client-side logic?

onyx bramble
#

You'd either pass in the usage once and make sure the price has recurring[aggregate_usage]: last_ever so that it always looks for the last usage that was recorded across multiple periods, or every month you'd record the usage and use any of the other aggregate_usage types to just look at usage during that period (https://stripe.com/docs/api/prices/object#price_object-recurring-aggregate_usage)

wary dome
#

You da the man! This is cooler than Taco Bell's new Doritos locos!

onyx bramble
#

๐Ÿ™‚ happy to help! definitely test this out and make sure it does exactly what you want it to - these more specialized prices can get a bit wonky

wary dome
#

for sure!