#el-quick_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/1280641687810609152
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
Hi!
Not sure I quite follow your question. If you create a Subscription with a trial period, the status of that Subscription will be trialing
Yes, and I need to be incomplete, to be confirmed futher, but, since the invoice amount is 0, the subscription get a trialing status.
basically, I want to emulate the behavior impleted in Checkout session when sending payment_method_collection = 'always'
but through the API
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 see, so you want to start a trial but want to force the customer to provide their payment details?
Yes
more or less
I'm using stripe elements, so, when I present the Stripe element UI, I create an unconfirmed subscription in Stripe, but when the Subscription has trial days, it comes trialing immediately,
Got it. It's not possible to do what you're after. A Subscription created in this way will always have a trialing state
Hmmm, too bad (for me)...
In your experience, do you know a strategy to handle that?
You can use the pending_setup_intent's client secret to collect payment details: https://docs.stripe.com/api/subscriptions/object#subscription_object-pending_setup_intent
I also recommend creating the Subscription with a value for trial_settings.end_behavior.missing_payment_method based on how you want to handle missing payment details when the trial ends: https://docs.stripe.com/api/subscriptions/create#create_subscription-trial_settings-end_behavior-missing_payment_method