---
title: "Reverse a ledger transaction"
method: POST
path: "/admin/ledger/transactions/{transaction_id}/reverse"
tags: ["Admin"]
---

# Reverse a ledger transaction

`POST /admin/ledger/transactions/{transaction_id}/reverse`

## Request

- Base URL: `https://api.presscart.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.presscart.com/admin/ledger/transactions/{transaction_id}/reverse`
- Auth: HTTP bearer

Posts the mirror image of a posted transaction. The original is never modified. The two halves of an order credit spend are reversed together.

## Path parameters

- `transaction_id` string, uuid, required

## Request body

- object
  - `description` string

## Response `201`

Reversal posted

- LedgerTransactionReversal
  - `id` string, uuid, required
  - `created_at` union, required
    - string, nullable
    - string
    - unknown
  - `effective_at` union, required
    - string, nullable
    - string
    - unknown
  - `status` 'PENDING' | 'POSTED' | 'ARCHIVED', required
  - `description` string, required
  - `external_source` string, nullable, required
  - `external_id` string, nullable, required
  - `reverses_transaction_id` string, uuid, nullable, required
  - `reversed_by_transaction_id` string, uuid, nullable, required
  - `pending_transaction_id` string, uuid, nullable, required
  - `order_id` string, uuid, nullable, required
  - `order_item_id` string, uuid, nullable, required
  - `created_by` string, uuid, nullable, required
  - `metadata` object, nullable, required
  - `entries` object[], required
    - `id` string, uuid, required
    - `account_id` string, uuid, required
    - `account_code` string, required
    - `team_id` string, uuid, nullable, required
    - `credit_type` 'FUNDED' | 'PROMOTIONAL' | 'REFERRAL' | 'REFUND' | 'MANUAL' | 'BONUS', nullable, required
    - `direction` 'DEBIT' | 'CREDIT', required
    - `amount` number, required
    - `balance_before` number, required
    - `balance_after` number, required
    - `expires_at` union, required
      - string, nullable
      - string
      - unknown
    - `memo` string, nullable, required
  - `paired_reversal` object, nullable, required
    - `id` string, uuid, required
    - `created_at` union, required
      - string, nullable
      - string
      - unknown
    - `effective_at` union, required
      - string, nullable
      - string
      - unknown
    - `status` 'PENDING' | 'POSTED' | 'ARCHIVED', required
    - `description` string, required
    - `external_source` string, nullable, required
    - `external_id` string, nullable, required
    - `reverses_transaction_id` string, uuid, nullable, required
    - `reversed_by_transaction_id` string, uuid, nullable, required
    - `pending_transaction_id` string, uuid, nullable, required
    - `order_id` string, uuid, nullable, required
    - `order_item_id` string, uuid, nullable, required
    - `created_by` string, uuid, nullable, required
    - `metadata` object, nullable, required
    - `entries` object[], required
      - `id` string, uuid, required
      - `account_id` string, uuid, required
      - `account_code` string, required
      - `team_id` string, uuid, nullable, required
      - `credit_type` 'FUNDED' | 'PROMOTIONAL' | 'REFERRAL' | 'REFUND' | 'MANUAL' | 'BONUS', nullable, required
      - `direction` 'DEBIT' | 'CREDIT', required
      - `amount` number, required
      - `balance_before` number, required
      - `balance_after` number, required
      - `expires_at` union, required
        - string, nullable
        - string
        - unknown
      - `memo` string, nullable, required

## Other responses

- `400`: The transaction id is not a uuid or the body failed validation
- `401`: The access token is missing or invalid
- `403`: Only administrators can reverse ledger transactions
- `404`: The ledger transaction to reverse was not found
- `409`: Already reversed, the target is itself a reversal, or its source cannot be reversed by hand (code not_reversible)
- `500`: The reversal could not be posted
- `503`: The ledger is temporarily frozen (code LEDGER_FROZEN)

---

[API](https://skmtc.dev/presscart/apis/presscart-prod-api.md) · [All operations](https://skmtc.dev/presscart/apis/presscart-prod-api/llms.txt) · [OpenAPI document](https://skmtc.dev/presscart/apis/presscart-prod-api/revisions/865742aad8e3?raw)
