#guy_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/1351639940886298624
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
You can structure your code to collect and configure cancellation details when your code attempts to cancel the subscription (triggered by customer wanting to cancel the subscription) - https://docs.stripe.com/api/subscriptions/cancel#cancel_subscription-cancellation_details
You could also use metadata to store this information
The other option is to use a Subscription Schedule - https://docs.stripe.com/api/subscription_schedules/create
You can configure it to cancel the Subscription once the Schedule ends - https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-end_behavior
The issue I am having is that I am getting the subscription status from the API, and currently when a subscription is due to end, it is canceled by the API. So if a customer cancels a subscription or it ends, the status returned is the same
Yeah you can't use status parameter for your usecase as such. You'd want to rely on other parameters such as cancellation_details to figure out what triggered the cancelation
Can I set the cancellation details using the end_behavior?
Not really, you set end_behavior on the Schedule object (not the underlying Subscription, that's different)
Or I suppose set cancellation_details when a customer cancels and if its null then its because the subscription ended?
yup, that's what I suggested above
Ok, thank you for your help
NP! ๐ Happy to help