> For the complete documentation index, see [llms.txt](https://docs.riff.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.riff.ai/playbooks/finance/reconcile-supplier-invoices.md).

# Reconcile supplier invoices

**Best fit:** Agent **ERP systems:** Infor LN / M3, SAP S/4HANA, Oracle ERP Cloud, Microsoft Dynamics 365 **Time to build:** \~30 minutes **See also:** [Match purchase orders to invoices](/playbooks/procurement/match-purchase-orders.md) (buyer perspective)

***

## What you're building

A Riff agent that runs the end-of-day invoice reconciliation: checking each invoice against the corresponding PO and goods receipt, auto-approving clean matches, and routing exceptions to the right person before the payment run.

***

## What you need

* Riff workspace with your ERP connected
* Read access to supplier invoices, purchase orders, and goods receipts
* Write access to update invoice status, add notes, or create exception records
* Finance-team tolerance thresholds (may differ from procurement's thresholds)
* Escalation routing: who receives which type of exception

***

## Step 1: Map your reconciliation workflow

Before briefing the agent, answer these questions:

| Question                         | Example answer                                                     |
| -------------------------------- | ------------------------------------------------------------------ |
| When do invoices arrive?         | Daily batch from ERP AP module                                     |
| What's the matching tolerance?   | Price: ±2%, Quantity: ±3%                                          |
| What are the exception types?    | Price mismatch, quantity mismatch, no GR posted, duplicate invoice |
| Who handles each exception type? | AP Controller → price/quantity; Buyer → no GR                      |
| What's the payment run schedule? | Every Tuesday and Friday                                           |

***

## Step 2: Create the agent

1. Click **+ New** → **Agent**
2. Name it — e.g. "Invoice Reconciliation Agent"
3. In the **Profile** tab, brief the agent with your workflow:

> You run the daily invoice reconciliation in \[ERP] every evening at 18:00. For each invoice received today, you check it against the corresponding PO and GR. Invoices that match within tolerance (price ±2%, quantity ±3%) are approved for the next payment run. Invoices with price or quantity mismatches are held and routed to the AP Controller. Invoices with no matching GR are held and routed to the buyer on the PO. Duplicate invoices are blocked and flagged to the AP Controller immediately. After processing, you send a reconciliation summary to the Finance Controller showing: total invoices processed, approved, and held by category.

***

## Step 3: Connect your ERP

Connect via the **Integrations** tab. Key AP access needed per system:

| ERP              | Key access                                                            |
| ---------------- | --------------------------------------------------------------------- |
| SAP S/4HANA      | Accounts Payable → Invoice verification (MIRO), GR/IR clearing (MR11) |
| Infor LN         | Procurement → Purchase invoice processing                             |
| Oracle ERP Cloud | Payables → Invoice processing and approval workflows                  |
| Dynamics 365     | Accounts Payable → Vendor invoice journal and matching                |

***

## Step 4: Set up escalation routing

In the **Profile** tab, add routing rules:

> Route all price mismatch exceptions to \[AP Controller name or role]. Route all "no GR posted" exceptions to the buyer listed on the PO. Route duplicate invoice flags to \[AP Controller] immediately regardless of time of day.

***

## Step 5: Schedule and test

1. **Triggers tab**: add a schedule — e.g. every day at 18:00
2. **Chat tab**: `Process the invoices received today in test mode` — review the output before enabling
3. Check that approvals, holds, and escalations all land correctly
4. Go live and monitor the first two or three runs in **Activity**

***

## What good looks like

* Finance Controller gets a daily summary instead of reviewing individual invoices
* Payment runs are clean — no mismatched invoices slipping through
* Every exception has an owner and a deadline before the payment run
* The agent's Activity log is the full audit trail for every invoice decision

***

## Variations

**If invoices arrive as PDFs by email:** Add an email trigger. The agent extracts invoice data from the PDF and runs the match.

**If you have inter-company invoices:** Brief the agent with inter-company matching rules and separate routing for those exceptions.

**If your payment run is automated:** Configure the agent to submit the approved invoice list to the payment run directly, rather than just flagging approval status.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.riff.ai/playbooks/finance/reconcile-supplier-invoices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
