---
title: "Revert a ledger transaction by its ID"
method: POST
path: "/v2/{ledger}/transactions/{id}/revert"
tags: ["ledger.v2"]
---

# Revert a ledger transaction by its ID

`POST /v2/{ledger}/transactions/{id}/revert`

## Path parameters

- `ledger` string, required
- `id` integer, required

## Query parameters

- `force` boolean
- `atEffectiveDate` boolean
- `dryRun` boolean
- `schemaVersion` string

## Headers

- `Idempotency-Key` string

## Request body

- V2RevertTransactionRequest
  - `metadata` object — Metadata to attach to the compensating transaction created by the revert

## Response `201`

OK

- V2RevertTransactionResponse
  - `data` V2Transaction, required — A transaction recorded in the ledger, carrying its postings, metadata and both bi-temporal timestamps
    - `insertedAt` string, date-time — The request time: when the transaction was actually written to the ledger. Set by the ledger, not the caller. See [bi-temporality](https://docs.formance.com/modules/ledger/working-with/bi-temporality)
    - `updatedAt` string, date-time — When the transaction row was last modified, for example by a metadata change or a revert
    - `timestamp` string, date-time, required — The transaction time: when the transaction is considered to have occurred, also called the effective or booking date. This is the axis the ledger uses to compute balances and resolve point-in-time queries. Settable at creation, defaulting to current machine time if omitted, and immutable once written. See [bi-temporality](https://docs.formance.com/modules/ledger/working-with/bi-temporality)
    - `postings` V2Posting[], required — The fund movements making up the transaction
      - `amount` integer, required — Amount to move, as an arbitrary-precision integer expressed in the asset's smallest unit
      - `asset` string, required — The asset being moved, optionally carrying a scale suffix such as USD/2
      - `destination` string, required — Address of the account credited by this posting
      - `source` string, required — Address of the account debited by this posting
    - `reference` string — Optional caller-supplied identifier, unique within the ledger, used to deduplicate transactions
    - `metadata` V2Metadata, required — Arbitrary key/value pairs attached to the resource
    - `id` integer, required — Unique sequential identifier for this transaction within the ledger
    - `reverted` boolean, required — Indicates if the transaction has been reverted
    - `revertedAt` string, date-time — When the transaction was reverted, on the request-time axis. Absent if the transaction has not been reverted
    - `preCommitVolumes` V2AggregatedVolumes — Volumes aggregated per account and per asset
    - `postCommitVolumes` V2AggregatedVolumes — Volumes aggregated per account and per asset
    - `preCommitEffectiveVolumes` V2AggregatedVolumes — Volumes aggregated per account and per asset
    - `postCommitEffectiveVolumes` V2AggregatedVolumes — Volumes aggregated per account and per asset
    - `template` string — Name of the transaction template this transaction was created from, if any

## Other responses

- `default` — Error

## Changes

- **2025-12-12** `2945092328b9` — 2 warning, 1 info
  - added the new `SCHEMA_ALREADY_EXISTS` enum value to the `errorCode` response property for the response status `default`
  - added the new `SCHEMA_NOT_SPECIFIED` enum value to the `errorCode` response property for the response status `default`
  - added the new optional `query` request parameter `schemaVersion`
- **2025-12-05** `6f906b40671d` — 1 info
  - added the new optional `header` request parameter `Idempotency-Key`
- **2025-07-16** `b916e855a96c` — 1 info
  - added optional request body
- **2024-12-09** `7ee573f0087f` — 1 warning, 1 info
  - added the new `OUTDATED_SCHEMA` enum value to the `errorCode` response property for the response status `default`
  - removed the `BUCKET_OUTDATED` enum value from the `errorCode` response property for the response status `default`
- **2024-12-05** `d93e4ae21e38` — 1 warning
  - added the new `BUCKET_OUTDATED` enum value to the `errorCode` response property for the response status `default`

[Full history](https://skmtc.dev/formancehq/apis/ledger-api/changes/v2/:ledger/transactions/:id/revert/post.md)

---

[API](https://skmtc.dev/formancehq/apis/ledger-api.md) · [All operations](https://skmtc.dev/formancehq/apis/ledger-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/formancehq/ledger-api/revisions/a0dfa3b73bf8/schema)
