# Create new order

`POST https://api.cryptohopper.com/v1/hopper/{id}/order`

Part of [Orders](https://www.cryptohopper.com/api-documentation/api-reference/orders.md) in the Cryptohopper API reference.

Places a buy or sell order for a coin on the hopper's exchange. A sell without manual set to 1 sells all open positions of that coin; with manual set to 1 and an amount, it sells only that amount.

OAuth scope: `read`, `manage`, `trade`

Uses the order rate limit bucket: 1 request per 8 seconds, and the same order_type and coin for the same hopper is refused for 8 seconds. order_type is buy or sell; coin is the currency to buy or sell. Without price the current ticker price is used; without amount a buy uses the bot's configured buy amount. The order is queued and placed on the exchange shortly after the response. Optional buy fields: percentage_profit (or pct_profit), trailing_buy and trailing_buy_percentage, take_profit_levels (up to 10 levels, as an array of {"profit", "share"} objects or the shorthand "1:20,2:20"). iceberg_total_orders (2 or more) splits the order for normal bots.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | The OAuth access token of the user. |

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Hopper ID. |

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `order_type` | string | no |  |
| `market_order` | integer | no |  |
| `coin` | string | no |  |
| `price` | number | no |  |
| `amount` | number | no |  |
| `order_trigger` | string | no |  |
| `pct_profit` | number | no |  |
| `stop_loss_percentage` | number | no |  |
| `trailing_stop_loss_percentage` | number | no |  |
| `trailing_arm_percentage` | number | no |  |
| `manual` | number | no |  |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/order" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_type":"buy","coin":"BTC","amount":0.001,"price":65000,"market_order":0,"pct_profit":2.5,"order_trigger":"my-app"}'
```

## Response

Example response (illustrative values):

```json
{
    "data": "Buy order will be placed at the exchange. Currency: BTC (BTC/USDT) Amount: 0.001 Price: 65000"
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
