#Santos
1 messages · Page 1 of 1 (latest)
Hi there
What you would need to do is List Refunds (https://stripe.com/docs/api/refunds/list) and then expand the PaymentIntent when you list
That will get you the Customer associated to each Refund
What if a source was used when creating the refund? Here's the log: req_jX4UXzIth6gxHK
Ah I'm sorry. You said "unlinked refunds"
I missed that
Hmmm no I don't believe there is any way to query the Customer for unlinked refunds....
There is no property on the Refund object that would indicate this other than the associated PaymentIntent/Charge
Which obviously doesn't exist in this case
Thanks for clarifying 👍
Sure thing
Ah one more question if you don't mind.
No problem
The way we were handling refunds before, we were pulling the latest invoice and grabbing the charge ID from it. We would then create a refund using this charge ID. This was for customers who decided to cancel their subscription via our UI.
We ran into an issue with downgrading products; if a customer downgraded their product, we would modify the subscription and then the existing refund creation logic would fail because the latest invoice was for a downgrade which has no charge ID.
So the steps are:
- modify subscription (downgrade)
- create refund using latest invoice charge (fails)
Would you recommend changing the order? So:
- create refund using latest invoice charge
- modify subscription (downgrade)
We want to create the refund after the subscription modification takes place; if the modification fails, we don't create a refund.
Yeah I wouldn't change the order
It sounds like you just don't want to rely on latest_invoice
You want to List Invoices for the Subscription using https://stripe.com/docs/api/invoices/list#list_invoices-subscription