#LordGrim
1 messages · Page 1 of 1 (latest)
👋 happy to help
it really depends on what you want to happen
Need a very simple usecase.
Assuming a subscription of $100 (plan price) * 10 (quantity) = $1000
Expected behavior:
On downgrading in a running cycle, from 10 quantity to 5 quantity.
New invoice of $100 (plan price) * 5 (quantity) = $500 should get deducted from the previous invoice's credit
And user should get refund of remaining $500.
it won't technically happen this way because of prorations
so let's say you started the subscription in the 1st of the month
and on the 15th you want to change the quantity
the invoice will be calculated as such
Remaining time (quantity 10) 100 * 10 * 15/30 (-500)
New price (quantity 5) 100 * 5 * 15/30 (250)
the remaining 250 would be added to the Customer Balance
and it will be used to pay subsequent invoices
Hi! I'm taking over my colleague. Please, let me know if you have any other questions.
So, according to what @tame raptor mentioned, I want exact same flow with some extra functionalities.
i.e. On downgrading the subscription's quantity
- automatically generate a new invoice with the updated quantity
- deduct the new prorated amount for new invoice from the previous invoice
- refund the remaining amount to user
will all these cases will be handled by just using "subscription.update({... quantity: newQuantity })"?
You can use the proration_behaviour: always_invoice: https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
But I am not sure if the rest will be refunded to the customer. It will add to their credit balance and then apply to the next invoices: https://stripe.com/docs/billing/customer/balance
Please, let me know if you have any other questions.