---
title: "Split a customer transaction (create or replace its legs)"
method: PUT
path: "/accountant/companies/{customerId}/transactions/{transactionId}/splits"
tags: ["Accountant Portal"]
---

# Split a customer transaction (create or replace its legs)

`PUT /accountant/companies/{customerId}/transactions/{transactionId}/splits`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/transactions/{transactionId}/splits`
- Auth: HTTP bearer

#876. Replaces every split leg and void-and-replaces the posted transaction journal entry with one category line per leg (the bank/card offset leg is preserved). Legs must sum exactly to the transaction amount; at least 2 legs. Legs may carry a classId. Acts as the accountant: no client action is queued for review. 422 when the transaction is reconciled, has an applied transfer/credit-card match, is matched to a bill/document, is on a personal bank account, or its entry is in a filing-locked period.

## Request body

- ReplaceSplitsInput
  - `splits` object[], required
    - `glAccountId` string, uuid, required
    - `classId` string, uuid, nullable: Optional split class. Omit to derive from the parent transaction class; set null for intentionally unassigned.
    - `amountCents` integer, required
    - `memo` string

## Response `200`

Splits replaced

- TransactionSplitsListResponse
  - `success` boolean
  - `data` TransactionSplit[]
    - `id` string, uuid
    - `transactionId` string, uuid
    - `glAccountId` string, uuid
    - `classId` string, uuid, nullable: Line-level class dimension. Customer-facing responses include this field only when CUSTOMER_APP_INTELLIGENCE_HOME_COMPANY_IDS allowlists the company.
    - `amountCents` integer
    - `currency` string
    - `memo` string, nullable

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `422`: Validation or business rule error. `error.title` is `TRANSACTION_CATEGORY_IS_BANK_ACCOUNT` when a leg is the transaction's own bank or card GL account, and `TRANSACTION_BANK_OFFSET_UNIDENTIFIED` when the posted journal entry debits and credits one account off the bank GL.

---

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