> ## Documentation Index
> Fetch the complete documentation index at: https://equatetravel.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# The matching engine

> How equate decides an invoice and a booking are the same thing — tiered comparison, calibrated confidence, and a decision you can automate on.

Extraction tells you what an invoice says. **Matching** answers the question that
actually matters: *is this invoice right, against the booking we hold?* equate's
matching engine compares every extracted invoice with your
[booking data](https://equatetravel.ai/docs/guides/booking-data.md) and produces a decision — auto-complete, review,
or no match — with the evidence attached.

## Match tiers

Comparison depth is controlled by **tiers**. Higher tiers check more, catch more, and
send more to review — you choose the trade-off per
[supplier](https://equatetravel.ai/docs/guides/suppliers.md) or per [pipeline](https://equatetravel.ai/docs/guides/pipelines.md), under
[Business rules → Tiers & matching](https://equatetravel.ai/docs/guides/business-rules.md#tiers-and-matching). On the
**Essentials** plan every invoice is matched at `TIER_1`.

| Tier | Checks | Use when |
| - | - | - |
| `TIER_1` — Financials | The financial fields (below) | You only need to know the money is right. |
| `TIER_2` — Financials + trip | Tier 1 **plus** the trip details for the booking's type | The default — value *and* substance. |
| `TIER_3` — Everything | Tier 2 **plus** every remaining extracted field | Zero-tolerance suppliers, audit-grade checks. |

**Tier 1 is the gate.** If the financials don't line up, deeper agreement is worthless —
a matching ship name can't rescue a wrong total. Tiers 2 and 3 deepen an already-sound
match rather than substitute for one.

### Exactly which fields each tier checks

The full list behind the app's tier picker, so you never have to guess what a tier
covers. Each tier is **cumulative** — it checks everything the tier below it does, plus
the fields listed against it.

**Tier 1 — Financials** (checked on every invoice, whatever the trip):

* Supplier
* Reference
* Total cost
* Invoice currency
* VAT
* Resort tax (hotels, packages, ski and tours only)
* Commission

**Tier 2 — Financials + trip** adds the key trip details for the booking's sector: lead
name and passenger count everywhere, then each sector's own (ship and sailing for a
cruise, flights for a flight, stay dates and accommodation for a hotel, ski area, extras
and ski carriages for ski, and so on).

**Tier 3 — Everything** adds the remaining fields for that sector — passenger list,
cabin details, board basis, the car-hire / car-parking / transfer flags. At Tier 3 they
must agree too; at Tier 1 or Tier 2 they're still compared and shown to reviewers, but
never hold a match.

The full field list per sector is on [Sectors](https://equatetravel.ai/docs/resources/trip-types.md#what-each-sector-checks).

> [!NOTE]
>
> **Invoice date** is shown alongside a match for context, but never counts toward the
> decision at any tier.

> [!NOTE]
>
> The tier in force is **snapshotted onto each job** at processing time — changing a
> supplier's tier later never rewrites the history of what was checked.

## How the AI Matching Agent compares fields

A tier decides **which** fields must agree. Whether they **do** agree is decided by
equate's **AI Matching Agent**, which reads each field the way an experienced
reconciler would, not as a letter-for-letter text comparison. Suppliers and booking
systems write the same thing in different ways, and a difference in spelling or format
isn't a difference in the booking.

Before comparing, the agent puts both sides into the same form, then judges whether they
mean the same thing. For example, each of these counts as **agreeing**:

| Field | Invoice says | Booking says |
| - | - | - |
| Lead name | Mr John Smith | SMITH, John |
| Lead name | Meeling Hou | Hou *(the booking only stores the surname)* |
| Names | O'Brien, Smith-Jones | OBRIEN, Smith Jones |
| Dates | 3rd March 2027 | 03/03/2027 |
| Ship | MS Britannia (P\&O) | Britannia |
| Accommodation | The Grand Hotel 5\* | Grand Hotel |
| Board basis | Half Board | DBB |
| Passengers | 2 Adults, 1 Child | 3 |
| Flights | Edinburgh, EJ U4678 | EDI, EJU4678 |
| Duration | Fortnight | 14 nights |

A **real** difference, such as a different surname, a different sailing date or another
ship, is a mismatch and sends the invoice to review.

**Money is the exception.** After it removes currency symbols, commas and spaces, the
agent compares amounts exactly. Total cost, VAT, resort tax and commission are never
waved through as "close enough". If your team accepts small differences on a money or
duration field, set a **tolerance** on it in the app, under **Fields & matching**. You
can also move a field between *Tier 2 · Must agree* and *Tier 3 · Additional* there.

Every call shows its working. Each field on the job's comparison records the raw value
from both sides, the normalised value the agent compared, its verdict, and a short note
whenever the call wasn't obvious. A reviewer can always see *why* two values were judged
the same.

## Field verdicts and the decision

Each compared field gets a verdict — **match**, **mismatch**, or **missing** (one side
didn't have it) — and the engine weighs the verdicts into an overall **confidence score**
(0–1) and a **decision**:

| Decision | Meaning | What happens |
| - | - | - |
| `AUTO` | Confidently the same booking, values agree | Job becomes `MATCHED` and [delivery actions](https://equatetravel.ai/docs/guides/pipelines.md#delivery-formats) fire. |
| `REVIEW` | Probably right, but something deserves eyes | Job lands in the [review queue](https://equatetravel.ai/docs/guides/reviewing-exceptions.md) with the comparison laid out. |
| `NONE` | No booking matched | Job becomes `NOT_MATCHED` and lands in the [review queue](https://equatetravel.ai/docs/guides/reviewing-exceptions.md) — a reviewer locates the booking and rematches, or closes it off. |

The full field-by-field comparison is kept on the job (and returned over the
[agent API](https://equatetravel.ai/docs/api-reference/introduction.md) when match output is on), so every decision is
explainable — no black-box "0.87" without the why.

## Tuning without re-engineering

* **Supplier sensitivity** — each supplier carries a match sensitivity (high / medium /
  low) that tightens or relaxes how strict the comparison is for *their* documents.
  Clean, consistent suppliers earn high; noisy ones run low and lean on review.
* **Fuzzy reference fallback** — optionally tolerate near-miss references (prefixes,
  dropped zeros, case) on [database](https://equatetravel.ai/docs/connectors/database-lookup.md) and
  [API](https://equatetravel.ai/docs/connectors/booking-api.md) lookups.
* **[Business rules](https://equatetravel.ai/docs/guides/business-rules.md)** — move a field between Tier 2 and Tier 3
  or give a number a tolerance, per sector or for one supplier (supplier rules win), and
  set each supplier's match depth.
* **Matching options per pipeline** — choose whether a pipeline follows the sector and
  supplier rules, or pin it to one tier regardless of supplier defaults.

## Duplicates

Suppliers send the same invoice twice — a chased copy, a statement re-issue, a second
addressee. equate compares each new invoice's **reference + supplier (+ total)** against
what's already been processed and flags the **later copy** for review instead of letting
it sail through to a second payment. Confirmed duplicates are absorbed into the original
job as `MERGED`, keeping the audit trail in one place.

## It doesn't give up at first pass

* **Booking data updates re-match** — when new booking data arrives (a feed lands, an
  upload completes), unresolved review items (`NEEDS_REVIEW`, `NOT_MATCHED`) are
  automatically re-checked. An invoice that arrived before its booking heals itself.
* **Reviewer corrections feed back** — confirming or fixing a match in the
  [review queue](https://equatetravel.ai/docs/guides/reviewing-exceptions.md) is recorded and feeds the engine's
  evaluation sets, so the same supplier quirk costs you review time once, not forever.
* **Every attempt is recorded** — each match run (first pass or re-match) is stored
  with its candidates, scores and outcome for audit.

> [card] [The extraction engine](https://equatetravel.ai/docs/platform/extraction-engine.md)
>
> What happens before matching — the travel-native read of every document.

> [card] [Work the review queue](https://equatetravel.ai/docs/guides/reviewing-exceptions.md)
>
> The queue where REVIEW and NONE decisions get resolved.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.