---
title: "Closes a billing period, writing off whatever it would still have invoiced."
method: POST
path: "/billing-period/{billingPeriodId}/close"
tags: ["Billing"]
---

# Closes a billing period, writing off whatever it would still have invoiced.

`POST /billing-period/{billingPeriodId}/close`

The remaining amount is covered by a write-off voucher carrying the caller and the reason, so
 the period ends up closed and fully covered; nothing is sent to the payment provider. Answers
 409 Conflict for a period that has already been invoiced, is being reconciled, or was already
 closed this way. The close is sticky: later changes to the period's billing inputs no longer
 bring it back for review, and undoing it means calling
 POST /billing-period/{billingPeriodId}/resettle with reopen set.

## Path parameters

- `billingPeriodId` string, required

## Request body

- CloseBillingPeriodEndpointInput
  - `reason` string, required — Why the remaining amount will never be invoiced.

## Response `200`

OK

- CloseBillingPeriodEndpointOutput
  - `billingPeriodId` string, required — The closed billing period.
  - `writtenOffAmount` number, double, required — The amount that was written off.
  - `writeOffVoucherId` string, nullable — The voucher that absorbed the written-off amount, or null when there was nothing left.

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