Skip to content

The moment it happens

Read invoice details from a PDF or photo

Each invoice you send comes back as supplier, date, totals and line items, ready to file.

Runs
The moment it happens
Apps
Mistral AI
AI
Not needed
Access
API key

Send this to your assistant

Create a ClickRuntime automation: give me a link I can post invoice PDFs or photos to. Run Mistral OCR on each one, extract the supplier, invoice date, total, VAT and line items as JSON, and email me the result.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Accounts payable still runs on PDFs and phone photos. A supplier emails an invoice, a driver snaps a receipt, a client sends a scan, and someone retypes the vendor name, invoice number, date, total and VAT into the accounting system. It takes a few minutes per invoice, mistakes creep in, and a transposed digit in a total can mean a wrong payment or a reconciliation problem weeks later.

You send the invoice file or a link to a web address provided by ClickRuntime. The document is read by Mistral's OCR service, turned into text, and a chat completion extracts the fields into structured JSON, such as supplier, number, date and total. The JSON is returned to you and also emailed. It runs as soon as the file arrives.

Bookkeepers, small finance teams and developers building invoice workflows use it to skip manual typing.

What you get out of it

  • Data entry time drops sharply

    Reading fields from the document replaces minutes of retyping per invoice. Over a month with hundreds of invoices, that is days of work given back to the finance team. That is a clear saving.

  • Fewer transcription errors

    Machines do not transpose digits in an invoice number. Cleaner data reduces payment mistakes and the awkward emails with suppliers that follow. Each corrected digit saves a later correction in the books.

  • Photos and scans work

    OCR handles phone pictures and scanned PDFs, not just digital ones. Receipts from the field can be processed the same day instead of waiting for someone to retype them at the office.

  • Structured output fits your systems

    Getting JSON means the fields can be passed on to accounting software, a spreadsheet or another automation. You do not need to copy values from a text blob. That makes follow-on automation straightforward.

  • Faster approvals and payments

    When data is extracted within seconds, an invoice can enter the approval queue the same day. That helps you capture early payment discounts and keep suppliers happy. Faster handling improves relationships too.

  • Consistent fields every time

    Every invoice produces the same set of fields, whatever the layout. Reports and checks can rely on them, which is not true of hand-typed notes. Reviewers then know exactly where to look in each document.

How it works

What happens, step by step

  1. When you send a link to an invoice PDF or photo to your personal ClickRuntime link, the automation starts straight away.

  2. Mistral reads the text from every page of the invoice.

  3. AI pulls out the supplier, invoice date, total, VAT and each line item with its quantity and amount.

  4. The details are emailed to you, ready to file or copy into your accounts.

Before it runs live

  • Connect Mistral AI
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Read invoice details from a PDF or photojust nowSucceeded
Email · InvoicesInvoice from Northwind Supplies {"invoice_date": "2026-10-14", "total": 1440.00, "vat": 240.00}

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Mistral AI steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
extract_invoice_data_from_pdfs_with_mistral_ocr.pyexample
import json
from clickruntime import on_event, credentials, notify, http

API = "https://api.mistral.ai/v1"

@on_event
def handle(event):
    url = (event.json or {})["url"]
    headers = {"Authorization": f"Bearer {credentials.secret('MISTRAL_API_KEY')}"}
    kind = "image_url" if url.lower().endswith((".png", ".jpg", ".jpeg")) else "document_url"
    ocr = http.post(f"{API}/ocr", headers=headers, timeout=120,
                    json={"model": "mistral-ocr-latest", "document": {"type": kind, kind: url}}).json()
    markdown = "\n".join(p["markdown"] for p in ocr["pages"])
    chat = http.post(f"{API}/chat/completions", headers=headers, json={
        "model": "mistral-small-latest", "response_format": {"type": "json_object"},
        "messages": [{"role": "user", "content": "Extract supplier, invoice_date, total, vat and line_items "
                                                 f"(description, quantity, amount) as JSON from:\n{markdown}"}],
    }).json()
    invoice = json.loads(chat["choices"][0]["message"]["content"])
    notify.email_me(f"Invoice from {invoice.get('supplier')}", json.dumps(invoice, indent=2))
    return invoice

FAQ

Common questions

Which fields does it extract?
Typical fields are supplier name, invoice number, invoice date, due date, currency, line items, tax and total. The set can be changed to suit your documents, and anything not found is returned as empty instead of guessed.
Do I need a Mistral account?
Yes, you need an API key from Mistral for the OCR and chat steps. The key is stored as a secret in ClickRuntime, and it is used only to process the files you send. Only the files you send are processed.
How accurate is the extraction?
It is generally strong on clear invoices and weaker on blurry photos or unusual layouts. For payments, it is sensible to check the totals before approving, and a mismatch between line items and total is worth flagging.
What permissions does it need?
API key. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Read invoice details from a PDF or photo” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.