Skip to main content

Invoice to Purchase Order Matching Rules

Updated yesterday

How Invoice-to-PO Matching Works

When you upload or forward an invoice, Spendesk automatically attempts to match it with an existing purchase order using a two-step approach:

Step 1: OCR-Based Matching

First, Spendesk looks for a purchase order number directly on the invoice document:

  1. OCR extracts the PO number from the invoice PDF or image

  2. Searches for a matching PO in your company with that exact number

  3. Validates the match against the eligibility criteria (see below)

If successful, the invoice is immediately matched.

If not, the system moves to Step 2.


Step 2: Intelligent Two-Way Matching (2WM)

If OCR doesn't find a match, Spendesk uses a machine learning algorithm that compares multiple data points between the invoice and your open purchase orders:


Invoice data analyzed:

  • Invoice date and due date

  • Supplier name (both OCR-extracted and standardized)

  • Total amount and currency

  • Line items (description, quantity, unit price, tax rates)

  • Creation source and date

Purchase Order data analyzed:

  • PO creation date and end date

  • Supplier name

  • Total amount and currency

  • Description

  • Line items (description, quantity, unit price)

  • Historical invoice matching data for this PO

The algorithm calculates a confidence score based on how closely these fields match. The invoice is only automatically matched if the confidence score exceeds our threshold.


Eligibility Rules for Matching

For an invoice to be matched with a purchase order, all of the following conditions must be met:

1. Purchase Order Feature is Enabled

Your company must have the purchase order feature activated.

2. Purchase Order Status

The PO must have an "Opened" status. Invoices cannot be matched to:

  • ❌ Closed purchase orders

  • ❌ Cancelled purchase orders

  • ❌ Purchase orders in "opening" or "closing" transition states

3. User Permissions

The invoice requester must have permission to see the purchase order. This means one of the following must be true:

  • The user is the PO requester

  • The user has access rights to view the PO (based on team/cost center permissions)

  • For forwarded invoices: The supplier ID matches the PO supplier

4. Supplier Match

For forwarded invoices specifically, the supplier on the invoice must match the supplier on the purchase order.

5. Company Match

The invoice and purchase order must belong to the same company entity.


What Happens When There's a Match

When a successful match is found:

  • The invoice is automatically linked to the purchase order

  • The PO number is displayed on the invoice

  • The invoice amount is tracked against the PO budget

  • Line items may be automatically matched between invoice and PO (if both have line items)


What Happens When There's No Match

If neither matching method finds an eligible purchase order:

  • The invoice proceeds without a PO link

  • You can manually select a purchase order from the invoice screen

  • The invoice follows your normal approval workflow


Tips for Better Matching

To improve automatic matching accuracy:

Ensure PO numbers are clearly visible on supplier invoices
Use consistent supplier names across POs and invoices
Keep POs open until all related invoices are received
Add line items to POs for more precise matching
Maintain accurate amounts and currencies on purchase orders


Frequently Asked Questions

Q: Why wasn't my invoice matched even though the PO number is on it?

A: Check that the PO is still "Opened" (not closed or cancelled) and that you have permission to view it.

Q: Can I match an invoice to a closed PO?

A: No, only opened purchase orders are eligible for automatic matching. You would need to reopen the PO first.

Q: What if the algorithm matches incorrectly?

A: You can manually change the PO link from the invoice details screen. The system learns from these corrections over time.

Q: Do both invoice and PO need line items?

A: No, but having line items on both improves matching accuracy and enables three-way matching with delivery notes.


This matching system ensures invoices are automatically linked to the correct purchase orders while maintaining security and compliance controls. The machine learning algorithm continuously improves based on your company's matching patterns.


Did this answer your question?