#chip_best-practices

1 messages ยท Page 1 of 1 (latest)

meager tuskBOT
#

๐Ÿ‘‹ 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.

dense coral
#

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?

gleaming knot
#

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

dense coral
#

Sounds good! I'll try testing it with metadata first ๐Ÿ™Œ thanks

gleaming knot
#

Welcome!

dense coral
gleaming knot
#

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

dense coral
#

Right, and how do we then handle the other price which is usage-based on monthly basis

gleaming knot
#

As you said, you create a separate Subscription

#

and track the link between them using metadata or via your own database

dense coral
#

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 ๐Ÿ˜„

gleaming knot
#

You can't create a single Subscription with different billing period

#

The only and eaisiest option here is to create two Subscription.

dense coral