#haroon2022
1 messages · Page 1 of 1 (latest)
hi! what does 'refunding a subscription' mean exactly? A subscription could have had dozens of payments made over the course of a year or two for example.
the A monthly subscription is currently and customer has used it for 10 days. Now, I want to refund the amount of the remaining 20 days directly on his card
You could cancel it, with proration enabled, then check how much the proration was, then issue a manual refund of the PaymentIntent from the first Invoice, and probably also then reset the customer's balance back to zero
https://stripe.com/docs/api/subscriptions/cancel#cancel_subscription-prorate
https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-proration <- find the items on the final cancellation Invoice that are proration
https://stripe.com/docs/api/refunds/create#create_refund-payment_intent <- call with the PaymentIntent from the first paid Invoice and the amount you take from looking at the proration that was calculated