#chip_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/1346815978159345745
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
And just to understand correctly, the best approach is to initially create a checkout with the annual price -> listen to webhook -> start a subscription with the usage based price? And "next year", create a new invoice with the annual price again?
You I store this somewhere in the DB...on the subscription metadata? I'll provide an image as wel.
Yes those are two valid optoins
Sounds good! I'll try testing it with metadata first ๐ thanks
Welcome!
Am I thinking correct here, btw? It shouldn't be the other way around either?
Actually, the first Checkout will create an annual Subscription, so each year a new invoice will be created automatically
As you'll be using annual price
So no need to create a new Checkout Session
Right, and how do we then handle the other price which is usage-based on monthly basis
As you said, you create a separate Subscription
and track the link between them using metadata or via your own database
Ah, my bad. I tried to say if I should only have one subscription and create a invoice with the API for the annaul fee
Using the upcoming invoice to check if its been a year since the subscription was started.
Does that make sense? ๐
To me it does sound like more work than needed, but I'm just making sure here ๐
You can't create a single Subscription with different billing period
The only and eaisiest option here is to create two Subscription.
No, that's true. In this case, the usage-based monthly subscription would be the only one, and when the user has been on that sub for 12 months, we listen to the webhooks and create a invoice for the other fee as well outside of the sub ๐
But I'll test with two subscriptions first. Sounds atleast easier! THanks