---
title: "Which merchant rule categorized this transaction"
method: GET
path: "/accountant/companies/{customerId}/transactions/{transactionId}/merchant-rule"
tags: ["Accountant Portal"]
---

# Which merchant rule categorized this transaction

`GET /accountant/companies/{customerId}/transactions/{transactionId}/merchant-rule`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/transactions/{transactionId}/merchant-rule`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

#3039. recordedRuleId is the rule the latest merchant-rule categorization of this transaction named when it ran; it is null for a transaction no rule categorized and for one categorized before #3039 shipped. recordedRule is that rule as it is now, or null when it has been deleted. recordedRuleId is also null when a person recategorized the transaction after the rule ran. matchingRules are the company and global rules whose pattern matches the transaction's merchant and description today, in rule order; other categorization steps (vendor patterns, transfers, Stripe rows) can take a row before any of them, so the first entry is not proof of what categorized this transaction or what will categorize the next one. A non-UUID path id is 422.

## Response `200`

The recorded rule and today's matching rules

- object
  - `success` boolean
  - `data` object
    - `recordedRuleId` string, nullable, required: A rule row id (UUID), or a built-in global rule id such as global-vocab:slack
    - `recordedRule` object, nullable, required
    - `matchingRules` object[], required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found

---

[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/20090ea32b0d?raw)
