Skip to content

Suppliers PDF invoice emails

Parse PDF invoices sent by email

Suppliers send invoices as PDF attachments. This layout reads the invoice number from the subject and parses the PDF's text layer, so the invoice's text arrives in the delivery as `parsed.attachments[].text` for your code or an accounting tool to read.

Use this layoutFree plan included: 2 layouts per endpoint.
The email
From
Acme Supplies <billing@acme-supplies.example>
Subject
Invoice INV-2026-0142 from Acme Supplies
Attached
INV-2026-0142.pdf
Please find invoice INV-2026-0142 attached. Payment is due in 30 days.
What your endpoint delivers
{
  "parsed": {
    "status": "matched",
    "layout": {
      "id": "pdf-invoices",
      "name": "Supplier invoices"
    },
    "fields": {
      "invoice": "INV-2026-0142",
      "due": "30"
    },
    "lineItems": []
  }
}

Shortened: the delivery also carries parsed.attachments, with the text or rows read from INV-2026-0142.pdf.

The layout

It matches the email by its subject, reads each field with an RE2 pattern, and parses the attachments. Edit any of it in the endpoint's settings, where the preview tries it on an email you captured as you type.

{
  "id": "pdf-invoices",
  "name": "Supplier invoices",
  "match": {
    "conditions": [
      {
        "field": "email",
        "name": "subject",
        "op": "contains",
        "value": "Invoice"
      }
    ]
  },
  "fields": [
    {
      "name": "invoice",
      "from": "subject",
      "pattern": "Invoice (\\S+)"
    },
    {
      "name": "due",
      "from": "text",
      "pattern": "due in (\\d+) days"
    }
  ],
  "parseAttachments": true
}

More senders