Skip to content

How to extract invoice data to JSON in n8n

To read invoices into structured data in n8n, send the PDF or photo to the 1001fx function extractinvoicedata. It returns fixed JSON fields such as invoice number, dates, supplier with VAT ID and IBAN, amounts and line items; missing values are null.

Step by step

  1. 1

    Get your API key

    Create a free 1001fx account and copy your API key from the app.

  2. 2

    Start the workflow

    Start with a Gmail Trigger node that picks up emails with invoice attachments, or a Google Drive Trigger node that watches a folder of scanned invoices.

  3. 3

    Add the HTTP Request node

    Add the HTTP Request node and send a POST request to https://api.1001fx.com/files/extractinvoicedata with the header X-API-KEY and your API key.

  4. 4

    Fill the fields

    file
    – The invoice as binary data from the previous node, PDF or image.
    fileUrl
    – Alternatively a public URL of the invoice. Fill either file or fileUrl.
    pages
    – Optional pages to read, for example 1-2.
  5. 5

    Use the result

    The answer is JSON with invoiceNumber, invoiceDate, dueDate, currency, supplier, buyer, netAmount, taxAmount, totalAmount, paymentTerms and lineItems. Append them to a Google Sheets table or pass them to your accounting system.

How to set up the HTTP Request node: 1001fx for n8n.

extractinvoicedata costs 13 credits per item. All parameters and examples: extractinvoicedata reference.

Tips

  • Dates come as YYYY-MM-DD and currencies as ISO codes such as EUR, so they need no further formatting.
  • Check important fields for null with an IF node before you book the invoice.
  • For till receipts use extractreceiptdata, for your own fields extractpdfdata.

Frequently asked questions

Does it work with scanned invoices and photos?
Yes. PDFs and images are accepted, also scans, photos, tables and handwriting.
Which fields are returned?
Invoice number, invoice and due date, currency, supplier and buyer with name, address and VAT ID, the IBAN of the supplier, net, tax and total amount, payment terms and line items.
What happens if a value is not on the invoice?
The field is returned as null.