> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lms.bsa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Write off a loan

> Write off the outstanding balance of a delinquent loan.

Writes off the entire outstanding balance of a loan. The loan
transitions to **closed (written off)**. Use this when the loan is
deemed uncollectible. Recovery payments collected after write-off can
still be recorded via [Recover](/repayments/recover).

Numeric-id only — there is no
`/v1/loans/external/{loan_external_id}` form.

## Path parameters

<ParamField path="loan_id" type="string" required />

## Request body

<ParamField body="transactionDate" type="string" required>
  ISO-8601 `YYYY-MM-DD`. The effective date of the write-off.
</ParamField>

<ParamField body="note" type="string">
  Optional. Justification for the write-off.
</ParamField>

## Example

```bash theme={null}
curl -sf -X POST "$BASE/v1/loans/501/writeoff" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "transactionDate": "2027-01-15",
    "note": "Borrower deceased — no estate"
  }'
```

## Response

`200 OK` returns the [loan object](/loans/overview) with
`status="Closed (written off)"`.

## Errors

| Code        | When                                                                         |
| ----------- | ---------------------------------------------------------------------------- |
| `not_found` | No loan with that ID                                                         |
| `aborted`   | Loan has no outstanding balance, or is in a state that cannot be written off |
