#sai_rez - delete draft invoice
1 messages ยท Page 1 of 1 (latest)
If the invoice is for a subscription, it will need to be voided https://stripe.com/docs/api/invoices/void
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can a draft invoice be considered as finalised?
No, draft and finalized are different states. An invoice will be in draft form for an hour or until you make a call to finalize it
So for a customer who has multiple draft invoices what's the best way to handle this use case? Ideally I would like to remove them
Could do, I have been looking at a few customers and they have 1 subscription but multiple draft invoices, possible from automatic collection which failed
Here you go
cus_KJnWUfCR5nGFZi
They have an unpaid subscription, this requirement is to clean up invoices on unpaid, overdue, and cancelled subscriptions
Thank you. Checking in to them now
Thanks
Apologies, still looking in to this. The other threads I am on got busy. I should be able to get back to this in a minute.
No worries, thanks for the update
Thank you for understanding. I am reaching out to a colleague who can look in to this while I am juggling. Apologies for the delay
Appreciate the help
My colleague is still looking in to this. We can see that the initial failed invoice failed after all payment attempts were unsuccessful and that the draft invoices have been cancelled almost immediately after being created. We are looking in to how and why they were cancelled here.
I assume your end goal in this case is to have Invoices not be generated anymore in this scenario?>
Yes exactly, we have already taken measures to mark failed invoices as uncollectable, we're now looking to cleanup existing ones
Our initial idea was to mark all draft and open invoices for unpaid/overdue/cancelled customers as uncollectable, however it seems for draft that can only be done if they are finalised
Hi ๐ I'm stepping in for @mortal quarry
These invoices after the initial failed one are all in a closed_canceled state.
Could you explain what that is, haven't come across it
Yeah it can be tough because we see this records in our admin pages. The DB provides "friendly" terms and names so it can be difficult to explain what I am seeing to you. Let me take a closer look
Yes, it's preferred you keep all discussion here. Especially since it's related.
Okay will keep in mind, I had a quick question, hopefully simpler to answer. Are invoices with status overdue on the dashboard the same as status open?
Not exactly.
When making an api call to list all invoices for a customer, they all return as open, however on dashboard it;s overdue, curious if that's expected
The status attribute is a little more fine-grained: https://stripe.com/docs/api/invoices/object#invoice_object-status
Yes I had a look at these, so on the dashboard when there is a status of failed or overdue next to an invoice, it's technically still open as it's not been paid?
I think that is the case. I need to review these in my own test account. But the Dashboard values are intended to provide you an idea of what is going on, where the invoice.status is trying to give you a real time description of the current state of the invoice.
Hey @zenith carbon any updates on closed_canceled status?
That is the object state for the invoices associated with that subscription/customer.
They do show appear to show up as Draft in the DB though
Hold on, I'm going to investigate.
Unfortunately you cannot remove these invoices.
You can mark them as void to indicate you will not seek payment
If this is not the behavior you want when invoices go unpaid you can review the different configurations in our docs and make adjustments to how your subscriptions are created:
https://stripe.com/docs/billing/subscriptions/overview#subscription-objects
I can't void them unfortunately as they are not finalised
Yes we've made adjustments in the settings to avoid this already, we are just looking to clean the data of previous customers
What error do you get when you try to finalize/void exactly?
{ "error": { "message": "You can only pass in open invoices. This invoice isn't open.", "type": "invalid_request_error" }
}
Can you share more information like the exact invoice id and the exact request id?
in_1J3fkXKl7yri9QNLkIc2TRnR
It's a test account, no live account details
doesn't matter, please roll the API key as anyone could have seen it
Okay so it's all Test mode, why does this matter overall?
Because we have customers in our live account that have multiple draft invoices that we would like to remove, it's clean up the data
So using test mode with similar customer properties to test
gotcha
so what you need to do instead is this
1/ Update the invoice to set auto_advance: false if it's not set
2/ Finalize the invoice (this won't charge since you disabled auto advance)
3/ Void the invoice
Unfortunately we don't let you void an open invoice, you always have to finalize first ๐ฆ
Okay will try, thanks a lot for your patience
Of course! sorry this is confusing, that's why we discourage the "mark subscription as unpaid" flow a lot