---
title: "PUT /v1/portfolios/{portfolioSlug}/accounting-rules/order"
method: PUT
path: "/v1/portfolios/{portfolioSlug}/accounting-rules/order"
tags: ["AccountingRules"]
---

# PUT /v1/portfolios/{portfolioSlug}/accounting-rules/order

`PUT /v1/portfolios/{portfolioSlug}/accounting-rules/order`

## 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}/accounting-rules/order`
- Auth: API key in header `x-api-key`

## Path parameters

- `portfolioSlug` string, required

## Request body

- ReorderAccountingRulesRequestDto
  - `orderedRuleIds` string[], required: Every rule handle in the portfolio, in the order they should evaluate. Rules apply in order, so earlier rules win.

## Response `200`

- CommandResultDto
  - `mode` 'sync' | 'async', required: Whether the command ran sync or async
  - `result` union: The command result, present for synchronous commands
    - object
      - `success` true, required
      - `data` unknown
    - object
      - `success` false, required
      - `error` object, required
        - `name` string, required: The class name of the error
        - `message` string, required: The error message
        - `body` union, required: The error body, usually fields needed to reconstruct the specific error fields
          - object
            - `usageType` string, required
            - `currentUsage` number, required
            - `limit` number, required
          - unknown
  - `jobId` string: Tracking job id, present for asynchronous commands
  - `status` 'queued': Queue status, present for asynchronous commands

---

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