#kierandt

1 messages ยท Page 1 of 1 (latest)

median girderBOT
granite zenith
#

Currently I am trying to apply a credit note when I receive the invoice.created event, but it does not let me since the invoice is in draft.

#

The invoice is created apart of a subscription_cycle billing reason, so I can't wait for it to be finalised as it'll be attempted to make payment at that point it's too late to apply the credit note

willow geyser
#

Hi there

#

So in this case you would want to finalize the Invoice yourself and set auto_advance: false (https://stripe.com/docs/api/invoices/finalize#finalize_invoice-auto_advance) when you do so. This will stop payment from occurring. Then you can add the credit note and then trigger a payment attempt via https://stripe.com/docs/api/invoices/pay

granite zenith
#

Okay that does make sense to me, I never thought to do that. Is there any actual reason why you can't apply a credit note to a draft invoice? Just curious to know this

willow geyser
#

A credit note specifically adjusts the amount of a finalized Invoice

#

That is what it is designed for.

granite zenith
#

Yeah I was going to but our customers can have multiple subscriptions so we need to apply the adjustment of balance to a specific invoice so I had to use the credit notes. Do you know that, is i set auto_advance = false, finalise, apply credit note and then set auto_advance =true, it will try to collect the payment on the already finalised invoice?

willow geyser
#

Hmm good question

#

I don't believe so

#

But you could test this out using a test clock

granite zenith
#

Yeah sure, I'll try it with a test clock and our webhook handlers, I'l see what happens. If you're curious, I'll come back and let you know the result in a little while ๐Ÿ™‚

willow geyser
#

Sounds great