#ambi_code

1 messages ยท Page 1 of 1 (latest)

mossy hornetBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

ocean vessel
#

Yes you likely just need to void any open invoices for that subscription on receipt of customer.subscription.deleted event

bleak trench
#

Actually the problem is that the subscription does not get canceled, but it stays in past_due until the retries are finished. So that's why i opted for this event, since it does not get canceled for a few days

ocean vessel
#

Of course, sub_xxx ID example will help me confirm that

bleak trench
#

ok that's a great suggestion, thanks alot

#

here's an invoice and a subscription attached to it where this occoured: in_1Qi1JK2L54HYtpsWHULDYZ1t

ocean vessel
#

Yeah the portal is configured to cancel at period end. So as you said, sub will stay in whatever state it currently has (past_due) until the end of the current period

#

But sub status is orthogonal to invoice retries โ€“ we'll retry invoice payments even when the associated sub is cancelled. You need to void them manually, so my recommendation to you:

  1. Configure portal session to cancel immediately
  2. Listen for customer.subscription.deleted event
  3. Find any open invoices for that sub via: https://docs.stripe.com/api/invoices/list#list_invoices-subscription
  4. Void them all
#

Should get you the behaviour you want

bleak trench
#

that's exactly what I wanted

#

thank you so much!

#

have a great day/night ๐Ÿค

ocean vessel
#

No problem, glad I could help!