#xavi3rk_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/1438137425443422238
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! I'm having doubts about how to set this up.
First I've made a product for charging the credits to the customer. But i don't understand how this gets added as credit to the customer.
Then I've made a meter to track the message consumption. Here the issue is that messages have different costs depending on the country is sent.
I need to make a meter for each message price?
The other doubt I have is that if I don't want the user to send messages if they run out of credits, I should check the credit balance before accepting the message? Is this a good practice?
Hey there. Sounds like you're looking for a prepaid solution, which is now in Public Preview. I think you'll find this guide useful: https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits/implementation-guide
Hi Dougal, thanks for your help. I've read this, but my only question is: I should add a product for the user to purchase the credit, then listen for the purchase event, and then, through the API, add the credits to the customer account?
And regarding the different prices for each message I should have a different meter for each country?
Yes, that sounds correct. It might be simpler to just have one meter though, instead of different ones for each country, and maybe maintain your own mapping of how many credits for each country message, and deduct them accordingly
Ok, so you say to have a meter that has a $0.001 cost and depending on the message cost send for example 10 usages to deduct $0.01 from the credit
Yes, exactly
Ok, thanks! Any other consideration I should have regarding billing-credits ?
I don't think so, but if anything else comes up specific to your integration, don't hesitate to reach out