#Kosta
1 messages · Page 1 of 1 (latest)
Hi
Invoice PDF is generated only if it's finalized:
https://stripe.com/docs/api/invoices/object#invoice_object-invoice_pdf
You can create an integration (frontend) that displays the preview of a Draft Invoice, but this can't be achieved natively using Stripe APIs.
integration (frontend) that displays the preview of a Draft Invoice
should i display a frame with some kind of link?
Can I somehow display this iframe here?
at least in the PDF part?
That's Dashboard specific and it's not available via the public API
it turns out the only way to display the isvois is to put it in the "open" state.
and from the status "open" to "draft" the invoice can no longer be transferred. as a result, it is necessary to produce a lot of unnecessary copies of the invoice.
I'm not sure I understand your last message, what is the issue exactly ? what you mean by to produce a lot of unnecessary copies of the invoice. ?
I can show pdf only for "open" invoice. To do this, I need to finalize the invoice. but if I need to change the invoice, then I can't change the "open" invoice. I need to take a "draft" - edit it - and finalize it, I'll get the second invoice.
- actions to remove the first invoice.
To avoid this, you can implement a frontend page that displays the preview (Draft invoice) for your customer, I think it's better than implementing the logic above. Once it's finalized you can display the pdf instead.
frontend page that displays the preview (Draft invoice) for your customer
Now I don't understand a bit.
Do you have a page that I can integrate (<iframe src="https://invoice.stripe.com/i/ ...........>") on my site to display the invoice in the "draft" status?
Nope.
You need to implement that page from scratch using the Invoice/ InvoiceItem APIs, and display the content of a draft invoice in your website.
I don't need API for this. It's clear.
Then the question is how can I generate such a link. it is generated on the platform, but is not accessible from the API in any way.
this functionality suits me perfectly for visualization and downloading pdf. partially I understand how to generate it, but not completely. 🙂
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Is there a particular bit that's not clear?
I don't understand the last two parameters that make up the decoded base64 string
YWNjdF8xTkRUU3hCRHZSOGRWeVhzLF9PMFczZnpCNE5NWUFFdDZqbkRzZHZMQktYRmdGbTdwLDc2MjQ0NDE10200wTpG0vOc
Did you take this from the Dashboard?
yes/
You can't generate these PDFs yourself, unfortunately.
very bad - exactly your PDF format is required. there is no point in sitting and drawing it.
all the complexity is due to the impossibility of returning the "open" invoice to the "draft"
Thank you. thread can be closed.
I understand. Please, let me know if you have any other questions.