Transactions

Revert a transaction

Changed on

Reverts a transaction by creating a reverse transaction that undoes its effects. Requires ledger:write scope. The body is optional; an absent or empty body uses default options. Supplied options and metadata are decoded for both known-length and HTTP/1.1 chunked requests. Malformed or truncated JSON, extra values, trailing non-whitespace and options of the wrong JSON type (for example "atEffectiveDate": "true" or a non-object metadata) return 400 before applying the revert. A JSON null option uses its default. The complete body, including trailing whitespace, counts towards the 4 MiB limit; exceeding it returns 413.

post/v3/{ledgerName}/transactions/{transactionId}/revert

Request

  • Base URL
    http://localhost:9000
  • URL
    http://localhost:9000/v3/{ledgerName}/transactions/{transactionId}/revert
  • Auth
    • HTTP bearer
    • or none

Path parameters

ledgerNamestring required

Name of the ledger

transactionIdinteger required

Transaction ID

Headers

Formance-Bigint-As-Stringstring

Render all response Uint256, BigUint and SignedBigInt values as canonical decimal strings, regardless of business meaning, including posting amounts, volume input/output and balances. Ordinary integer IDs/counts, metadata and explicitly string-encoded counters keep their existing representation. Case-insensitive true, yes, y and 1 enable this option, matching Ledger v2. Whitespace is not trimmed. Omission and every other value retain JSON number tokens. This affects only this response, including nested objects, maps, arrays, transaction/log/cursor and bulk results. Request decoding is unchanged.

Idempotency-Keystring

Idempotency key for the request

Request body

forceboolean

Force revert even if accounts don't have sufficient funds

atEffectiveDateboolean

Set the timestamp of the reverted transaction to the original transaction timestamp

metadataobject

Metadata for the revert transaction (supports typed values). Cluster policy defaults allow 128 entries per entity, 256 bytes per key, 16384 bytes per value, 65536 bytes per entity, and 1048576 bytes per request. Effective ceilings are configurable through the replicated cluster policy.

Response

Transaction reverted successfully

Changes