#hume-jacob_best-practices

1 messages ¡ Page 1 of 1 (latest)

soft edgeBOT
#

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

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

steel needle
next bobcat
#

Yeah it didn't seem like a normal usecase for subscriptions. I could probably hack something together all on my end where I just invoice at a threshold but was wondering if there was something on y'all's end

steel needle
next bobcat
#

let me take a look

#

maybe i'm missing it in the docs, but can you help me find how credit grant deductions work? e.g., someone has used our products and we want to remove credits from them based on that usage?

steel needle
#

I thought we had that in the docs, looking now and will get back to you

#

Is that helpful, or did I just make things more confusing?

next bobcat
#

No, I think that was the missing piece in my understanding of billing credits. I think this is probably the right solution here.

One other topic, I think we'd like to charge users when their credit balance gets below a certain level and then top up their credits based off of that charge. I don't see anything in the documentation that suggests there is an out of the box solution for that, but I imagine it shouldn't be too hard to do on my end. Does that align with your understanding?

steel needle
#

That does align with my understanding but I will double check and get back to you

soft edgeBOT
steel needle
#

Apologies for the delay, still looking in to this. You are right that we don't have a good built in way to do this, I think what you would want to do is retrieve the user's current amount of credits each time a payment is made with the credits. You can listen to invoice.paid events to see when the payment happens, I am figuring out how to check a customer's current credit amounts

next bobcat
steel needle