---
title: "Create a balanced journal entry for an assigned customer"
method: POST
path: "/accountant/companies/{customerId}/journal-entries"
tags: ["Accountant Portal"]
---

# Create a balanced journal entry for an assigned customer

`POST /accountant/companies/{customerId}/journal-entries`

## Request

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

Uses the same validation and posting guards as the company journal-entry route. Service principals are admitted as an ordinary audited write; void and date correction remain high-impact operations.

## Request body

- CreateJournalEntryInput
  - `entityId` string, uuid: Concrete legal posting entity; defaults to the company's primary entity.
  - `entryDate` string, date, required
  - `description` string, required
  - `sourceType` 'transaction' | 'document' | 'adjustment' | 'system', required
  - `sourceId` string, uuid
  - `periodId` string, uuid
  - `postingKey` string: Optional identity a hand-written replacement can inherit from a voided transaction-sourced entry (`transaction:<uuid>`). Required to keep the engine from re-posting the same transaction (#1975).
  - `lines` object[], required
    - `glAccountId` string, uuid, required
    - `debitCents` integer
    - `creditCents` integer
    - `memo` string
    - `transactionId` string, uuid
    - `documentId` string, uuid

## Response `201`

Journal entry created

- JournalEntryResponse
  - `success` boolean
  - `data` 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
- `422`: Request failed validation

---

[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/20090ea32b0d?raw)
