# Record how a facility ended

Closes a funded deal out in money terms: the payoff, the write-off, the settlement. Body: `definitionKey` and `rowId` name the record and `outcomeType` says how it ended (paid_in_full, early_payoff, default, write_off, settlement, refinanced, renewed, charged_off, bankruptcy) — all three required — plus `outcomeDate`, the money and rates as decimal STRINGS (`totalFunded`, `totalPaybackExpected`, `totalCollected`, `totalOutstanding`, `totalWrittenOff`, `totalFeesCollected`, `totalPenalties`, `netProfitLoss`, `settlementAmount`, `settlementDiscountPct`, `collectionRate`, the two rates between 0 and 1), `daysToOutcome`, `totalDelinquentDays`, `reason` and `internalNotes`. A second outcome on the same record answers 409 — a facility ends once. Stopping COLLECTION is `post_payment_schedules_id_complete`; this is the accounting of how it ended.

Access class: `workspace`.

## Endpoint

`POST /v1/servicing/outcomes`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "collectionRate": "string",
    "daysToOutcome": 1,
    "definitionKey": "string",
    "internalNotes": "string",
    "netProfitLoss": "string",
    "outcomeDate": "string",
    "outcomeType": "string",
    "reason": "string",
    "rowId": "",
    "settlementAmount": "string",
    "settlementDiscountPct": "string",
    "totalCollected": "string",
    "totalDelinquentDays": 1,
    "totalFeesCollected": "string",
    "totalFunded": "string",
    "totalOutstanding": "string",
    "totalPaybackExpected": "string",
    "totalPenalties": "string",
    "totalWrittenOff": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "collectionRate": "string",
    "createdAt": "string",
    "daysToOutcome": 1,
    "id": "",
    "internalNotes": "string",
    "netProfitLoss": "string",
    "outcomeDate": "string",
    "outcomeType": "string",
    "reason": "string",
    "recordedBy": 1,
    "rowId": "",
    "settlementAmount": "string",
    "settlementDiscountPct": "string",
    "totalCollected": "string",
    "totalDelinquentDays": 1,
    "totalFeesCollected": "string",
    "totalFunded": "string",
    "totalOutstanding": "string",
    "totalPaybackExpected": "string",
    "totalPenalties": "string",
    "totalWrittenOff": "string",
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
