> For the complete documentation index, see [llms.txt](https://roqqu-api-services.gitbook.io/ras/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roqqu-api-services.gitbook.io/ras/trade/sell.md).

# Sell

Sell cryptocurrency.

**Endpoint:** `POST /trade/sell`

**Authentication:** Required (`x-api-key` for live, `x-staging-api-key` for test)

**Fees**

Fees are taken from the token you are selling.

#### Request Parameters <a href="#request-parameters-12" id="request-parameters-12"></a>

| Parameter | Type   | Required | Description                                               |
| --------- | ------ | -------- | --------------------------------------------------------- |
| amount    | string | Yes      | Amount of token you want to sell (must be greater than 0) |
| token     | string | Yes      | Token to sell (e.g., btc, eth)                            |

#### Example Request <a href="#example-request-22" id="example-request-22"></a>

```
curl -X POST https://service.roqqu.com/v1/trade/sell \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "amount=0.00002" \
  -d "token=btc"
```

#### Example Response **(Success)** <a href="#example-response-22" id="example-response-22"></a>

```
{
  "status": "success",
  "message": "buy operation successful",
  "data": null
}
```

> Sell is a ledger operation. It does **not** emit a webhook. Confirm via balances / history.

**Error Responses**

**Invalid token:**

```
{
  "status": "fail",
  "message": "invalid token symbol"
}
```

**Sells not enabled:**

```
{
  "status": "fail",
  "message": "sells not currently enabled for token"
}
```

**Insufficient balance:**

```
{
  "status": "fail",
  "message": "insufficient BTC balance"
}
```

**Fee too high:**

```
{
  "status": "fail",
  "message": "fee cannot be greater than or equal to amount"
}
```

**Below minimum:**

```
{
  "status": "fail",
  "message": "amount cannot be less than 0.00001"
}
```

**Above maximum:**

```
{
  "status": "fail",
  "message": "amount cannot be more than 1"
}
```

**Amount must be positive:**

```
{
  "status": "fail",
  "message": "amount must be greater than 0"
}
```

**Unable to load token data:**

```
{
  "status": "fail",
  "message": "unable to get token data"
}
```
