---
title: "Update a transaction"
method: PATCH
path: "/companies/{companyId}/transactions/{id}"
tags: ["Transactions"]
---

# Update a transaction

`PATCH /companies/{companyId}/transactions/{id}`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/transactions/{id}`
- Auth: HTTP bearer

## Request body

- UpdateTransactionInput
  - `description` string
  - `merchant` string
  - `categoryGlAccountId` string, uuid, nullable
  - `classId` string, uuid, nullable
  - `notes` string

## Response `200`

Transaction updated

- TransactionResponse
  - `success` boolean
  - `data` Transaction
    - `journalEntryUnavailableReason` 'scope_mismatch' | 'ambiguous_posting': Detail responses only. Present when `journalEntry` is null although an entry is linked.
    - `matchedDocumentUnavailableReason` 'scope_mismatch': Detail responses only. Present when `matchedDocument` is null although a document is matched.
    - `id` string, uuid
    - `companyId` string, uuid
    - `entityId` string, uuid
    - `occurredOn` string, date
    - `description` string
    - `merchant` string, nullable
    - `amountCents` integer
    - `currency` string
    - `direction` 'in' | 'out'
    - `status` 'needs_review' | 'categorized'
    - `categoryGlAccountId` string, uuid, nullable
    - `classId` string, uuid, nullable
    - `className` string, nullable
    - `hasReceipt` boolean
    - `bankAccountId` string, uuid, nullable
    - `merchantName` string, nullable
    - `notes` string, nullable
    - `isSplit` boolean
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Transaction not found
- `422`: Validation or business rule error. `error.title` carries the rule: `TRANSACTION_CATEGORY_IS_BANK_ACCOUNT` (the category is the GL account of the transaction's own bank or card account), `TRANSACTION_APPLIED_TRANSFER_MATCH_ACTIVE` (the journal entry is consolidated with another transaction by an applied transfer or card-payment match), `TRANSACTION_BANK_OFFSET_UNIDENTIFIED` (the journal entry debits and credits one account and needs the accountant bank-offset repair first). Nothing is written when refused. Also returned, with no rule code, when the body sets `categoryGlAccountId` on a Stripe revenue transaction (an inbound Stripe charge, invoice or subscription payment, or a transaction suggested from the same Stripe customer's earlier charges): the category would be set without the customer rule its revenue entry needs, and the revenue would stay on hold (#3039). Send the category to `POST /companies/{companyId}/transactions/{transactionId}/learn` instead, which records that rule. Two cases are let through: re-sending the category a categorized transaction already has, and a transaction a person categorized by hand moving to another account that can carry Stripe revenue.

---

[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)
