---
title: "Record a prior-period correction against opening equity"
method: POST
path: "/accountant/companies/{customerId}/journal-entries/prior-period-adjustments"
tags: ["Accountant Portal", "Journal Entries"]
---

# Record a prior-period correction against opening equity

`POST /accountant/companies/{customerId}/journal-entries/prior-period-adjustments`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/journal-entries/prior-period-adjustments`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

#3887. The one path that may post to 3200 Retained Earnings, which every other journal path refuses (422). The entry is dated on the first day of a fiscal year (`YYYY-01-01`, opening equity; statements are calendar-year), carries a required `reason`, and is balanced. Every 3200 line needs a counter-line on the other side on another balance-sheet account that is not Opening Balance Equity; lines carry no transaction or document. Period and filing locks and every other account block still apply. The entry, its `gl_adjustments` link (kind `prior_period_adjustment`) and its audit row (with the reason) are written in one transaction. With an `Idempotency-Key` header or `idempotencyKey` field, a retry of the same request returns the entry already posted; the same key with a different payload is refused with 409. The cash flow statement presents the entry as a restatement of opening balances, never as an activity: in a window that opens on its date its cash leg is part of beginning cash; in a window that crosses its date its cash leg is the financing line "Prior period adjustment (restatement of opening balances)". Assigned accountants; the service principal as a high-impact operation. The optional `openingCorrection` records a pre-2026 discrepancy posted on January 1, 2026. A signed-in accountant supplies its support for the posting entity: a document (`supportDocumentId`) or, from migration 778, staff-only evidence (`staffEvidenceId`), exactly one. The destination period must be open. The posting must leave protected years and filing-locked periods intact.

## Path parameters

- `customerId` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- CreatePriorPeriodAdjustmentInput
  - `entityId` string, uuid: Concrete legal posting entity; defaults to the company's primary entity.
  - `currency` string, required
  - `entryDate` string, date, required: The first day of a fiscal year (`YYYY-01-01`).
  - `description` string, required
  - `reason` string, required: Why the prior-period figures were wrong; stored on the adjustment link and the audit row.
  - `idempotencyKey` string: Client retry key; a retry with the same key and payload returns the entry already posted.
  - `openingCorrection` object: Evidence for an opening correction submitted by a signed-in accountant. Exactly one of supportDocumentId or staffEvidenceId (migration 778).
    - `sourceDate` string, date, required: Date of the original discrepancy.
    - `supportDocumentId` string, uuid: An active supporting document with an attached file belonging to the posting entity.
    - `staffEvidenceId` string, uuid: Migration 778, staff-only evidence of the posting entity with a clean file (PUT /accountant/companies/{customerId}/staff-evidence).
  - `lines` object[], required
    - `glAccountId` string, uuid, required
    - `debitCents` integer
    - `creditCents` integer
    - `currency` string
    - `memo` string

## Response `201`

Prior-period adjustment posted and linked

- PriorPeriodAdjustmentResponse
  - `success` boolean
  - `data` object
    - `adjustment` object
      - `id` string, uuid
      - `companyId` string, uuid
      - `kind` 'prior_period_adjustment'
      - `reason` string
      - `journalEntryId` string, uuid
      - `createdBy` string, uuid, nullable
      - `metadata` object
      - `createdAt` string, date-time
    - `journalEntry` JournalEntry
      - `id` string, uuid
      - `companyId` string, uuid
      - `entityId` string, uuid, nullable: Concrete legal posting entity. Null is legacy data and resolves to the primary entity.
      - `entryDate` string, date
      - `description` string
      - `sourceType` 'transaction' | 'document' | 'adjustment' | 'system'
      - `sourceId` string, uuid, nullable
      - `periodId` string, uuid, nullable
      - `status` 'posted' | 'void'
      - `createdByUserId` string, uuid, nullable
      - `createdAt` string, date-time
      - `deletedAt` string, date-time, nullable
      - `deletedByUserId` string, uuid, nullable
      - `relatedJeId` string, uuid, nullable
      - `adjustmentReason` string, nullable
      - `isClosingEntry` boolean: A period-end closing entry (a system entry keyed on one of the company's periods). Reports leave these out of the P&L.
      - `sourceLabel` string
      - `sourceLink` object, nullable
        - `kind` string
        - `id` string
      - `lines` JournalLine[]
        - `id` string, uuid, required
        - `journalEntryId` string, uuid, required
        - `glAccountId` string, uuid, required
        - `classId` string, uuid, nullable: Line-level class dimension for downstream reporting. Accountant-portal responses always carry this field. Customer-facing responses do not carry it on journal lines.
        - `className` string, nullable: Name of the class in `classId`, resolved from the company's class list. Accountant-portal responses only, present when the class is known.
        - `classStatus` 'draft' | 'active' | 'inactive': Status of the class in `classId`. Accountant-portal responses only; never returned to the customer app.
        - `debitCents` integer, required
        - `creditCents` integer, required
        - `currency` string, required
        - `memo` string, nullable
        - `transactionId` string, uuid, nullable
        - `documentId` string, uuid, nullable

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `409`: The idempotency key was already used for a different adjustment (`JOURNAL_ENTRY_POSTING_KEY_CONFLICT`).
- `422`: Validation failed (missing reason, unknown field, a line with a transaction or document), the date is not the first day of a fiscal year (`PRIOR_PERIOD_ADJUSTMENT_DATE`), the lines break the 3200 counter-line rule or include a non-balance-sheet or Opening Balance Equity account (`PRIOR_PERIOD_ADJUSTMENT_LINES`), the entry does not balance, the period is missing or filing-locked, or the opening correction fails its date, evidence or period checks.

## Changes

- **2026-12-03** `c031fae5d544`: 2 info
  - added the new optional request property `openingCorrection/staffEvidenceId`
  - the request property `openingCorrection/supportDocumentId` became optional
- **2026-11-26** `4a2098becaf9`: 1 info
  - added the new optional request property `openingCorrection`
- **2026-10-31** `85ba2374b9e6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/journal-entries/prior-period-adjustments/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)
