# Create an offer

`POST /forwards/offers` · Lithos client API · Difficulty Forwards · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/create-df-offer

Lock this wallet's side of a forward, its margin plus 7.5 LIT of rewards, in an offer any taker can fill. Cancel it with `POST /forwards/offers/{boxId}/cancel` while it is unfilled.

## Request body

`DFOfferRequest`, application/json.

- `makerSide` (string, required, one of long, short): The side this wallet takes.
- `strike` (string, required): Difficulty the window's mean is measured against.
- `notional` (string, required): LIT base units. Each side's margin is a fifth of it.
- `windowStart` (integer · int32, required): First epoch of the window, 2 to 120 epochs after the current one.
- `windowLength` (integer · int32, required)
- `expiry` (integer · int32): Last height a fill can be mined at. Defaults to the last block of the current epoch.

## Responses

### 200: Result of the transaction creating the offer

`DFOfferResult`

- `txId` (string, required)
- `outcome` (string, required, one of accepted, rejected, uncertain)
- `offerBoxId` (string, required)

### 400: Malformed body, or terms no fill accepts.

`ApiError`

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

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

### 422: No fill could reach the window, the notional is over the short-window limit, no accumulator is deployed, or the wallet cannot cover the LIT and ERG.

`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/offers" \
  -H "api_key: $LITHOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "makerSide": "long", "strike": "64000000000000", "notional": "10000000000000", "windowStart": 0, "windowLength": 1, "expiry": 0 }'
```

## Example response

```json
{
  "txId": "string",
  "outcome": "accepted",
  "offerBoxId": "string"
}
```
