Send an e-invoice by email
This guide creates an XRechnung whenever a sales invoice is posted and sends it to the customer by email. It uses an E-Document Service without a service integration, so Business Central itself sends nothing – the flow does.
Before you start
- AutoFlow E-Document for Germany is installed.
- In Business Central, an E-Document Service for XRechnung exists without a service integration, see E-Document Services.
- Company information, bank account and the customer's buyer reference are filled in – otherwise the step stops with Business Central's message.
Build the flow
- Create a flow with a trigger on the posted sales invoice, for example a record trigger on the Sales Invoice Header table.
- Add Create E-Document. Set Record to the trigger record and E-Document Service to your XRechnung service.
- Add a Send Email step. Fill in the recipient – for example the customer's email address from the invoice – a subject and a text, and attach the
Documentoutput of the previous step. - Publish the flow.
Try it
Post a sales invoice for a customer. The flow creates the XRechnung, and the customer receives the email with the XML file attached. In Business Central, the document is listed as an E-Document, so you can look it up there.
Variations
- To send the e-invoice through your e-document provider instead of by email, pick a service with a service integration. The step then creates and sends, and you can drop the Send Email step.
- For a credit memo, use a flow on the posted sales credit memo the same way.
- For ZUGFeRD, pick a ZUGFeRD service and fill in the Report, Report Parameters and Layout fields; the attachment is then a PDF.