---
title: "Close an assigned customer's GL period"
method: POST
path: "/accountant/companies/{customerId}/gl-periods/{periodId}/close"
tags: ["GL Periods"]
---

# Close an assigned customer's GL period

`POST /accountant/companies/{customerId}/gl-periods/{periodId}/close`

## Request

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

Generates the period's closing entry and sweeps profit and loss to
Retained Earnings, then marks the period closed. The closing entry
posts before the status flip so it lands in the period being closed,
and a re-close after a reopen writes a fresh entry rather than
leaving the period closed without one (#2143). A closed period is a
reconciliation marker and still accepts postings and voids (#2411).
Caller must be an accountant assigned to the customer. The agent
service API key may close a period as a high-impact operation
(2026-10-06); other API keys cannot.

## 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, or the accountant is not assigned to this customer
- `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)
