# Redeem a provision directly on any pool

`POST /dex/pools/{poolNft}/redeem` · Lithos client API · Lithos Dex · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/direct-ld-pool-redeem

Closes one of this wallet's provisions now. Open on every pool, whatever its genesis. Fees the vault owes the provision are lost with its box, so a provision owed any needs `acknowledgeUnclaimedFees`; claim them first to keep them.

## Parameters

| Name | In | Type | Required | Description |

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

| `poolNft` | path | string | yes | The pool's NFT id, 64 hex characters |

## Request body

`LDPoolDirectRedeemRequest`, application/json.

- `provisionBoxId` (string, required)
- `acknowledgeUnclaimedFees` (boolean): Required when the vault owes the provision fees, which the redemption destroys.
- `expectedPoolBoxId` (string)

## Responses

### 200: The transaction sent

`LDPoolDirectResult`

- `outcome` (string, required)
- `txId` (string, required)
- `poolNFT` (string, required)
- `kind` (string, required, one of SWAP, DEPOSIT, REDEEM)
- `amountX` (string, required)
- `amountY` (string, required)
- `shares` (string)
- `ownerNFT` (string)
- `provisionBoxId` (string)

### 400: The request is malformed, names a token the pool does not hold, or leaves out an acknowledgement it needs.

`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 LithosDex pool with that NFT, or no live provision with 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: The pool or provision moved since the quote, or another LithosDex mutation is running. Re-quote and resend.

`LDStateChangedResponse`

- `error` (integer, required)
- `reason` (string, required)
- `detail` (string, required): What moved, and what it moved to
- `poolBoxId` (string): Current pool box id
- `vaultBoxId` (string): Current vault box id
- `provisionBoxId` (string): Current provision box id

### 422: The pool can be drained, the pool cannot fill this at its depth or above the floor, or the wallet cannot cover it.

`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 or wallet 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

## Example request

```bash
curl -X POST "http://localhost:9000/dex/pools/{poolNft}/redeem" \
  -H "api_key: $LITHOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "provisionBoxId": "string", "acknowledgeUnclaimedFees": true, "expectedPoolBoxId": "string" }'
```

## Example response

```json
{
  "outcome": "string",
  "txId": "string",
  "poolNFT": "string",
  "kind": "SWAP",
  "amountX": "string",
  "amountY": "string",
  "shares": "string",
  "ownerNFT": "string",
  "provisionBoxId": "string"
}
```
