#joschi_best-practices

1 messages · Page 1 of 1 (latest)

eager lavaBOT
#

👋 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/1346053157146595379

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

turbid shoal
#

hi there!

#

that's not something we support on Stripe. so you'll need to build this on your end: keep track of how much the user needs to pay, and when it reach to maximum, prevent them from using your service.

main badge
#

Thanks for the clear response. That helps already. 😅

Are there any plans to enable something like this? We'd need to implement this on our end as well anyway, but we'd like to be sure that our customers never have to pay more than what they configured as a threshold.

My current approach would be to add a dynamic discount on any invoice in draft state which somehow got over the configured cap. Is there a better approach?

#

So just to sum things up: We'd keep track of the spending on our end before reporting usage (meter events) to Stripe and then stop sending meter events once we reached the spending limit?

turbid shoal
#

My current approach would be to add a dynamic discount on any invoice in draft state which somehow got over the configured cap. Is there a better approach?
I'm not sure I follow. can you give a concrete example of how this would work?

main badge
#

We're building a product which ingests a lot of data from customers and we're charging per ingested event (with three different types of events which are charged differently)
So for example we're charging $0.20 per million events of type 1️⃣, $0.30 per million events of type 2️⃣, and $0.40 per million events of type 3️⃣.

These events are ingested in bulk and not individually, so we're receiving anything between 1,000 and 100,000 events at a time (could also be more) per customer.
The number of ingested events per type are reported to Stripe via meter events to one of three billing meters which correspond to event type 1️⃣, 2️⃣, or 3️⃣.

Now we want to enable them to limit their spending per billing cycle on our platform in case they have a sudden extreme influx of events, but since we receive the events in potentially very large batches, we'd either need to start reporting partial batches to Stripe or reduce the final invoice amount by some value which was metered over the configured spending limit,

Imagine the customers have a limit of $100.00 per month and the upcoming invoice is already at $99.90 and now we receive a batch with one million events of type 1️⃣.
If we report all 1,000,000 events to Stripe, the upcoming invoice will be $100.10, so we'd need to add a discount of $0.10 when the invoice draft is being created, so that the customers only have to pay $100.00.
The alternative is only partially reporting this batch (i. e. 500,000 events) to the respective billing meter in Stripe.

turbid shoal
#

so you don't want to restrict users when they reach the limit, instead you just want to cap the total amount of the Invoice?

#

if so, then yes looking at the draft invoice, and adding a negative line item or a discount would work!

main badge
#

Yes, correct.

There's another twist that we want them to be able to continue to use the product for a short period of time without paying for the ingested events during that time.
But let's not overcomplicate things for now. 😓

eager lavaBOT
obtuse trellis
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

main badge
#

Hi @obtuse trellis, I think I got the answers I needed. Thanks a lot.

obtuse trellis
#

can I close the thread then?