For the complete documentation index, see llms.txt. This page is also available as Markdown.

Invoice with line items

Extracting metadata and line items from invoices with examples in Python and Node.

Overview

This guide covers how to extract metadata and line items from multiple supplier invoices with examples in Python and Node. For this example, we will use the Pretrained model.

You will extract the following metadata fields:

  • Name of the supplier

  • Name of the receiver

  • Invoice number

  • Purchase order number

  • Issue date

  • Pay due date

  • Total amount

You will extract the following line item fields:

  • Product number

  • Product description

  • Quantity

  • Price

This guide shows you how to

Getting your API Key

The Authorization header for your API key is: Token YOUR-API-KEY (Login if you do not see one). You can also obtain the API key by visiting the Settings page.

Getting your API key

1. Create a new document type

Before you start extracting data, you need to define a document type. Navigate to the Dashboard page and click on the New document type button in the top right corner of the table. Next, select the Pretrained model, followed by Use a Predefined Template. Next, click on Line item invoice card. The wizard will already pre-fill all the needed extraction fields along with the document type configuration. Click on the Create document type.

This will create a new document type with name line-item-invoice with the following fields:

  • supplier_name

  • supplier_vat_id

  • buyer_name

  • buyer_vat_id

  • invoice_number

  • payment_reference

  • invoice_date

  • payment_due_date

  • service_date

  • total_amount

  • net_amount

  • vat_amount

  • IBAN

  • payment_purpose_code

  • purchasing_order

  • currency

and line items fields:

  • item_code

  • item_description

  • unit

  • net_amount

  • vat_amount

  • gross_amount

  • discount_percentage

  • discount

  • unit_price

  • quantity

  • vat_rate

2. Extract data from documents

Here are two examples of invoices that you can use for data extraction:

Download them and extract the data using the code:

1 Open file as base64 string (Lines 6-7)

Make sure that you are pointing to the correct path.

2 Specify payload (Lines 8-12)

3 Specify headers (Lines 16-20)

4 Make POST request (Lines 22-24)

Response:

Need a more in-depth explanation of the response? You can read about it here.

Running Typless live

The only thing that you need to do to automate your manual data entry is to integrate those simple API calls into your system.

Typless usage is very easy and straightforward!

Last updated