Free plan

Read e-invoice

Read the details out of an electronic invoice
POST
/v1/documents/einvoice-read

About this tool

This tool opens an electronic invoice and shows what is inside: who sells and who buys, each line, the tax groups, the totals and how to pay. It reads the data file (XML) or a PDF that has the data attached. It works with the common standards such as Factur-X, ZUGFeRD, XRechnung and Peppol. A normal PDF without the attached data cannot be read.
For example, a supplier sends a ZUGFeRD PDF and you want to see its amounts and lines without retyping them.

How to use it

  1. Choose this tool.
  2. Add the e-invoice file (XML or PDF) with Upload or drag and drop.
  3. Choose whether to show the invoice lines, and whether to give you the data file as well.
  4. Press Generate.
  5. Read the details on screen or copy them.

What you get back

You get the invoice details as a structured list on screen, with amounts as numbers. You can copy it or download it.
GOOD TO KNOW
A PDF with no XML attached is an ordinary PDF and is refused. The file is read, never run. Counts as one document.
TEST IT LIVE

Try Read e-invoice in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/einvoice-read
Tool ID
documents.einvoice-read
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/einvoice-read" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'attachment=factur-x.xml' \
  -F 'lines=true' \
  -F 'extract_xml=false'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.einvoiceRead({
    "file": 'document.pdf',
    "attachment": "factur-x.xml",
    "lines": true,
    "extract_xml": false
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->einvoiceRead([
    'file' => 'document.pdf',
    'attachment' => 'factur-x.xml',
    'lines' => true,
    'extract_xml' => false,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Read the data of an e-invoice (UBL, CII, Factur-X, ZUGFeRD, XRechnung, Peppol) from an XML file or from the XML attached to a PDF: parties, lines, VAT groups, totals and payment, as plain JSON, with amounts as numbers.

Read e-invoice works from text and settings, so no file is needed. Every input is optional.

Read e-invoice is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/documents/einvoice-read with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.