#Loterak
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ are these Subscriptions being cancelled automatically after exhausting the payment retry schedule? If so, are you using Smart Retries, or did you define your own retry schedule for those?
@viral belfry wanted to see if my above message came through for you?
If these Subscriptions are being cancelled due to the latest Invoice exceeding the number of allowed payment attempts, then you can reference that Invoice from the latest_invoice field on the Subscription. On that Invoice you can check the attempt_count to see if it aligns with the maximum number of retries your schedule is configured to attempt:
https://stripe.com/docs/api/invoices/object#invoice_object-attempt_count
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hey @mighty viper sorry I missed out on your message. Yes we are using smart retries and checkout sessions too, just in case that's useful to know.
๐ stepping in here
So we don't surface cancellation reason via the API
I do believe we surface the cancellation reason within the Dashboard, but it is Dashboard only.
Oh! yeah I've seen messages like this one elsewhere. I was wondering if we could get thsoe through the api
That said, you can deduce the reason based on looking at the history of the Sub and when canceled_at was set
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Wrong attachment sorry ๐
If that timestamp doesn't align with cancel_at then you know it wasn't due to failed payments and automatic cancellation for instance
yeah i'm currently using canceled_at and cancel_at_period_end. Just wanted to know if I could actually get those messages from the picture using the API
Hmm what do you mean the errors from the picture?
Those are decline codes
They will be associated with the Charges that take place
oh, okay. Could I get those through the charges API?
Yep