#Sophia Wong
1 messages · Page 1 of 1 (latest)
Hi there. So you want to create a PaymentLink for subscriptions?
Yes. Both for a new subscription scenario and a renew scenario. Just now I tried to create a checkout session with subscription mode, but got empty subscription_id in return data.
Is the checkout session completed?
no. I cancelled it. So it's the reason? If user cancels a checkout session payment, there'll be no subscription created?
I'm still working in these APIs and Docs to find my way. Thank u for ur response. I'll leave messages if there're more problems.
Yes you are right, Stripe won't create a subscription if the checkout session is cancelled.
Well, here is my problem, how can I get the subscription_id from a checkout session object. I dumped it but the attribute 'subscription' is empty.
Sorry I have to left for about 2 hours. See you later.
You should listen to checkout.session.completed event and get the subscription ID upon receiving the event.