#alexpanda_unexpected
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/1370158144029720766
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, this is the invoice in question:
https://dashboard.stripe.com/invoices/in_1RGQaDATydeHsTlRxTAK0x81
I would like to know how best to handle this by either preventing this entirely, or if I can know how to get the correct subscription ID from the webhook event data.
Hello
As far as I know, Once the subscription is cancelled then we stop finalizing invoices automatically. In this case, looks like the invoice was paid by the customer using Hosted Invoice page after we stopped retrying the invoice.
We don't automatically void the invoices for cancelled subscription though
how can you tell it was a hosted page action by customer?
and is there a way for me to get the subscription ID in this case during the charge.succeeded event?
Ideal way to handle this ->
You could listen for customers.subscription.deleted webhook event and list all associated invoices using List all invoices API - https://docs.stripe.com/api/invoices/list#list_invoices-subscription
You can filter using subscriptions and status param
how can you tell it was a hosted page action by customer?
I looked at our internal logs
and is there a way for me to get the subscription ID in this case during the charge.succeeded event?
The charge object isn't associated with a subscription directly. You'd need to look at the associated invoice first and then expand that to look at the subscription
https://docs.stripe.com/api/charges/object?api-version=2024-06-20#charge_object-invoice
https://docs.stripe.com/api/invoices/object?api-version=2024-06-20#invoice_object-subscription
In the newest API version though (Basil) - we've made a few changes so the above approach won't work when you eventually update to the latest API version
does the new approach work on old API?
It does not. The new API version lists this change as a breaking change.
https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices#why-is-this-a-breaking-change
Thanks for the context, I think I have what I need