#hume-jacob_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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.
Good question, our subscription offering doesn't support this typically but I think that may be something that billing mode flexible helps with. Looking in to this and will get back to you
https://docs.stripe.com/billing/subscriptions/billing-mode
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
Our usage based billing docs have a credit burndown model. Have you seen this and if so would it work for your usecase? https://docs.stripe.com/billing/subscriptions/usage-based/pricing-models#credit-burndown
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?
I thought we had that in the docs, looking now and will get back to you
We automatically apply billing credits to our invoices when they finalize. So the idea is you grant the credits, create a subscription, report usage, and then when the subscription cycles we create an invoice for that usage and apply credits against that
https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits/implementation-guide#get-available-billing-credit-balance
Is that helpful, or did I just make things more confusing?
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?
That does align with my understanding but I will double check and get back to you
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
I think you can do it as mentioned in the last link you sent me at https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits/implementation-guide#get-available-billing-credit-balance
Yep, just found the endpoint myself. Also we emit a billing.credit_balance_transaction.created event whenever credit from a grant is applied, so you can also listen to that event to keep track of your user's credits
https://docs.stripe.com/api/events/types#event_types-billing.credit_balance_transaction.created