# Settle a position

`POST /forwards/positions/{boxId}/settle` · Lithos client API · Difficulty Forwards · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/settle-df-position

Pay both sides of a position whose window has been recorded, recording the current epoch in the same transaction when it is due. The network fee comes out of the position; this wallet keeps the rewards, 5 LIT, or 10 LIT when the settlement also records. No body.

## Parameters

| Name | In | Type | Required | Description |

|---|---|---|---|---|

| `boxId` | path | string | yes | Position box id, as listed by `GET /forwards/positions`. |

## Responses

### 200: Result of the settlement

`DFSettleResult`

- `txId` (string, required)
- `outcome` (string, required, one of accepted, rejected, uncertain)
- `refund` (boolean, required)
- `owedLong` (string, required)
- `owedShort` (string, required)
- `rewardLit` (string, required)

### 403: Missing or wrong api_key

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 404: No unspent position has that id.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 409: An unconfirmed transaction already spends the position, or the accumulator's unconfirmed spends are contested or record an epoch that is over. Retry after the next block.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 422: The window's last epoch is not recorded yet, or no accumulator is deployed.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 503: Node, wallet or transaction engine unavailable, or the request ran out of time. The message says whether anything was sent. When it says the outcome is unknown, check this wallet's offers and positions before retrying.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### default: Error

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

## Example request

```bash
curl -X POST "http://localhost:9000/forwards/positions/{boxId}/settle" \
  -H "api_key: $LITHOS_API_KEY"
```

## Example response

```json
{
  "txId": "string",
  "outcome": "accepted",
  "refund": true,
  "owedLong": "string",
  "owedShort": "string",
  "rewardLit": "string"
}
```
