Developer guide

Invoice Email Parser

Invoice email automation breaks when templates vary across vendors. ParseForce lets you define the fields finance systems care about and route invoice emails into a JSON pipeline.

Fields that usually matter

AP workflows rarely need the whole email. They need a small, reliable set of fields that downstream systems can reconcile against purchase orders and payment runs.

  • Invoice number, PO number, subtotal, tax, and total.
  • Currency, payment method, and due date.
  • Optional line items or shipment context when operations shares the mailbox.

How to keep invoice extraction maintainable

A narrow invoice schema reduces churn when vendors change wording. Treat the schema like an interface contract, not a data lake.

  • Separate invoice mailboxes from general vendor communications.
  • Keep nullable fields explicit when some vendors omit them.
  • Persist both the parsed result and raw sender metadata for audits.

Where invoice parsing plugs into your stack

Invoice parsing is usually the first step in a larger finance workflow rather than the end destination.

  • Send parsed invoice data to AP review queues or exception handling jobs.
  • Match PO references before creating payables in your ERP.
  • Keep the parsed payload available for downstream reconciliation and reporting.

Example JSON output

Example webhook payload shape for this workflow.

json

{
  "event": "email.parsed",
  "mailboxId": "mbx_ap_88",
  "parsedData": {
    "invoice_id": "INV-84217",
    "po_number": "PO-5518",
    "subtotal": 1180,
    "tax": 104.5,
    "total": 1284.5,
    "currency": "USD",
    "due_date": "2026-02-29",
    "payment_method": "ACH"
  },
  "rawEmail": {
    "from": "billing@northstar-industrial.com",
    "subject": "Feb shipment invoice"
  }
}

Node.js invoice ingestion example

Minimal Node.js example for consuming ParseForce output.

node.js

import express from "express";

const app = express();
app.use(express.json());

app.post("/webhooks/parseforce/invoices", async (req, res) => {
  if (req.body.event !== "email.parsed") {
    return res.status(202).end();
  }

  const invoice = req.body.parsedData;

  await saveInvoice({
    invoiceId: invoice.invoice_id,
    poNumber: invoice.po_number,
    total: invoice.total,
    currency: invoice.currency,
    dueDate: invoice.due_date,
  });

  return res.status(204).end();
});

async function saveInvoice(record) {
  console.log("persisting invoice", record);
}

app.listen(3000);

Related guides

Related ParseForce pages

Explore related ParseForce pages for webhook delivery, schema design, and implementation details for adjacent email automation workflows.

See the full product overview