# GET /api/v1/transactions/{transaction_id}/suggested-matches

> Suggested matches for a transaction

- **Tag:** transactions
- **Operation ID:** `get_transaction_suggested_matches_api_v1_transactions__transaction_id__suggested_matches_get`

## Description

Return ranked suggested matches for a single bank transaction. Income transactions are matched against open invoices; expense transactions against open bills. Matches are scored by amount, date proximity, memo, and counterparty similarity.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `transaction_id` (path, string, required)
- `limit` (query, integer, optional) — Max suggested matches

## Responses

### 200 — Successful Response

Schema: `TransactionSuggestedMatchesResponse`

- `transaction_id` (string · required) — UUID of the transaction.
- `amount` (integer · required) — Absolute transaction amount in cents.
- `direction` (string · required) (one of: inflow, outflow) — `inflow` (money in → invoices) or `outflow` (money out → bills).
- `matches` (array · SuggestedMatch) → `SuggestedMatch` — Suggested matches ranked by confidence (highest first).
  - `type` (string · required) (one of: invoice, bill) — Whether this match is an invoice (income) or a bill (expense).
  - `id` (string · required) — UUID of the matched invoice or bill.
  - `number` (string) — Invoice number or vendor bill number, if set.
  - `party_name` (string) — Customer name (invoice) or vendor name (bill).
  - `balance_due` (integer · required) — Open balance of the invoice/bill in cents.
  - `due_date` (string) — Due date of the invoice/bill (ISO 8601 date).
  - `suggested_amount` (integer · required) — Suggested allocation amount in cents (capped at the open balance).
  - `confidence` (number · required) — Composite match confidence score (0-1).
  - `signals` (object) — Per-signal score breakdown (amount, date, memo, counterparty).
  - `match_group_id` (string) — Set when this match is part of a multi-document group (one transaction paying several invoices/bills).

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X GET 'https://api.ondayzero.com/api/v1/transactions/{transaction_id}/suggested-matches' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/transactions/{transaction_id}/suggested-matches', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

response = httpx.get("https://api.ondayzero.com/api/v1/transactions/{transaction_id}/suggested-matches", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/transactions/get-transaction-suggested-matches
- OpenAPI slice: https://www.ondayzero.com/docs/reference/transactions/get-transaction-suggested-matches/openapi.json
- Other endpoints in **transactions**: https://www.ondayzero.com/docs/reference/transactions
