#pookle_checkout-lineitems
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/1303471460752556072
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ do you have the ID of the creation request that is failing that you can share? Or do you have the error that is being returned when that creation fails?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
pookle_checkout-lineitems
Iโll get it in just a moment
If you can share your code too I can likely spot the issue.
My guess is that you have a bug in the code so our API returns a clear error but you aren't properly catching/handling the error and you end up with the Javascript code crashing instead of redirecting possibly. Make sure to read https://docs.stripe.com/error-handling too
const session = await stripeHandler.checkout.sessions.create({
line_items: [
{
price: "price_",
quantity: 1,
},
{
price: "price_",
quantity: 1,
},
],
mode: "subscription",
success_url: "http://localhost:5173/onboarding/intake",
cancel_url: "http://localhost:5173/onboarding/cancel-payment",
});
Okay that helps a bit but not enough. We need the exact error you get server-side. The client-side code is crashing because your server is crashing right now
type: 'StripeInvalidRequestError',
raw: {
message: 'Checkout does not support multiple prices with different billing intervals.',
request_log_url: 'https://dashboard.stripe.com/test/logs/req_BlFfxt4RRW6rsJ?t=1730843623',oh I am not certain how to get t
Perfect! So now you have the exact error which tells you exactly what the issue is ๐
oh so I cannot have a montly and a annual checkout
So first your code needs to be fixed to properly catch all errors. That's what https://docs.stripe.com/error-handling explains how to do in details. You need to make sure you handle errors, log them to a file and then return a clear error to your client-side code so that it displays it instead of crashing
And then yes correct we don't support mixing up billing cycles right now. It's something we want to do in the future but today it's not possible
So our goal is to provide an option to members to pay monthly BUT we will need to collect an upfront amount from them to cover initial costs
Is that possible and how would you recommend doing that?
So you want for example $10/month but also an extra $100 on the first Invoice for example?
Gotcha, unfortunately that's mostly impossible today. There are "hacks" but you can't easily make that work with Checkout at all
For example you can add an extra $100 one-off Price to the line items and the first Invoice will be for $100 + $10 for example. But the UI won't clearly say the $100 is recurring yearly
will the $100 be billed annually still or would that have to be done manually every year?
This is possible with code, but isn't compatible with Checkout. Knowing that, are you willing to rebuild your integration to not use Checkout at all? Or is it easier to change your business model/approach?
not at this point. A little bit late as we plan to launch in the coming weeks. What would i have to rebuild or what would I need to change
You can't use Checkout for this because Checkout can't show that the $100 is recurring yearly.
So you'd have to use PaymentElement instead which is a different mode of integration for collecting card payments.
Assuming you rebuild that way, then you control the UI showing the amount. So you can show that it's $10/month and an extra $100/year.
and then you can write custom logic to add $100 as a one-off Price once a year. So on the Subscription creation so the first Invoice is for $110, and then each month you get a new Invoice, you "count" what month you're in, and in 12 months when you get the 13th Invoice for the next year your code will add the extra $100 line item again, and you do this each year.
You don't do this "manually", but you write custom code to do this for you end to end
No timeline unfortunately. But you can reach out to our support team at https://support.stripe.com/contact and ask to be added to the wait list!
thank you for your help!