#mochihealth_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/1219832896374968350
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you share your code and the error message?
the types safety that stripe shipped in their sdk doesn't appear to know about the cancellation_details field
so I just want to be 100% sure that it exists
also is that the best way to actually know what the reason was for cancellation
Can you share your code and the stripe-node version you use?
I'm just getting the event object that the customer.subscription.deleted event sends you and trying to access that field
how can I be sure that the subscription either got deleted because it was set to cancel at period end, payment failed or like a manual cancellation
how can I differentiate between those scenarios given the data on the subscription object
apiVersion: '2022-11-15',
cancellation_details is not a deprecated field: https://docs.stripe.com/api/subscriptions/object#subscription_object-cancellation_details
cancellation_details exists since stripe-node v11.14.0: https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md#11140---2023-03-09
It's likely that you're using older stripe-node version. I'd recommend updating to the latest version v14.21.0: https://github.com/stripe/stripe-node
Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.
Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
what happens if I update the stripe api version will anything break?
Here's the changes between API version: https://docs.stripe.com/upgrades#api-versions
I'd suggest checking these changes and reviewing your integrations accordingly
I dont see a clear way to distinguish what actually triggered the subscription cancellation
You should be able to find the cancellation reason from cancellation_details.reason: https://docs.stripe.com/api/subscriptions/object#subscription_object-cancellation_details-reason
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if I am using an older version of the stripe api will this field still exist event though the api version that I'm using does not know of its existence?