---
title: "Update Ledger Transaction"
method: PATCH
path: "/ledger_transactions/{id}"
---

# Update Ledger Transaction

`PATCH /ledger_transactions/{id}`

## Path parameters

- `id` string, required

## Request body

- object
  - `description` string — An optional free-form description for internal use. Maximum of 1000 characters allowed.
  - `status` string — To post the ledger transaction, use `posted`. To archive a pending ledger transaction, use `archived`.
  - `metadata` string, json — Additional data in the form of key-value pairs. Pairs can be removed by passing an empty string or null as the value.
  - `effective_at` string, date-time — Format: ISO8601 to 6 decimal places.
  - `ledger_entries` object[] — Note that updating entries will overwrite any prior entries on the ledger transaction. The metadata will not be copied over from the previous entries so any attached metadata must be sent in the payload.
    - `amount` integer, required — Supports any int value up to 10³⁶.
    - `direction` string, required — One of `credit` or `debit`.
    - `ledger_account_id` string, required
    - `lock_version` integer — Lock version of the ledger account. This can be passed when creating a ledger transaction to only succeed if no ledger transactions have posted since the given version. See [this guide](https://docs.moderntreasury.com/docs/handling-concurrency#using-the-lock_version-field) for more details. This will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
    - `pending_balance_amount` object — Use "gt" (>), "gte" (>=), "'lt" (<), "lte" (<=), or "eq" (=) to lock on the account’s pending balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422. See [this guide](https://docs.moderntreasury.com/docs/handling-concurrency#locking-on-account-balance) for more details. This will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
      - `lt` integer
      - `lte` integer
      - `eq` integer
      - `gte` integer
      - `gt` integer
      - `not_eq` integer
    - `posted_balance_amount` object — Use "gt" (>), "gte" (>=), "'lt" (<), "lte" (<=), or "eq" (=) to lock on the account’s posted balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422. See [this guide](https://docs.moderntreasury.com/docs/handling-concurrency#locking-on-account-balance) for more details. This will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
      - `lt` integer
      - `lte` integer
      - `eq` integer
      - `gte` integer
      - `gt` integer
      - `not_eq` integer
    - `available_balance_amount` object — Use "gt" (>), "gte" (>=), "'lt" (<), "lte" (<=), or "eq" (=) to lock on the account’s available balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422. See [this guide](https://docs.moderntreasury.com/docs/handling-concurrency#locking-on-account-balance) for more details. This will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
      - `lt` integer
      - `lte` integer
      - `eq` integer
      - `gte` integer
      - `gt` integer
      - `not_eq` integer
    - `show_resulting_ledger_account_balances` boolean — If true, response will include the balance of the associated ledger account for the entry and will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
    - `metadata` string, json
  - `ledger_account_category_balance_locks` object[] — An array of one or more ledger account category balance locks. Use this to lock on a ledger account category's balance.
    - `ledger_account_category_id` string
    - `available_balance_amount` object — Use "gt" (>), "gte" (>=), "'lt" (<), "lte" (<=), or "eq" (=) to lock on the category's available balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422. See [this guide](https://docs.moderntreasury.com/docs/handling-concurrency#locking-on-account-balance) for more details. This will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
      - `lt` integer
      - `lte` integer
      - `eq` integer
      - `gte` integer
      - `gt` integer
      - `not_eq` integer
    - `pending_balance_amount` object — Use "gt" (>), "gte" (>=), "'lt" (<), "lte" (<=), or "eq" (=) to lock on the category's pending balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422. See [this guide](https://docs.moderntreasury.com/docs/handling-concurrency#locking-on-account-balance) for more details. This will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
      - `lt` integer
      - `lte` integer
      - `eq` integer
      - `gte` integer
      - `gt` integer
      - `not_eq` integer
    - `posted_balance_amount` object — Use "gt" (>), "gte" (>=), "'lt" (<), "lte" (<=), or "eq" (=) to lock on the category's posted balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422.See [this guide](https://docs.moderntreasury.com/docs/handling-concurrency#locking-on-account-balance) for more details. This will trigger synchronous processing, which imposes an additional rate limit on the API. See [Synchronous Ledger Entry Rate Limiting](https://docs.moderntreasury.com/docs/synchronous-ledger-entry-rate-limiting) for details.
      - `lt` integer
      - `lte` integer
      - `eq` integer
      - `gte` integer
      - `gt` integer
      - `not_eq` integer
  - `ledgerable_type` string — If the ledger transaction can be reconciled to another object in Modern Treasury, add the ledgerable type here, otherwise null. See possible types at [Ledger Transactions](https://docs.moderntreasury.com/platform/reference/ledger-transaction-object)
  - `ledgerable_id` string — If the ledger transaction can be reconciled to another object in Modern Treasury, add the id of that object here, otherwise null.
  - `external_id` string — An optional user-defined 180 character unique identifier

## Response `200`

200

- object
  - `id` string
  - `object` string
  - `live_mode` boolean
  - `external_id` string
  - `ledgerable_type` unknown
  - `ledgerable_id` unknown
  - `ledger_id` string
  - `description` unknown
  - `status` string
  - `archived_reason` unknown
  - `ledger_entries` object[]
    - `id` string
    - `object` string
    - `live_mode` boolean
    - `amount` integer
    - `direction` string
    - `status` string
    - `ledger_account_id` string
    - `ledger_account_currency` string
    - `ledger_account_currency_exponent` integer
    - `ledger_account_lock_version` integer
    - `ledger_transaction_id` string
    - `resulting_ledger_account_balances` object
      - `pending_balance` object
        - `credits` integer
        - `debits` integer
        - `amount` integer
        - `currency` string
        - `currency_exponent` integer
      - `posted_balance` object
        - `credits` integer
        - `debits` integer
        - `amount` integer
        - `currency` string
        - `currency_exponent` integer
      - `available_balance` object
        - `credits` integer
        - `debits` integer
        - `amount` integer
        - `currency` string
        - `currency_exponent` integer
    - `discarded_at` unknown
    - `created_at` string
    - `updated_at` string
  - `posted_at` string
  - `effective_at` string
  - `effective_date` string
  - `metadata` object
  - `created_at` string
  - `updated_at` string

---

[API](https://skmtc.net/modern-treasury/apis/modern-treasury-api.md) · [All operations](https://skmtc.net/modern-treasury/apis/modern-treasury-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/modern-treasury/modern-treasury-api/revisions/ed0431a2dcd0/schema)
