#avijit-das_api
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/1393121398037417985
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! so it sounds like you're using Checkout Sessions, is that right?
yes
can you share the request id [0] where you tried to do what you were mentioning? it’ll have the prefix req_
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
anyway, you would want to use mode="subscription", and pass in both your recurring and one-time Prices into line_items. To set the trial, you would pass it in trial_period_days
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I am using NodeJS
alright, you would need to do what i mentioned above :
you would want to use mode="subscription", and pass in both your recurring and one-time Prices into line_items. To set the trial, you would pass it in trial_period_days
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [
{
//price: 'price_1Rgm4rCFT5RH9EjaBa7cnkTx',
},
],
success_url: 'https://example.com/success.html?session_id={CHECKOUT_SESSION_ID}',
cancel_url: 'https://example.com/canceled.html',
});
Trial Plan One Time - $2.99 USD (price_1RibKcCFT5RH9Ejar96yPwVY)
Monthly VIN Subscription- $29.99 USD (price_1RgL2JCFT5RH9EjaZTOCBrqo)
I am using this
can you plz tell me how to write this two pricing_id with this API and where using trial_period_days
you would add both Prices into line_items as an object, and you also need to include trial_period_days as I've mentioned earlier