#Mallain23
1 messages ยท Page 1 of 1 (latest)
Hi ๐ you will need to make all necessary calls to create a new Invoice that is identical to the one you're trying to clone (there is no endpoint to clone/duplicate an existing Invoice), and then use this endpoint to void the previous one:
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.
Well there is an endpoint to duplicate an invoice
You can "revise" the invoice
By calling the create invoice endpoint with the "from_invoice" param
Oh cool, sounds like that may work well for you.
No
It only works if the original invoice is open
but if I try to void the invoice it wont let me duplicate it or it wotn let me finalize the new invocie
Interesting, I don't have hands on experience with that feature so I'm not exactly sure how it works. Are you able to create/finalize the new Invoice and then void the original?
Is there anyone who has more experience with that - that I could talk to
Sorry, I'm not sure offhand if any of my teammates have experience with that. Is there a specific question about that parameter that you have that I can ask them?
Gotcha, and what additional information are you looking for?
Hello ๐
Taking over as toby needs to step away soon.
Circling back at your initial question
I am trying to duplicate and invoice and void the previous one. I can do this in the dashboard but not via the API - how do I achieve this?
That's exactly whatfrom_invoiceparameter does though, no?
My problem is that
I want to void the original invoice
but it wont let me finalize the new invoice if the old one is voided
But if i do this in the dashboard it allows it
What I really want to achieve is removing applied credits from the one off transaction because the user does not want them to apply
Gotcha. However, I don't understand how voiding the invoice after you've created a new one affects your usecase here
If you void the invoice it releases the credits that were applied to the original invoice
So the flow is 1. Invoice created with credits applied
Payment sheet is opened which finalzies the invoice
user closes payment sheet
User decides to remove credits
We want to revise the invoice and remove the credits applied (which we achieve by removing them from stripe)
When you say credits, you're referring to customer credit balance correct?
yup
Gotcha. I think customer credit balance applies to the next finalized invoice automatically.
Can you confirm if you want it to apply to the next invoice OR if you DON'T want it to apply to the next invoice?
As per my understanding this is expected behavior. The only workaround I know of is that you modify customer credit balance prior to creating the invoice
https://stripe.com/docs/invoicing/customer/balance?dashboard-or-api=api#modifying
And once the invoice is finalized, you credit the balance back
I do not want it to apply to the invoice. THe way we are achieving this (bc stripe does not offer this feature) is to remove the credits from the customer and generate an invoice) and then credit them back
Yes that is what we do
Yeah unfortunately, that's the only way this would work via the API. I am pretty sure it is a dashboard only feature. I can flag this internally as a feature request for the API
My main question is
via the dashboard, i can void an invoice and then duplicate it and then i can finalzie and pay the new invoice
I can only duplicate an open invoice via the API and I am wondering why and if there is a way I can do this
That's what I clarified above, this might be a dashboard only feature at the moment
Are you guys planning on making this available via the API at anypoiint
I can flag it internally as a feature request for the API
Not sure if its on the road map, you can write in via our support team and raise this as a feature request yourself.
https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Ok thanks
NP! ๐ Sorry for the confusion earlier