#BarrelRider
1 messages · Page 1 of 1 (latest)
Hello 👋
Give me a moment to take a look
Hello Hanzo, hope you are well. Thank you 🙂
hmm I really thought this doc would have more information on this
https://stripe.com/docs/billing/subscriptions/cancel?dashboard-or-api=dash
Typically when you cancel a subscription, the prorated amount is credited to customer credit balance.
I'm unsure how refunding the credit balance works. Give me a few to look deeper
Sure that will be very helpful, also just to add I am looking for the simplest solution really, so can the customer for example transfer the balance manually from stripe credit thingamajig to their account?
I mean that as a fallback if I can't do it like I wanted to. I can't imagine having to process for example 1000 refunds by myself, manually.
Okay apologies for the delay here. Looks like refunding to the PaymentMethod is a dashboard only feature as of today.
When you cancel a subscription via the API then the prorated amount is added to customer credit balance
In order to refund from the credit balance
1/ Look at the credit in the account balance and/or sum pending invoice items
2/ Use the List Invoices API and pass the subscription id in the subscription parameter to only view Invoices for that subscription. Also expand the associated charge if any.
3/ For each invoice:
- Check if there’s an associated charge
- If so, create a refund for up to the amount of the account balance
- If the charge amount is smaller than the credit, refund fully and subtract the charge amount from the credit
4/ Move to the next invoice in the list until the full credit has been refunded
5/ Update the customer’s account balance back to 0 via the API and/or delete the pending invoice items.
that should allow you to refund the credit balance via the API
gotcha, not a problem and thank you for all the effort, that seems like whole lot of work!
I do have a follow up questions, simpler one but I feel I know the answer, it has two parts:
- Can customer see in the customer portal how much money is in the credit account?
- Can user do that by himself via the either billing portal or some other link?
1/ I don't think that's currently possible. We don't show customer balance in the customer portal
2/ Unfortunately, not possible.
Ok I may need to rethink if I want to offer refunds in a first seems like a lot of things can go wrong.
You've been great Hanzo, that is all for now, thank you!
NP! 🙂 Sorry for the wait, server is running is a bit busy today.
Good luck