---
title: "Close a GL period"
method: POST
path: "/companies/{companyId}/gl-periods/{id}/close"
tags: ["GL Periods"]
---

# Close a GL period

`POST /companies/{companyId}/gl-periods/{id}/close`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/gl-periods/{id}/close`
- Auth: HTTP bearer

Generates the period's closing entry (sweeping profit and loss to
Retained Earnings) and then marks the period closed. The closing
entry posts before the status flip so it lands in the period being
closed; a stale closing entry left from an earlier close is voided
and replaced. A closed period is a reconciliation marker: it still
accepts postings and voids, and only a filing lock blocks them
(#2411). Requires company role admin or owner in a signed-in
session; API keys are refused with 403.

## Response `200`

Period closed

- GlPeriodResponse
  - `success` boolean
  - `data` GlPeriod
    - `id` string, uuid
    - `companyId` string, uuid
    - `startDate` string, date
    - `endDate` string, date
    - `status` 'open' | 'closed'
    - `closedAt` string, date-time, nullable
    - `closedByUserId` string, uuid, nullable
    - `filingLockedAt` string, date-time, nullable
    - `filingLockedByUserId` string, uuid, nullable

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: GL period not found
- `422`: Period is already closed, the closing entry cannot be generated (for example the chart of accounts has no Retained Earnings account), or unresolved blocking close blockers remain. In the last case the error code is `CLOSE_BLOCKERS_UNRESOLVED`, the message names each blocking kind and its count, and `extensions` carries `periodId`, `unresolvedBlockerCount` and `blockers: [{ kind, count }]`. The period stays open.

---

[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)
