# Quote filling an offer

`POST /forwards/offers/{boxId}/fill/check` · Lithos client API · Difficulty Forwards

Source: https://lithosprotocol.org/docs/api/check-df-fill

What filling an offer takes from this wallet and the side it would hold. `offer.fillable` says whether a fill sent now would be accepted, and `offer.refusal` why not. No body.

## Parameters

| Name | In | Type | Required | Description |

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

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

## Responses

### 200: Quote for the fill

`DFFillQuote`

- `offer` (DFOfferView, required)
  - `boxId` (string, required)
  - `maker` (string, required): Address the maker is paid to.
  - `makerSide` (string, required, one of long, short): `long` is paid when the window's mean difficulty is above the strike, `short` when below.
  - `strike` (string, required): Difficulty the window's mean is measured against.
  - `notional` (string, required): LIT base units.
  - `margin` (string, required): Each side's margin, a fifth of the notional, and the most either side can lose of it.
  - `windowStart` (integer · int32, required)
  - `windowLength` (integer · int32, required)
  - `windowEnd` (integer · int32, required): The window's last epoch.
  - `expiry` (integer · int32, required): The last height a fill can be mined at.
  - `lastFillHeight` (integer · int32, required): The last height a fill can actually be mined at: the expiry, or earlier when the window would start less than 2 epochs after the fill.
  - `lit` (string, required): LIT base units the offer holds.
  - `nanoErgs` (string, required)
  - `takerLit` (string, required): LIT base units a fill takes from the taker.
  - `takerNanoErgs` (string, required): nanoERG a fill takes from the taker, network fee included.
  - `impliedMove` (number · double): The strike against the current difficulty, as a fraction.
  - `impliedMoveNext` (number · double): The strike against `nextDifficulty`, when known.
  - `mine` (boolean, required): Whether this wallet made the offer.
  - `fillable` (boolean, required): Whether this wallet's fill sent now would be accepted.
  - `refusal` (string): Why not, when `fillable` is false.
- `takerSide` (string, required, one of long, short): The side this wallet takes, opposite the maker's.
- `takerLit` (string, required)
- `takerNanoErgs` (string, required): Network fee included.
- `networkFee` (string, required)
- `maxLoss` (string, required): The most this wallet can lose, its margin plus 7.5 LIT.
- `warnings` (string[], required)

### 400: `boxId` is not a box id.

`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 offer 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

### 422: 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 unavailable. Retry.

`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/offers/{boxId}/fill/check"
```

## Example response

```json
{
  "offer": {
    "boxId": "string",
    "maker": "string",
    "makerSide": "long",
    "strike": "string",
    "notional": "string",
    "margin": "string",
    "windowStart": 0,
    "windowLength": 0,
    "windowEnd": 0,
    "expiry": 0,
    "lastFillHeight": 0,
    "lit": "string",
    "nanoErgs": "string",
    "takerLit": "string",
    "takerNanoErgs": "string",
    "impliedMove": 0,
    "impliedMoveNext": 0,
    "mine": true,
    "fillable": true,
    "refusal": "string"
  },
  "takerSide": "long",
  "takerLit": "string",
  "takerNanoErgs": "string",
  "networkFee": "string",
  "maxLoss": "string",
  "warnings": [
    "string"
  ]
}
```
