Melaya · Build and run AI agents across your business tools, browser, desktop apps and Android phone. Seven connected products on one governed platform: Agents, Assistant, Device Control, Browser Control, Computer Control, MCP Server, and Marketing. Bring your own AI and keep human approval on every consequential action.

Melaya Blog

How to Automate Invoice Processing: A Step-by-Step Build

Automate invoice processing from capture to payment: the steps, the controls, the metrics to track, and where human approval belongs. Includes a build plan and costs.

Abstract isometric invoice automation workflow

To automate invoice processing, connect five stages into one workflow: capture, extraction, validation, approval routing, and posting to your accounting system. Let software do the reading, matching and routing. Keep a person on every step that moves money. Expect exceptions: even well-run programs do not reach 100% touchless processing, so design the exception lane first.

This guide covers the stages, the controls, a build plan you can run in a few weeks, the numbers to track, and how an agent platform such as Melaya fits in.

TL;DR

  • Automating invoices means automating the full cycle: receive, extract, match, route for approval, pay, reconcile, archive. Digitizing PDFs alone is not enough.
  • Use AI or OCR to read invoices, but gate every financial write with deterministic checks: vendor match, PO match, duplicate detection, tolerance thresholds.
  • Plan for exceptions. Industry benchmarks put average touchless rates around a third of invoices, so build a review queue from day one.
  • Payment release stays behind human approval. In Melaya, every consequential action (sending, paying, writing to connected apps) runs behind human approval.
  • Measure cost per invoice, cycle time, touchless rate, and error rate before and after. Get a baseline first.

What invoice processing automation covers

The Association for Financial Professionals describes AP automation as converting supplier invoices into a standard digital format, moving them through a digital workflow that ends in paying the supplier, and automating receiving, coding, approval routing, payment and reconciliation. The point is to remove manual data input across the whole chain, not just at the first step.

That gives you a clear scope. A workflow is automated when each of these stages runs without someone retyping data:

  1. Capture. Invoices arrive by email, supplier portal, EDI or upload and land in one place.
  2. Extraction. Vendor, invoice number, dates, line items, tax and totals become structured fields.
  3. Validation. Fields are checked against vendor records, purchase orders and receipts.
  4. Approval routing. The right person sees the right invoice, based on amount, cost center or vendor.
  5. Posting and payment. The approved bill is written to the ERP or accounting system and scheduled for payment.
  6. Reconciliation and archive. Payments are matched to bank statements and the invoice is stored with an audit trail.

Why the exception lane decides whether automation works

Not every invoice goes through cleanly. Stripe notes that missing data, pricing discrepancies and complex approval rules require manual intervention and can create bottlenecks. Parseur cites Ardent Partners figures of a 32.6% industry-average touchless rate and a 49.2% best-in-class rate. In practice that means a typical team should plan for roughly half to two thirds of invoices to touch a human at some point.

Parseur's model uses three lanes, and it is a good template:

Lane What happens Who acts
Straight-through All fields extracted, vendor and PO match within tolerance No one, until payment approval
Field-level review One or two low-confidence fields flagged AP clerk confirms the fields
Full exception No PO, new vendor, math error, possible duplicate AP clerk or controller investigates

Build the review queue before you tune extraction accuracy. A good queue shows the source document next to the extracted values and the rule that failed.

Rules-based capture versus AI agents

Template-based RPA and OCR break when layouts change. Deloitte describes rules-based automation as following predefined steps, so templates can fail when a new vendor layout, missing fields or a redesign appears. Deloitte's view is that AI agents can adapt to new formats, explain escalations and learn from patterns.

The practical split:

  • Use a model for interpretation. Reading an unfamiliar layout, mapping a vendor's line description to a GL account, summarizing why an invoice was escalated.
  • Use deterministic code for decisions. Is this vendor known? Does the total equal the sum of lines? Is this a duplicate? Is the variance inside tolerance?

Houseblend's deterministic-first approach states this plainly: AI helps with varied layouts, but deterministic validation decides whether a document may create or update a financial transaction, and mismatches go to a review queue.

The validation checks every workflow needs

When AI or OCR extracts data from an invoice, the system should compare it to the matching purchase order and receipt and, on a mismatch, trigger exception handling and notify the right people, as the AFP guide describes. Houseblend lists the controls that make this safe: validating sender, file type and routing rules; matching against known vendor, PO and item records; required fields, duplicate detection, currency handling and tolerance thresholds; and preserving the source, extracted values, rule results and approval history.

