---
title: "Close consecutive GL periods in sequence (batch month-end lock)"
method: POST
path: "/accountant/companies/{customerId}/month-end-close/batch-lock"
tags: ["Month-End Close"]
---

# Close consecutive GL periods in sequence (batch month-end lock)

`POST /accountant/companies/{customerId}/month-end-close/batch-lock`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/month-end-close/batch-lock`
- Auth: HTTP bearer

Closes each supplied period in order — the same closing-entry and retained-earnings effect as the single gl-periods close, applied per period. Aborts on the first failure (including any unresolved block-severity close blocker) and returns the per-period status so the caller can see which period broke. Signed-in accountants only: the service API key cannot use the batch lock (#2411); it closes one period at a time through the single gl-periods close.

## Request body

- object
  - `periodIds` string[], required

## Response `200`

Per-period close results; allClosed is false when the sequence aborted

- object
  - `success` boolean
  - `data` object
    - `allClosed` boolean
    - `results` object[]
      - `periodId` string, uuid
      - `closed` boolean
      - `reason` string
      - `closingEntryId` string, uuid, nullable

## Other responses

- `400`: periodIds missing or not a non-empty array of string IDs
- `401`: Authentication required
- `403`: Insufficient permissions or not a company member

---

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