#Loterak

1 messages ยท Page 1 of 1 (latest)

spark jayBOT
mighty viper
#

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?

mighty viper
#

@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

viral belfry
#

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.

frank ruin
#

๐Ÿ‘‹ 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.

viral belfry
#

Oh! yeah I've seen messages like this one elsewhere. I was wondering if we could get thsoe through the api

frank ruin
#

That said, you can deduce the reason based on looking at the history of the Sub and when canceled_at was set

viral belfry
#

Wrong attachment sorry ๐Ÿ˜…

frank ruin
#

If that timestamp doesn't align with cancel_at then you know it wasn't due to failed payments and automatic cancellation for instance

viral belfry
#

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

frank ruin
#

Hmm what do you mean the errors from the picture?

#

Those are decline codes

#

They will be associated with the Charges that take place

viral belfry
#

oh, okay. Could I get those through the charges API?

frank ruin
#

Yep