I have been testing stripe checkout for a few days in order to set-up subscription payments for a company. Stripe checkout is very easy to use but it seems to add some constraints. In particular, I want to set the subscription cancel_at property (https://stripe.com/docs/api/subscriptions/create#create_subscription-cancel_at) and it does not seem to be possible using checkout (https://stripe.com/docs/api/checkout/sessions/create). Maybe I have missed something ? Or should I create the subscription using the checkout and update it later ? Has anyone found a solution ? Thanks for your help
0
votes
1 Answers
0
votes
Your assumption is correct. Checkout doesn't support an equivalent to the subscription's cancel_at parameter. The workaround would be to use Checkout to create the subscription, and later use a subscription-update call server-side to set a cancel_at date:
https://stripe.com/docs/api/subscriptions/update
You can do this immediately after the subscription is created by listening to the checkout.session.completed event, which will contain the newly-created subscription ID. You can read more on how to listen for events from Stripe in these guides here: