#jamesedwards-subscriptions
1 messages · Page 1 of 1 (latest)
Just to back up for one second - what is your desired behavior here? I assume you have the whole flow working where you refund back the customer for the remaining days of their subscription, but are you ALSO getting an additional invoice for a negative amount when the subscription has been cancelled?
i am trying to issue a refund when the customer cancels for the prorated amount
this link was provided by another stripe helper in this discord
Sorry, let me rephrase that question - do you have an example invoice ID you can send over, and then you can describe to me what you want to happen instead?
sure
i restarted teh subscription but you can see teh credit balance was applied
i want to cancel or void that invoice before it can apply a credit balance to the customer
i can't seem to void a scheduled/draft invoice
Gotcha! So really, what you should so is you should change your cancel subscription request to not set prorate: true and invoice_now: true. If you leave those out, then the negative amount invoice won't be created at all and you won't have to worry about this
cant do that
not really what im asking either
is it possible to void a scheduled/draft invoice?
would setting "auto_advance" to false stop the invoice from moving to paid?
trying to void i get this error
StripeInvalidRequestError: You can only pass in open invoices. This invoice isn't open.
if you want more context - are you able to see the previous thread in this discord where proration was discussed?
You can only void an invoice after it's been finalized, but I don't belive this isn't going to work for you because Invoice's that have no amount due (because the amount due is less then or equal to 0) automatically transition to paid after finalization.
they dont appear to be automatically transitioning to paid
You could leave the Invoice as a "draft" with auto_advance: false so that it never finalizes, but you won't be able to void it
it doesn't need to be voided, but it needs to never hit paid, because upon moving to paid it adds a credit balance to the customer account for the amount that has already been refunded successfully
Then leaving it as a draft should work fine
But really, if you have no intention of ever using this invoice, why do you need to create it at all?
so after creating the refund charge how do i keep that invoice as a draft
the invoice is created as a result of the refund
Ah I see where the confusion is - let me try and explain:
- You create the subscription, which generates Invoice A
- Your customer wants to cancel in the middle of the subscription, you refund them from the charge from Invoice A
- After creating the refund, you then go ahead and cancel the subscription which is accidentally generating Invoice B for a negative amount
What I'm saying, is that you don't need to generate Invoice B at all. You would still keep Invoice A, which is what you used to create the refund.
Invoice B is not being created as a result of the refund at all. They are completely separate
hmm, so the subscription cancellation creates teh invoice?
cant that be disabled on subscription delete with a parmeter
Yup! That's what my suggestion is - you should make sure to pass in prorate: false and invoice_now: false when you cancel the Subscription
👍 glad I could clear that up!
there is a step that is left out where the proration is calculated with retrieveUpcoming invoice
but that isnt actually doing anything and the refund isnt creating an invoice
when would anyone ever use proration ?
in the parameter
Setting prorate: true during cancellation is work nicely if you don't want to refund the customer - we'll create a credit back for unused time on the subscription that can be applied to a customer's future invoices/subscriptions
sure but it seems so odd that that money is stuck as a credit balance in stripe
i appreciate your help today
i think what we discussed will work in my case, but seems to defeat the purpose of proration since it should be able to go back to the customer card
That's fair, and I know it's a bit complicated - I wasn't around when this was built so I don't have a ton of insight into why we don't support refunds for the subscription cancellation out of the box, but it sounds you've got something working!
thanks again
I need to hop off for the day, but if you have any other question @uneven slate can answer them!