#Village_Admin - Dispute Subscription ID
1 messages ยท Page 1 of 1 (latest)
๐ you would go dispute -> PaymentIntent -> customer and then list invoices for that customer and check their PI to match and then the Sub ID is associated with the invoice.
You make it sound so easy ๐
It is not a happy path
I only expect a customer to have a single active subscription, is there a shortcut on that to get from customer to subscription without taking a detour through invoices?
Oh yeah sure. You can list subs by customer
So you just go dispute -> PaymentIntent-> customer and then list subs and the returned Sub will be the only option
Oh, i think i see another option, i have to run a test to see if its returning as i think it should, but...
dispute -> charge[expand invoice] -> invoice.subscription
Ah! You are correct. I forgot we contain the invoice with the charge itself.
Good call
That would be better then you don't have to list subs
Charge::retrieve(['id'=>$chargeId, 'expand'=>['charge']]);
I only need "charge" for the expand to work?
Is there a way in the dashboard for a "lost" dispute to have it fire off a webhook again? So i don't need to create a new customer & transaction & dispute?
I know about going into webhook logs, but i setup a new webhook which wasn't there when the dispute happened, so i can't resend it on the new webhook.
Hello! Yep, specifying charge should be all you need there to expand the charge property.
You may be able to resend a previous event from the Dashboard if you go into Developers > Webhooks > select the endpoint receiving the events > select the specific event you want to resend > click on the Resend button.
Oh, didn't read that last sentence until I typed that!
No, you can't resend it then. You can fetch it from the API if it happened less than 30 days ago though: https://stripe.com/docs/api/events/retrieve
Okay thanks, im done with this thread.
Happy to help! If you need anything else let us know!