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

# Selling a loan

> Record that a loan left your book: the cut-off, what stops at it, and what running the sale leaves to you.

A **Cession** is your record that a loan was sold. It carries one date, the **cut-off**, the day the loan stopped being yours to service, and the loan reports `ceded` from it.

It is not a discharge. The debt stands in full and goes on being owed, to somebody else. What ends is your part in it, which is why this is the one state answering a different question from the rest: not what the loan owes, but whose it is.

A cession is undone by retracting it, and by nothing else. It is never edited and never deleted.

## What is recorded

One date and the account every irreversible act gives of itself. Nothing else about the sale reaches the Platform.

| Recorded | Not recorded | Why the absence |
| - | - | - |
| The cut-off date | The buyer | The Platform models no assignee. It would hold a name it never reads, never calls and cannot verify, in a field an auditor reads as *who owns this debt now* |
| Your `reference`, `actor` and `basis` | The price | What the book sold for is a fact about the deal and not about the loan |
| Your `context` object, echoed on every read | What the loan was worth at the cut-off | It derives from the plan, the regime and every receipt then known. A stored total is a second number that can disagree with the components it is the total of |

State the counterparty in `context` if you want it on record. The Platform stores it, returns it on every read of the loan, and reads it for nothing.

## Recording one

Post the cut-off to the loan's cession subresource. The loan comes back as it now reads.

```bash Record a cession theme={null}
BODY='{
  "on": "2026-11-25",
  "reference": "cession-0001",
  "actor": "ops-0007",
  "basis": "portfolio sale, tranche 3",
  "context": { "deal": "2026-Q4-A" }
}'

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

```json 201 theme={null}
{
  "id": "00000000-0000-0000-0000-000000000001",
  "state": "ceded",
  "events": [
    { "id": "…0001", "kind": "issued", "occurred_on": "2026-08-10" },
    {
      "id": "…0002",
      "kind": "ceded",
      "occurred_on": "2026-11-25",
      "act": {
        "reference": "cession-0001",
        "actor": "ops-0007",
        "basis": "portfolio sale, tranche 3",
        "context": { "deal": "2026-Q4-A" }
      }
    }
  ],
  "anomalies": []
}
```

The cut-off is yours to state and is never read from a clock. A portfolio that changed hands on the 25th and is reported on the 30th is recorded as the 25th, and the five days between derive from the sale rather than from when somebody reached a keyboard.

Sending the same body again answers `200` with the cession already on file. [Model](/getting-started/model) carries the Reference and Attribution rules in full.

The loan listing carries the cut-off beside the state, so a reconciliation asks which loans left and as of when without reading each one.

```json Listing row theme={null}
{
  "id": "00000000-0000-0000-0000-000000000001",
  "reference": "order-1",
  "state": "ceded",
  "ceded_on": "2026-11-25",
  "anomalies": []
}
```

## What stops

Four things stop, and they stop on the cut-off itself rather than the day after it.

| From the cut-off | What happens |
| - | - |
| Money reported against the loan | Refused <Badge color="red">409</Badge> `cession_in_force`, naming the cut-off |
| Every figure the Platform quotes | The loan is absent from payment options, is quoted no payoff, and is no longer a loan a stated payoff must be designated between |
| Every further fact | A cancellation, an acceleration, a write-off, a rollover and a return are each refused <Badge color="red">409</Badge> `cession_in_force` |
| Charging | Interest, penalty and late fees accrue up to the cut-off and no further |

What the loan owes on the cut-off is what it owes ever after. Nothing is forgiven: every charge up to that day stands, and a question asked about any date before the cut-off answers exactly what it answered before the sale was recorded.

### Money arriving after

A borrower who pays your old reference after the sale is real and frequent. The Platform refuses that receipt rather than holding it.

```json 409 theme={null}
{
  "error": "loan: the loan carries a cession still in force: every loan of client-alonso this receipt could reach was ceded by its value date of 2026-12-05, the earliest cut-off being 2026-11-25, the debt is no longer this tenant's and money against it is not recorded here",
  "code": "cession_in_force"
}
```

<Info>
  We refuse deliberately, and holding the money was the alternative. A receipt recorded against a loan that left would be the first entry of a settlement ledger between you and the buyer, an entity the Platform does not model. The money is yours to pass on under your own cession agreement, on your own books.
</Info>

The refusal keys on the **value date** and never on when you reported it. A receipt the borrower paid on the 20th and you report on the 30th is allocated in full: they paid you while the loan was yours.

A receipt is addressed to a client and not to a loan. Where the client holds a loan you still own, the receipt is recorded, that loan is settled under the ordinary rules, the ceded loan takes nothing, and `anomalies` names the cession among the reasons the remainder could not be placed.

## Dating the cut-off

Three dates are refused, and two of them name what would clear them.

| Refusal | Status and code | What clears it |
| - | - | - |
| A fact still in force falls on or after the cut-off | <Badge color="orange">422</Badge> `invalid_event` | State a later cut-off, or retract that fact. |
| The loan is `cancelled` | <Badge color="orange">422</Badge> `invalid_event` | Nothing, a loan that never began has nothing to sell. |
| A cession already stands in force | <Badge color="red">409</Badge> `already_ceded` | Retract it. A second sale would disagree about the day the loan left. |

The first is the mirror of the fence a cession puts up. Nothing you recorded may stand on or after the day the loan stopped being yours: a write-off there would be your judgement about a debt you no longer held.

```json 422 theme={null}
{
  "error": "loan: invalid event: a cession on 2026-09-01 of a loan whose written_off of 2026-10-01 still stands — state a cut-off after it, or retract that fact",
  "code": "invalid_event"
}
```

A `written_off` loan is otherwise ordinary to sell, and that is the case this exists for: a sold book is mostly a charged-off book. The loan reads `ceded`, the write-off stays among its facts, and what the write-off cost goes on being reported on every read.

## Undoing one

A deal that collapses is corrected by retracting the cession, by event identifier, on the retraction route like any recorded fact.

The loan then reads as whatever its remaining facts produce, `written_off` where one stands underneath, `active` where nothing does, and every figure the cut-off had stopped is derived again with nothing to unwind. Money reaches it again from the moment the retraction is recorded.

While a cession stands, it is the only fact that may be retracted. Retract it first and every other correction is available again exactly as it was before the sale.

The withdrawn cession stays readable among the loan's facts and does not stand in the way of a later one. A deal that closes under a new cut-off is recorded as an ordinary second cession.

## What stays yours

The Platform records that the loan left. It does not run the sale.

| Yours | What the Platform does |
| - | - |
| Settling with the buyer: the price, the schedule of payment, and money that reaches you after the cut-off | Nothing. It models no assignee and holds no ledger between you and one |
| Telling the borrower the debt was assigned | Nothing. The Platform answers your calls and never calls out |
| Reporting the assignment to a credit bureau | Nothing. Furnishing is yours at every point, and this is no exception |
| Handing the buyer the loan's history | Read it here and send it. There is no buyer-facing door |

What the Platform holds is the record an audit reads: the cut-off, who recorded it, on what basis, what you attached to it, and every figure as of the days the loan was still yours.


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