# Create a lot auction

`POST /sigmafi/zc/lots` · Lithos client API · SigmaFi ZC Standard · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/create-zc-lot

Sell a basket whole at a price falling from `opening` to `floor`. A LithosDex provision NFT is refused: wrap it and sell the receipt. A token-market lot cannot hold the market's own token.

## Request body

`ZcLotRequest`, application/json.

- `market` (string, required, one of ERG, SigUSD)
- `items` (ZcToken[])
  - `tokenId` (string, required)
  - `amount` (string, required)
- `nanoErg` (string): ERG sold beside the items; SigUSD lots only.
- `opening` (string, required): The price until `start`, in the market's unit.
- `floor` (string, required): The price from `end` on.
- `start` (integer · int64): Default the current height.
- `end` (integer · int64, required)
- `expiry` (integer · int64): Default `end`. From then anyone may return the lot for its refund fee.
- `refundFeeNanoErg` (string): Default 2000000. On a SigUSD lot the buyer takes the box's whole nanoERG, this fee included.
- `limits` (ZcLimits): Bounds on the rebuilt transaction. For fills, buys, repays, recollateralizations and claims, amounts are in the action's market unit (nanoERG for ERG, fee included; raw units for SigUSD; nanoERG for actions with no market). For posts (orders, offers, asks, lots, fractionalize and wraps), `maxPay` is always in nanoERG (box value plus miner fee), since any token capital or collateral is fixed directly by the request body. Outside them the send answers 409. 
  - `maxPay` (string)
  - `minReceive` (string)

## Responses

### 200: The transaction was sent; `outcome` says whether the node accepted it.

`ZcResult`

- `txId` (string): None while the write is held.
- `outcome` (string, one of accepted, rejected, uncertain, held): The node's answer. `held`: the write reads the box a pending oracle refresh creates, and a miner could reach it before that refresh, so nothing was sent yet. The client tries it again every 30 seconds for 10 minutes, rebuilt and checked against `limits` each time, and sends it once the refresh confirms.
- `reason` (string): Why a write is held.
- `retriesUntil` (integer · int64): When a held write stops being tried (ms since the epoch).
- `boxId` (string): The transaction's first output.
- `assetId` (string): The bond asset a fill minted.
- `warnings` (string[])

### 400: A malformed field, or terms the contracts refuse.

`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

### 404: No such box or token, or not this wallet's.

`ApiError`

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

### 409: A pending transaction already spends a box this needs, or the rebuilt transaction is outside `limits`. Re-quote and resend.

`ApiError`

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

### 422: Valid, but not possible now; the message gives the reason the check lists in `refusals`.

`ApiError`

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

### 503: ZC tracking is off or not seeded, or the node, its index or the wallet did not answer. Nothing was sent.

`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/sigmafi/zc/lots" \
  -H "api_key: $LITHOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "market": "ERG", "items": [ { "tokenId": "string", "amount": "string" } ], "nanoErg": "string", "opening": "string", "floor": "string", "start": 0, "end": 0, "expiry": 0, "refundFeeNanoErg": "string", "limits": { "maxPay": "string", "minReceive": "string" } }'
```

## Example response

```json
{
  "txId": "string",
  "outcome": "accepted",
  "reason": "string",
  "retriesUntil": 0,
  "boxId": "string",
  "assetId": "string",
  "warnings": [
    "string"
  ]
}
```
