xero-node icon indicating copy to clipboard operation
xero-node copied to clipboard

Attach PDF to emailed invoices from API

Open AndrewLugg opened this issue 4 years ago • 2 comments

SDK you're using (please complete the following information):

  • Version 4..11.0

Is your feature request related to a problem? Please describe. Attaching PDF to "emailInvoice" API endpoint. We have customers that use automated systems such as Hubdoc which automatically import the PDF from email, but if the invoice was generated via the API, I am unable to attach the PDF to the email, so they have to manually process our invoices, which they are grumpy about.

Describe the solution you'd like Able to set "Attach PDF" on the API call, and it attach the same PDF as the web interface.

Describe alternatives you've considered We are looking at generating the PDF manually to just look like the one Xero generates, and attach that document to an email that we generate, but we would have to be really careful to make sure that all the data is identical. And it seems like a lot of work for a feature that should be included.

We considered using the "download PDF" option via the API, but the API version of PDFs don't include custom fonts from the template. When the web version does include our fonts. So we would be forced to use our own PDF generation servers. The custom font is 3of9 for barcodes.

AndrewLugg avatar Jun 20 '21 23:06 AndrewLugg

Hi Andrew.

So to get to the crux of this are you saying createInvoiceAttachmentByFileName is not working as expected?

https://xeroapi.github.io/xero-node/accounting/index.html#api-Accounting-createInvoiceAttachmentByFileName

Or are you trying to use the getInvoiceAsPdf but the fonts/template aren't accurate across as API (that is a known limitation of the get as pdf endpoint).

https://xeroapi.github.io/xero-node/accounting/index.html#api-Accounting-getInvoiceAsPdf

--

Not sure if your goal is to related to the attachments on an invoice, or generating the invoice and its data as its own pdf.

SerKnight avatar Jun 21 '21 15:06 SerKnight

I would like to use emailInvoice endpoint to send an email to my customer, with the Invoice PDF attached.

I am unable to use getInvoiceAsPdf because of the font issues.

I am not wanting to use createInvoiceAttachmentByFileName, as I am just trying to send the customer a copy of the invoice PDF not any attachments.

Essentially this screen via API and set the "Include PDF attachment" sendInvoicePDF

AndrewLugg avatar Jun 21 '21 22:06 AndrewLugg