A minimum rule set you can implement in the first sprint:

  • Sender and file type are on the allowlist.
  • Vendor exists in the vendor master. New vendors always go to review.
  • Invoice number plus vendor plus amount is not already in the ledger.
  • Line items sum to the stated subtotal; tax and total reconcile.
  • Currency matches the PO.
  • Variance to PO and receipt is inside your tolerance (for example, a fixed dollar amount or a small percentage that your controller sets).
  • Required fields are present: invoice number, date, payment terms, remit-to details.

Bank detail changes deserve their own rule. Any invoice that carries different remit-to details than the vendor master goes to a human, every time. If your team is also rolling out AI tools more broadly, an AI security checklist helps you map which tools staff already use and where the risks sit before you connect them to finance data.

A build plan: from baseline to monitoring

This is the sequence we recommend. Each step has an output you can check.

Seven stages of an invoice automation build

Step 1: Map and baseline the current process

Pull 30 to 90 days of invoices. For each, record the channel it arrived by, the time from receipt to approval, the time from approval to payment, who touched it, and whether it needed a correction. Output: a one-page map and four baseline numbers (see the metrics section).

Step 2: Segment invoices

Split by type: PO-backed, non-PO, recurring, and one-off vendors. PO-backed invoices from repeat vendors are your first automation target because matching rules are clearest. Output: a ranked list of segments by volume and by ease.

Step 3: Define rules and approval matrix

Write down tolerance thresholds, approver by amount band, and what counts as a full exception. Every rule needs an owner. Output: a one-page policy the workflow will encode.

Step 4: Connect capture and the system of record

Route a shared AP mailbox into the workflow and connect your ERP or accounting system. Rutter describes an integration that reads bills, vendors and chart-of-accounts data, then writes approved bill payments, credit memos, journal entries, attachments and reconciliation data back. It also calls for idempotency so a retried write cannot create a duplicate entry, plus audit trails and request logs. Treat those three as requirements for any write path you build.

Step 5: Run in shadow mode

Process invoices through the new workflow without posting anything. Compare extracted fields and routing to what your team actually did. Output: field-level accuracy per vendor and a list of rules that fired wrongly.

Step 6: Go live on one segment with approvals on

Turn on posting for the first segment only. Keep a human approving each bill and each payment batch. Widen only after two to four weeks of stable numbers.

Step 7: Monitor and tune

Review the exception queue weekly. Every recurring exception is either a rule to add, a vendor to onboard properly, or a field to extract differently.

Where humans stay in the loop

The payment step is where caution pays. XBSTACK's guidance for an invoice approval agent is that the pipeline should extract, validate math and vendor, detect duplicates, match PO or contract, route for human approval and write to the ERP idempotently, while collecting evidence and routing exceptions rather than releasing funds on its own. It adds that the agent should not call bank APIs directly: it recommends a payment release, and a person on the finance team confirms and submits it.

The AFP guide notes that payment after approval can run with automated execution or minimal human intervention. That is a policy choice for your organization and your auditors. Our recommendation: automate everything up to the approval, then require a named person to approve posting and payment.

Where humans stay in the loop

How Melaya fits

Melaya is an AI automation platform where you build agents visually in the Agent Builder: models, tools, memory, schedules, approvals, triggers and multi-agent pipelines in one traceable, replayable run. For invoices, a typical design looks like this:

  • Trigger: a schedule or an inbound event starts a run when new invoices arrive.
  • Extraction agent: your chosen model reads the document and returns structured fields.
  • Validation step: deterministic checks run against vendor and PO data. Failures route to a review queue.
  • Approval step: a human approves before anything is written to a connected app or any payment is initiated.
  • Posting: approved data goes to your accounting or ERP system. Melaya has a native integration with Odoo, among other platforms.
  • Trace: every run keeps an execution trace you can replay when an auditor or controller asks why a bill was posted.

Two details matter for finance teams. First, Melaya is bring-your-own-model. It works with any cloud or local AI model, including Claude, GPT, Gemini, DeepSeek, Mistral, Qwen, Ollama and LM Studio, so you can keep invoice data on local infrastructure if your policy requires it, and swap models without rebuilding the workflow. Melaya does not sell or require its own model for agents. Second, every consequential action (publishing, sending, paying, writing to connected apps) runs behind human approval. Agents do not pay or send unsupervised.

Some suppliers only expose invoices through a web portal with no API. Our browser automation lets an approved model operate those sites, with you approving the consequential steps. Computer Control extends this to desktop software, and it requires the Melaya desktop app.

