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

# Record a write-off

> Record the judgement that the debt will not be collected. The charging stops; the debt survives in full.

A write-off is your recorded judgement that the debt will not be collected. It is not forgiveness: the debt survives it in full and stays collectable — what stops is the charging, on the write-off date itself. [Writing a Loan off](/lending/delinquency) carries the freeze and the recovery.

The path segment is `write-off`, with a hyphen.

## Path parameters

<ParamField path="tenant_id" type="string" required>
  The Tenancy acting.
</ParamField>

<ParamField path="loan_id" type="string" required>
  The Loan. Another Tenancy's and one that never existed are both `404`.
</ParamField>

## Body

<ParamField body="on" type="string" required>
  The civil day of the judgement, never defaulted. Every delinquency figure freezes at it.
</ParamField>

<ParamField body="reference" type="string" required>
  Your name for the act, in the one act namespace of the Tenancy.
</ParamField>

<ParamField body="actor" type="string" required>
  Whoever acted, your own reference. Never derived from the credential.
</ParamField>

<ParamField body="basis" type="string" required>
  Why, in your words. No vocabulary is imposed.
</ParamField>

<ParamField body="context" type="object">
  Stored, echoed beside the fact, read by nothing.
</ParamField>

## Response

`201` with [the whole Loan](/api-reference/loans/read): `state` reads `written_off`, and the `write_off` block prices the judgement — `cost`, the debt at the write-off taken apart by charge, and `recovered`, what has been collected against it since. Money that arrives later is an ordinary Receipt: it settles the arrears first and then `cost`, advancing no instalment and recalculating no plan, so what is still owed is always `cost` less `recovered`. `recovered` grows, the state does not move, and `closed_on` never appears — a recovery does not revive the Loan, and full recovery does not close it.

Retry `200`; a differing body under the recorded `reference`, `409` `reference_reused`. A write-off is withdrawn by [retracting it](/api-reference/loans/retraction) — or superseded by [a cession](/api-reference/loans/cession), which a charged-off book mostly is.

## Refusals

| Condition | Status and code | What clears it |
| - | - | - |
| A fact still in force falls on or after `on` | <Badge color="orange">422</Badge> `invalid_event` | State a later day, or retract that fact |
| A write-off already stands | <Badge color="red">409</Badge> `already_written_off` | Nothing — the retry that answers `200` is the one under the recorded `reference` |
| The Loan is cancelled or ceded | <Badge color="red">409</Badge> | The refusal names the fact in force and its cure |

<RequestExample>
  ```bash Write off theme={null}
  BODY='{
    "on": "2026-07-15",
    "reference": "wo-0001",
    "actor": "ops-0007",
    "basis": "sin contacto 90 dias; garantia inexistente"
  }'

  curl -X POST "https://api.capcells.com/v1/tenants/$TENANT_ID/loans/$LOAN_ID/write-off" \
    -H "Authorization: $(capcells_sign "$CAPCELLS_API_KEY" POST "/v1/tenants/$TENANT_ID/loans/$LOAN_ID/write-off" "$BODY")" \
    -H "Content-Type: application/json" \
    -d "$BODY"
  ```
</RequestExample>

<ResponseExample>
  ```json 201, the write_off block theme={null}
  {
    "state": "written_off",
    "write_off": {
      "on": "2026-07-15",
      "cost": {
        "total": { "minor_units": 1091527, "currency": "MXN" },
        "charges": [
          { "charge": "penalty", "amount": { "minor_units": 45711, "currency": "MXN" },
            "tax": { "minor_units": 7309, "currency": "MXN" }, "total": { "minor_units": 53020, "currency": "MXN" } },
          { "charge": "late_fee", "amount": { "minor_units": 60000, "currency": "MXN" },
            "tax": { "minor_units": 9600, "currency": "MXN" }, "total": { "minor_units": 69600, "currency": "MXN" } },
          { "charge": "fee", "amount": { "minor_units": 25000, "currency": "MXN" },
            "tax": { "minor_units": 3999, "currency": "MXN" }, "total": { "minor_units": 28999, "currency": "MXN" } },
          { "charge": "interest", "amount": { "minor_units": 120611, "currency": "MXN" },
            "tax": { "minor_units": 19297, "currency": "MXN" }, "total": { "minor_units": 139908, "currency": "MXN" } },
          { "charge": "principal", "amount": { "minor_units": 800000, "currency": "MXN" },
            "tax": { "minor_units": 0, "currency": "MXN" }, "total": { "minor_units": 800000, "currency": "MXN" } }
        ]
      },
      "recovered": { "minor_units": 100000, "currency": "MXN" }
    },
    …
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.