---
title: "Split wallet operations out into a new transaction. The returned new transaction id is allocated, not created: the runner creates that transaction after this command commits."
method: POST
path: "/v1/portfolios/{portfolioSlug}/transactions/commands/SplitPortfolioTransactionCommand"
tags: ["PortfolioTransactionCommands"]
---

# Split wallet operations out into a new transaction. The returned new transaction id is allocated, not created: the runner creates that transaction after this command commits.

`POST /v1/portfolios/{portfolioSlug}/transactions/commands/SplitPortfolioTransactionCommand`

## Request

- Base URL: `https://api.tokenbooks.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tokenbooks.io/v1/portfolios/{portfolioSlug}/transactions/commands/SplitPortfolioTransactionCommand`
- Auth: API key in header `x-api-key`

Portfolio-scoped, keeping the URL callers already use. Each entry of `operationsToSplit` names the transaction it comes from, so the command has no single route transaction.

## Path parameters

- `portfolioSlug` string, required

## Query parameters

- `mode` 'sync' | 'async'

## Request body

- object
  - `newOperationType` 'DEPOSIT_FIAT' | 'INCOME' | 'REFUND' | 'REBATE' | 'WITHDRAWAL_FIAT' | 'EXPENSE' | 'BUY' | 'SELL' | 'EXCHANGE' | 'SWAP' | 'MOVE' | 'INTERCOMPANY_SEND' | 'INTERCOMPANY_RECEIVE' | 'STAKE' | 'UNSTAKE' | 'PROTOCOL_DEPOSIT' | 'PROTOCOL_WITHDRAW' | 'VAULT_DEPOSIT' | 'VAULT_WITHDRAW' | 'LP_IN' | 'LP_OUT' | 'LOAN_BORROW' | 'LOAN_REPAY' | 'LOAN_LIQUIDATION' | 'LEND_GIVE' | 'LEND_WITHDRAW' | 'ADJUSTMENT' | 'UNCATEGORIZED' | 'SPAM', required
  - `newSubType` string
  - `reason` string
  - `operationsToSplit` object[], required
    - `txId` string, required
    - `txIdx` number, required
    - `portfolioTransactionId` string, uuid, required

## Response `200`

- QueuedCommandResultDto
  - `mode` 'async', required: The command was accepted asynchronously
  - `jobId` string, required: Tracking job ID for the queued command
  - `status` 'queued', required: Queue admission status

---

[API](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api.md) · [All operations](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/revisions/180622e6255e?raw)
