#j-warin_best-practices

1 messages ¡ Page 1 of 1 (latest)

olive masonBOT
#

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

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

brisk vapor
#

For storage are you charging per MB or GB?

#

How does that work

#

And do they pay for a storage limit (ie they have a 1TB limit for example) or pay for how much they're actively using?

violet kraken
#

Not sure yet! Could charge by GB.
For example, first 5GB free, then 1$ per GB per month.

#

But if one month you don't add or remove any files, and you use 6GB in total, you still pay 1$ this month.

brisk vapor
#

Yeah sounds like you want a fixed fee for that

#

So you'd have a subscription with 2 prices

#

1 metered for the compute

#

and 1 fixed for the storage

violet kraken
#

But I can't use a meter to record storage usage, right ? I would send stripe storage increment of decrement per user.

brisk vapor
#

Depends on how you want to model the pricing

#

But what you described to me is a fixed price

violet kraken
#

I might not express it correctly, sorry ...
Alright, let say you subscribe and it's 10$ a month and you get 5GB included.
Extra storage is 1$ per GB.
You upload a 6GB File, so first month you pay 1$ extra at the end of billing period.
Then second month even if you do nothing, price is still 11$
When I uploaded the file, I used a meter event to say "add storageusage to this customer"
When I delete a file, I use a meter event to say "remove storage usage from this customer"

Would that work ?

brisk vapor
#

I personally wouldn't use a meter for that

#

I would have 2 prices

#

1 for $10 a month base

#

Then a second which is a $1 price

#

And you can update the quantity of that second $1 price on the sub depending on how much overage they use

#

Or you could do a $10 fixed price and a second metered price for the overage

#

Up to you

violet kraken
#

Seems like easiest would be to limit storage to 5GB then they can upgrade by subscribing to an extra storage option. In that case I keep track of total storage and check subscription ?

brisk vapor
#

What do you mean

#

By this part: In that case I keep track of total storage and check subscription ?

violet kraken
#

So my confusion comes from the following : "Who keeps track of the total storage usage ?"

brisk vapor
#

You do

#

It's your cloud service

violet kraken
#

So I keep a field with each customer's storage user and bill accordingly then ?

brisk vapor
#

I mean you need to be keeping track of this in your database

#

But I'd assume the customer can upgrade storage in your app

#

At which point you'd also need to update the subscription in stripe

#

Not sure i really understand what you're asking

violet kraken
#

Well I guess this whole thing comes from me thinking you might have a Meter for which you can increment and decrement value, that does not reset every month. Then I don't need to keep track myself.

brisk vapor
#

That's not a meter

#

That's a fixed price with a quantity which you can increment and decrement

#

What I described above

violet kraken
#

Sounds good, thanks for the help !

brisk vapor
#

No problem

#

You'd call that endpoint to update quantity of the $1 price depending on overage use

violet kraken
#

Ok now I think I understand how to do it. thanks so much

#

I suppose, add_invoice_items.price --> Extra Storage x what is needed ?

brisk vapor
#

What do you mean

violet kraken
brisk vapor
#

You update the quantity of the subscription item containing the $1/month price

violet kraken
#

Sounds good !, sorry my mistake I meant items.quantity not add_invoice_items.price

#

Last question, let's say this update happens in month 1, then we do nothing, the quantity will be kept for the second month ?

brisk vapor
#

Yeah unless you update it again to decrement

violet kraken
#

Perfect, that's exactly what I needed thank you so much, especialy the prompt response !
Good day !