#meisei81-subscriptions
1 messages · Page 1 of 1 (latest)
hi there! The extra amount to pay can be invoiced to the customer immediately : https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment
It depends on what you mean by refunding immediately. If you downgrade a subscription, the amount will be applied to the customer balance : https://stripe.com/docs/billing/customer/balance. Stripe will not automatically refund the difference to the customer's payment method. That's something you need to implement
If I want to refund the difference to the customer's payment method, what should I do?
Look at the credit in the account balance and/or sum pending invoice items
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. 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
- Move to the next invoice in the list until the full credit has been refunded
Update the customer’s account balance back to 0 via the API and/or delete the pending invoice items.
When upgrade or downgrade subscription, I want to split this to two steps: 1. set the old subscription end 2. create a new subscription. And after the two steps, the amount to pay or amount to refund could be executed immediately?
when you end the old subscription, i'm assuming that you're enabling prorations as well. If so, then there will be two invoices issued - one for ending the old subscription, and another for the new subscription.
Since ending the old subscription will likely end up with a credit during proration, that will be applied to the customer's balance. When you create a new subscription, any credit in the customer's balance will be applied to the new invoice.
If there is still credit left in the customer balance i.e. invoice for new subscription < credit in customer's balance and you want to refund the remaining credit, then you need to implement the logic i mentioned previously
The refunded amount is in the stripe system, not in the customer's bank card? How could it apply to the bank card immediately?
yes, the credit that is due to a subscription proration is in Stripe i.e. it is applied to the customer's balance, not the customer's card. There is no way to apply it to the bank card immediately. Unfortunately this isn't a feature we offer right now. You have to implement the logic i mentioned before to refund the credit to the customer's card
Hi @cinder hedge I'm taking over this thread, let me know if you have any questions
just answer my question above. thanks.
My colleague Alex has already answered the previous questions, is there a new question?
hello?
Hi there
could you see my question above?
I see no new questions, your previous questions are already answered by alex.
yes, the credit that is due to a subscription proration is in Stripe i.e. it is applied to the customer's balance, not the customer's card. There is no way to apply it to the bank card immediately. Unfortunately this isn't a feature we offer right now. You have to implement the logic i mentioned before to refund the credit to the customer's card
Did you see this answer?
no
So, which api could I use for to implement the logic Alex mentioned?
I know if I want to refund the difference when execute downgrade subscription, I should find the invoice which belong to the subscription, and find the latest invoice to refund. Which api to use to refund?
https://stripe.com/docs/api/refunds/create you can use the refund API to create a refund. Please note that you need to specify a Charge or PaymentIntent object on which to create it.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok
Hi, if a customer cancel a subscription, the rest amount would be applied to customer's balance?
Yes, it will go to the customer's credit balance
When upgrade to more expensive subscription, if pass the create_proration parameter, the extra amount would be paid in next invoice? if pass the always_invoice parameter, it would be paid immediately?
Yes you are right
However, there are also some cases where immediate payment can happen even if the proration_behavior is create_prorations, see https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment
ok
"When the billing period changes"---- How to change the billing period? Does it mean to change the subscription periods?
The frequency of invoices, for instance change from a monthly to yearly.
https://stripe.com/docs/api/prices/object#price_object-recurring based on your price object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
well, it will influence all the subscriptions related to the price, right?
Nope, it will only affect the updated subscription.
You can't change the recurring property of an existing price. You can change the subscription's price property.
you mean change the subscription's price to another so that it can approach the billing period changes target?
Yes. For instance, changing a price from monthly to yearly will trigger immediate payment.