---
title: "Apply a portfolio conversion from a prepared workbook. The adjustment transaction exists once this returns, but its accounting is staged: the runner recomputes it after this command commits."
method: POST
path: "/v1/portfolios/{portfolioSlug}/transactions/commands/ApplyPortfolioConversionCommand"
tags: ["PortfolioTransactionCommands"]
---

# Apply a portfolio conversion from a prepared workbook. The adjustment transaction exists once this returns, but its accounting is staged: the runner recomputes it after this command commits.

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

## 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/ApplyPortfolioConversionCommand`
- Auth: API key in header `x-api-key`

Each token snapshot names its wallet by the public `{ chainId, walletAddress }` pair. The command takes an internal wallet id, so the selectors are resolved inside the authenticated portfolio before dispatch.

## Path parameters

- `portfolioSlug` string, required

## Query parameters

- `mode` 'sync' | 'async'

## Request body

- object
  - `cutoffExclusiveTimestamp` union, required
    - string
    - string, date-time
  - `tokenSnapshots` object[], required
    - `chainId` string, required
    - `walletAddress` string, required: Address of the wallet holding the token
    - `tokenAddress` string, required
    - `balance` string, required: A decimal number sent as a string, so no precision is lost in JSON.
    - `fiatValue` string, required: A decimal number sent as a string, so no precision is lost in JSON.
    - `lotSnapshots` object[], required
      - `lotMethod` 'FIFO' | 'LIFO' | 'HIFO' | 'ACB', required
      - `quantity` string, required: A decimal number sent as a string, so no precision is lost in JSON.
      - `fiatValue` string, required: A decimal number sent as a string, so no precision is lost in JSON.
      - `acquisitionTimestamp` union, required
        - string
        - string, date-time
  - `ledgerAccountSnapshots` object[], required
    - `ledgerAccountId` string, required
    - `balance` string, required: A decimal number sent as a string, so no precision is lost in JSON.
    - `fiatCurrency` string, required
  - `balancingAccountId` string, required
  - `workbookFile` object, required
    - `id` string, required
    - `fileName` string, required
    - `fileSize` integer, required
    - `mimeType` string, required
    - `uploadedByUserId` string, required
    - `uploadedAt` string, required
  - `expectedPreviewHash` string, required
  - `acceptedWarningHash` string
  - `acceptedWarningCount` integer

## 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/634c5114c75f?raw)
