#box-subs

1 messages ยท Page 1 of 1 (latest)

winged roost
#

Has the invoice been finalized yet? I believe credit is not applied to invoices until they've been finalized

grand condor
#

Ah okay gotcha, the invoice is upcoming. My initial query was how I could downgrade a subscription and refund the difference. Would this still be the correct approach?

winged roost
#

There's a lot of different ways to do this, and the one that was suggested to you initially will work. An alternative is that you could use the Upcoming Invoice API just to calculate how much the downgrade refund amount would be, downgrade the subscription with prorations disabled, and then create a credit note (https://stripe.com/docs/invoicing/integration/programmatic-credit-notes) on the previous full payment to partially refund the amount you calculated

Use the Invoicing API to adjust or refund finalized invoices with credit notes.

grand condor
#

Ahh okay thank you, let me try that approach. Let me have a play around, could you keep this thread open for a few mins just in case anything else pops up? ๐Ÿ™‚

winged roost
#

yup!

grand condor
#

Sorry if I'm being a bit slow here; how would I use the Upcoming Invoice API to calculate how much the downgrade refund amount would be? Wouldn't it just show the current plan's price if I do it before downgrading the plan?

winged roost
#

Let me clarify - with the upcoming invoice API, you can pass in the parameters you would use when downgrading the subscription to preview what an invoice would look like if you downgraded and generated prorations

#
grand condor
#

Ahhh I understand now, alright give me a moment ๐Ÿ™‚

#

Okay, I've generated an upcoming invoice -- just to clarify, ending_balance would be the value I'm looking for?

winged roost
#

I think you'd want ending_balance - starting_balance (in case the customer already had some balance). Alternatively, I think subtotal would also work

grand condor
#

Ah sweet, would subtotal be ending_balance - starting_balance? Or how is it calculated if you know?

winged roost
#

I guess it really depends on what you want (and there are so many different fields on the invoice object) - subtotal is strictly the total of all the line items and will not include an invoice level discounts/taxes (see https://stripe.com/docs/api/invoices/object#invoice_object-subtotal). total will include all discounts and taxes, and will likely be closer to ending_balance-starting_balance

grand condor
#

Amazing, thanks for your time karbi. I think that's pretty much everything I needed help with ๐Ÿ™‚

winged roost
#

Happy to help!