---
title: "Returns how far a bulk close has got, what it has written off so far, and one verdict per period
 it has reached."
method: GET
path: "/billing-periods/close-bulk/{bulkCloseId}"
tags: ["Billing"]
---

# Returns how far a bulk close has got, what it has written off so far, and one verdict per period
 it has reached.

`GET /billing-periods/close-bulk/{bulkCloseId}`

A run reports Completed once it reaches the end of its selection, which says nothing about
 whether individual periods succeeded — read failed and the per-period error values
 for that. sweepError is set only when the run itself died. For a run started with
 dryRun, the counts and amounts describe what the sweep would do and nothing was
 written.

## Path parameters

- `bulkCloseId` string, required

## Response `200`

OK

- GetBulkCloseBillingPeriodsStatusEndpointOutput
  - `bulkCloseId` string, required — The run this progress is about.
  - `state` 'Sweeping' | 'Completed' | 'Failed', required
  - `dryRun` boolean, required — Whether this run only reports what it would have written off.
  - `endedBefore` string, date-time, required — The selection's cut-off date.
  - `maxNetInvoiceableAmount` number, double, nullable — The selection's cap, or null when the run was uncapped.
  - `reason` string, required — Why the remaining amounts will never be invoiced.
  - `expectedTotal` integer, required — How many periods matched the selection when the sweep started. Zero until it starts.
  - `processed` integer, required — How many periods the run has reached so far.
  - `succeeded` integer, required — How many periods were closed, or would be closed in a dry run.
  - `failed` integer, required — How many periods were refused or failed. A non-zero count here does not stop the run, and does not make its state Failed.
  - `writeOffAmount` number, double, required — The total written off so far, or the total that would be written off in a dry run.
  - `sweepError` string, nullable — Why the run itself stopped early, when it did. Set only for a run-level failure; a period the sweep refused leaves this null and reports itself in its own error.
  - `createdAt` string, date-time, required — When the run was requested.
  - `createdById` string, uuid, required — The operator accountable for the run, as recorded on every period it closes.
  - `createdByMail` string, required — The operator's mail address.
  - `completedAt` string, date-time, nullable — When the run finished, whether it completed or failed. Null while it is still sweeping.
  - `periods` GetBulkCloseBillingPeriodsStatusEndpointOutputPeriod[], required — One verdict per period the run has reached, oldest period first.
    - `billingPeriodId` string, required
    - `organizationId` string, nullable
    - `writeOffAmount` number, double, required
    - `error` string, nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthenticated
- `403` — Forbidden

---

[API](https://skmtc.net/rapidata/apis/rapidata-api.md) · [All operations](https://skmtc.net/rapidata/apis/rapidata-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rapidata/rapidata-api/revisions/5f993bd211f5/schema)
