---
title: "The rows an unsaved rule pattern would have matched in the last 90 days (p12,"
method: GET
path: "/accountant/companies/{customerId}/merchant-rules/preview"
tags: ["Accountant Portal"]
---

# The rows an unsaved rule pattern would have matched in the last 90 days (p12,

`GET /accountant/companies/{customerId}/merchant-rules/preview`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/merchant-rules/preview`
- Auth: HTTP bearer

"Type a payee to see the rows it would have matched". The pattern is matched as a saved merchant rule matches history: the same search term, then the same matcher on the merchant name (default) or the description; the broad "uber" pattern leaves Uber Eats out. Rows from the last 90 days, newest first, at most 25; `count` covers every match. At most 1,000 searched rows are read; past that `capped` is true and `count` is a floor. Nothing is written. A signed-in person only: every API key is refused, the service token included (404).

## Path parameters

- `customerId` string, uuid, required

## Query parameters

- `pattern` string, required
- `matchField` 'merchant_name' | 'description'

## Response `200`

The matching rows

- object
  - `success` true, required
  - `data` object, required
    - `pattern` string, required
    - `matchField` 'merchant_name' | 'description', required
    - `days` 90, required
    - `since` string, date, required
    - `count` integer, required
    - `capped` boolean, required
    - `rows` object[], required
      - `transactionId` string, uuid, required
      - `occurredOn` string, date, required
      - `merchant` string, nullable, required
      - `description` string, required
      - `amountCents` integer, required
      - `direction` 'in' | 'out', required
      - `status` 'needs_review' | 'categorized', required
      - `categoryGlAccountId` string, uuid, nullable, required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `422`: Request failed validation

## Changes

- **2026-11-26** `4a2098becaf9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/merchant-rules/preview/get.md)

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) - [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) - [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/4f4c2d34276b?raw)
