#kierandt
1 messages ยท Page 1 of 1 (latest)
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
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
A credit note specifically adjusts the amount of a finalized Invoice
That is what it is designed for.
You could use the Customer Credit Balance (https://stripe.com/docs/billing/customer/balance) if you wanted to adjust the amount of an upcoming Invoice
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?
Hmm good question
I don't believe so
But you could test this out using a test clock
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 ๐
Sounds great