#anna_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/1356560956733394964
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- anna_unexpected, 6 days ago, 8 messages
Hi, let me help you with this.
You should set cancel_at_period_end=true, and update it to false once the customer explicitly opts-in: https://docs.stripe.com/api/subscriptions/create#create_subscription-cancel_at_period_end
@empty ridge But as far as I understand that's only works when the payment method is "missing". Once the payment method is added in the customer portal, this configuration won't be applicable anymore and the subscription will be automatically created when a trial is over. Or is it not the case?
The parameter I shared is different. It's not directly related to trial settings, please see the link I shared above.
Apologies for the misunderstanding. Thank you! Can setting cancel_at_period_end= true be defined when creating a Stripe checkout session and updating it to = false using Customer Portal? I don't see this property there
Or in other words, how would you recommend handling it if we want to use Stripe checkout for new subscriptions and creating a customer portal session for subscription updates?
Sadly, subscription_data doesn't provide an equivalent field when creating the Checkout Session: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-subscription_data
You will need to listed to customer.subscription.created webhook Event and send a request update the Subscription with cancel_at_period_end=true
The subscription_cancel feature of the Billing Portal can allow the customers to control the cancel_at_period_end parameter themselves: https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_cancel
Ok, got it. Thanks for your help!