---
title: "Void the duplicate journal entry of one Stripe row booked twice"
method: POST
path: "/accountant/companies/{customerId}/stripe-balance-transactions/{balanceTransactionId}/duplicate-je-repair"
tags: ["Accountant Portal"]
---

# Void the duplicate journal entry of one Stripe row booked twice

`POST /accountant/companies/{customerId}/stripe-balance-transactions/{balanceTransactionId}/duplicate-je-repair`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/stripe-balance-transactions/{balanceTransactionId}/duplicate-je-repair`
- Auth: HTTP bearer

The bookkeeping agent's key only, a high-impact write that voids a journal entry. Needs `X-Agent-Run-Id` and `X-Agent-Evidence-Id`; the evidence must be a `repair_duplicate_stripe_je` intent naming this row whose `before.fingerprint` equals the body's (otherwise 403 `AGENT_EVIDENCE_MISMATCH`). The API re-detects the pair with the close-blocker audit's own read and refuses with 409 on any difference: `DUPLICATE_STRIPE_JE_REPAIR_TARGET_CHANGED`, `DUPLICATE_STRIPE_JE_REPAIR_BLOCKED` (with the reason), `DUPLICATE_STRIPE_JE_REPAIR_DONE` or `DUPLICATE_STRIPE_JE_REPAIR_NOT_APPLICABLE`; a filing-locked period (422 `JOURNAL_ENTRY_PERIOD_LOCKED`) and a reconciled entry or transaction (422) are refused by the journal funnel. Exactly one side is voided through the existing funnel (the atomic void, or the atomic transaction soft-delete when the transaction goes too), in one database transaction with the repair record and the row's open `duplicate_stripe_je` blockers resolved. A write that loses a race for the same row answers `DUPLICATE_STRIPE_JE_REPAIR_DONE` or `DUPLICATE_STRIPE_JE_REPAIR_TARGET_CHANGED`. Returns the state before and the state read back after (`transactionDeleted`: the transaction side's transaction, true once soft-deleted, false when kept; null on the system side). Refused with 403 `AGENT_PHI_RESTRICTED` for a patient-data-restricted company. The shared cloud-bookkeeping service token gets 404 here.

## Path parameters

- `customerId` string, uuid, required
- `balanceTransactionId` string, uuid, required

## Request body

- object
  - `fingerprint` string, required

## Response `200`

Success envelope

- object
  - `success` boolean, required
  - `data` object, required
    - `repairId` string, uuid, required
    - `strategy` 'void_system_je' | 'void_transaction_je_and_soft_delete_txn', required
    - `balanceTransactionId` string, uuid, required
    - `voidedJournalEntryId` string, uuid, required
    - `keptJournalEntryId` string, uuid, required
    - `softDeletedTransactionId` string, uuid, nullable, required
    - `resolvedCloseBlockerIds` string[], required
    - `before` object, required
      - `voidedEntryStatus` string, required
      - `transactionDeleted` boolean, nullable, required
      - `openCloseBlockers` integer, required
    - `after` object, required
      - `voidedEntryStatus` string, required
      - `transactionDeleted` boolean, nullable, required
      - `openCloseBlockers` integer, required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `409`: The repair changed, is blocked, was already made or does not apply; or the agent is not enabled or is stopped
- `422`: A missing run or evidence header, a malformed body, or the journal funnel refused (filing-locked period, reconciled entry or transaction)
- `429`: The agent's write or high-impact rate limit is spent

## Changes

- **2026-11-26** `4a2098becaf9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/stripe-balance-transactions/:balanceTransactionId/duplicate-je-repair/post.md)

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) - [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) - [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/4f4c2d34276b?raw)
