#aaaaaaaaaaaaaaa-refund-amount
1 messages · Page 1 of 1 (latest)
for example customer have a subscription for 1 year and he want to cancel the subscription after 1 month now how can we calculate the amount for refund depends the period left
That seems like a business decision that is up to you. Do you already know the formula that you're planning to use to calculate refunds and are trying to figure out how to retrieve the necessary information for that calculation from the related Stripe objects?
I guess I dont know the formulae but can we calculate the amount depend on time left with the total amount
like I found the formulae 5000-5000/12
5000 is the total ammount paid
We won't be able to tell you the formula that you should be using when calculating refunds, particularly as we're not familiar with the sector that you're doing business in or any legal requirements that you'll need to take into consideration. This forum is intended for helping developers build API-based integrations and answering the technical questions that arise during that process.
I was just about to get back to you. We have an endpoint for retrieving upcoming invoices you can use it to preview calculations based on if you do certain actions https://stripe.com/docs/api/invoices/upcoming
You can also use the invoice_now and prorate parameters when canceling the Subscription to generate an invoice reflecting the prorations. However, if this results in an Invoice with a negative balance, that amount will be credit to the Customer's balance but will not be refunded to their provided payment method. If you decide to issue a refund for the amount, then you'll want to void the negative Invoice to avoid it skewing the Customer's balance.
https://stripe.com/docs/api/subscriptions/cancel