Our view on invoice automation

We think the right mental model is that your AI is the brain and Melaya is the controlled pair of hands. A model can read a crumpled PDF from a vendor it has never seen. It should not decide alone whether money leaves the account.

That is why we build around granular permissions, approval controls and execution traces. A finance lead needs to answer three questions after any run: what did the agent see, what did it do, and who approved it. Our replayable runs are designed to answer all three.

We also think provider independence matters more in finance than elsewhere. Invoice data is sensitive, and model quality and pricing change quickly. Teams should be able to move from a cloud model to a local one without rebuilding their rules and approvals.

Melaya Team

Metrics: how to measure the result

Measure the same four things before and after. Without the baseline from step 1, you cannot say what changed.

Metric How to calculate What it tells you
Cost per invoice Total AP cost (people, systems, overhead, outsourcing) divided by invoices processed Whether automation is paying for itself
Cycle time Receipt date to approved date, and approved date to paid date Where invoices wait
Touchless rate Invoices with no human edit divided by total invoices How well rules and extraction fit your vendors
Error and duplicate rate Corrected fields and duplicate payments per 1,000 invoices Whether controls work

For cost per invoice, APQC's benchmark gives a median of $6.00 per AP invoice across 5,846 organizations, calculated as total AP cost divided by invoices processed, including personnel, systems, overhead and outsourced costs. Because it is a median, half of organizations are above it and half below. Use it as a reference point, then compare against your own baseline.

Payment impact is the fifth number. Workday ties automation to paying invoices accurately and on time and to better visibility of outstanding liabilities for working-capital decisions. Track late-payment fees avoided and early-payment discounts captured as separate lines.

Expect the touchless rate to rise gradually. One production write-up argues that fully automated is a destination, not a starting state, and that extraction pipelines still need ongoing correction. Treat the first 90 days as tuning.

What it costs to run on Melaya

Published prices at the time of writing, from our pricing page:

Plan Price
Sandbox $0 per month
Melaya Assistant $9.99 per month
Browser Agents $9.99 per month
Mobile Agents $9.99 per month
Melaya Marketing $14.99 per month
Outpost $20 per month
Forge $49 per month, or $469 per year
Bastion $129 per month, or $1239 per year
Citadel from $490 per month

Start in the Sandbox to build the shadow-mode workflow from step 5. Check the pricing page for what each plan includes and for current terms.

Start with one vendor segment

Pick your highest-volume PO-backed vendors, build the validation rules and approval step, and run a shadow week. Melaya gives you the visual builder, the approval controls and the run traces in one place, with the model of your choice.

Melaya

See Melaya plans and start in the Sandbox

FAQ

Can AI fully automate invoice processing?

AI can automate reading, matching and routing for most routine invoices. It cannot responsibly remove people from exceptions and payment release. Benchmarks cited above put average touchless rates near a third, so design for a review queue and human approval on payments.

What is the first step to automate invoice processing?

Baseline your current process. Collect 30 to 90 days of invoices and record channel, cycle time, touches and corrections. Then segment by invoice type and start with PO-backed invoices from repeat vendors, where matching rules are simplest.

Do I need an ERP to automate invoices?

You need a system of record where approved bills are posted, which can be an ERP or accounting package. The workflow should read vendor and chart-of-accounts data from it and write approved entries back with idempotent writes and an audit trail.

Can I use a local model for invoice data?

Yes, if your platform is model-agnostic. Melaya is bring-your-own-model and works with local options such as Ollama and LM Studio as well as cloud models, so sensitive invoice data can stay on your own infrastructure.

Sources

Recommended

Frequently asked questions

Can AI fully automate invoice processing?

AI can automate reading, matching and routing for most routine invoices. It cannot responsibly remove people from exceptions and payment release. Benchmarks cited above put average touchless rates near a third, so design for a review queue and human approval on payments.

What is the first step to automate invoice processing?

Baseline your current process. Collect 30 to 90 days of invoices and record channel, cycle time, touches and corrections. Then segment by invoice type and start with PO-backed invoices from repeat vendors, where matching rules are simplest.

Do I need an ERP to automate invoices?

You need a system of record where approved bills are posted, which can be an ERP or accounting package. The workflow should read vendor and chart-of-accounts data from it and write approved entries back with idempotent writes and an audit trail.

Can I use a local model for invoice data?

Yes, if your platform is model-agnostic. Melaya is bring-your-own-model and works with local options such as Ollama and LM Studio as well as cloud models, so sensitive invoice data can stay on your own infrastructure.