#Typedef-subscription-refund
1 messages · Page 1 of 1 (latest)
Could you share the use case when you would like to refund a subscription?
sometimes customer would buy a subscription and would want a refund
how would i give them full amount
through stripe api
Will the subscription be cancelled?
In general, subscription itself can't refund automatically. If there's any downgrade to the subscription, then the fund will be credited to customer's balance which customer can use for the next invoice: https://stripe.com/docs/billing/customer/balance
If you wish to refund the credits in customer's balance, then you can:
- Find the invoice list of a subscription and expand the
chargefield: https://stripe.com/docs/api/invoices/list
https://stripe.com/docs/api/expanding_objects - Create a refund on the charge for up to the amount of customer's balance obtained from Step 1: https://stripe.com/docs/api/refunds/create
- 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 - Update the customer’s balance back to 0: https://stripe.com/docs/api/customers/update