ReadEInvoice
methodName: "ReadEInvoice" converts incoming e-invoices (PDF or XML) into the Finax JSON representation. This article explains the inputs, backend behavior, and practical examples.
Use cases
A ZUGFeRD or XRechnung PDF is uploaded into the suite and needs to be converted into structured data.
Existing XML files should be turned into Finax JSON for further processing.
Validate incoming invoices (status messages + business summary).
Request fields
attachmentId
alternative to xmlAttachmentId/xml
ID of an existing attachment (PDF or XML).
xmlAttachmentId
alternative to attachmentId/xml
Direct reference to an XML attachment in the archive.
xml
alternative to the IDs
Raw XML string (e.g. from a form field).
returnXml
no
Returns the parsed XML in the response.
credentials
no
Optional API key in case it is not configured globally.
Important: set exactly one data source (attachmentId XOR xmlAttachmentId XOR xml). Otherwise the endpoint returns 400.
Backend workflow
Determine the source
For PDF attachments the controller first checks that it is a binary PDF.
Optional XML extraction
PDF →
/v1/pdf/xml/to extract the embedded XML.XML string/attachment → used directly.
Convert to JSON
/v1/json/xmlreturns the Finax JSON plus metadata.
Build the response
JSON ends up in
response.Invoice.response.Xmlis only populated whenreturnXmlis true.
Journaling
FinaxJournalstores success/failure, attachment IDs, and abusinessSummary.
Response fields
Invoice
Finax JSON object with all extracted data.
Xml
Original or extracted XML (optional).
Messages
Notes from Finax (format detection, validation hints, etc.).
Example: read a PDF attachment
const result = await app.businessFunction({
functionName: "Finax",
methodName: "ReadEInvoice",
attachmentId: 8123,
returnXml: true
});
console.log(result.Invoice?.document_totals);
app.setFieldValue("txtXmlPreview", result.Xml);Example: XML from a form field
const xml = app.getFieldValue("txtIncomingXml");
const result = await app.businessFunction({
functionName: "Finax",
methodName: "ReadEInvoice",
xml,
returnXml: false
});
await app.setJsonValue("jsonInvoice", result.Invoice);Tips & troubleshooting
With
returnXml: trueyou can save or display the XML regardless of the original medium.If the PDF is broken or contains no embedded XML, Finax returns an error (“No embedded XML found”, etc.) that surfaces both in the response and the journal.
ProcessReadEInvoiceAsyncautomatically tries to resolve the related app/record from the attachment so journal entries show up on the correct dataset.For large PDFs check whether an XML version is already stored in the archive and prefer
xmlAttachmentIdwhen possible.
Last updated
Was this helpful?