
# 下单 (TRADE)

- **POST** ```/capi/v3/order```

<strong>请求权重</strong>

10s order rate limit(X-ORDER-COUNT-10S)为1; 1min order rate limit(X-ORDER-COUNT-1M)为1; IP rate limit(X-USED-WEIGHT-1M)为0


<div class='api-content-wrap'>
<div>


<strong>请求参数</strong>


| 参数名              | 类型     | 是否必填   | 说明                                                              |
|------------------|--------|--------|-----------------------------------------------------------------|
| symbol           | String | 是      | 交易对，例如 `BTCUSDT`。                                               |
| side             | String | 是      | 买卖方向，取值：`BUY`、`SELL`。                                           |
| positionSide     | String | 是      | 持仓方向，取值：`LONG`、`SHORT`。                                         |
| type             | String | 是      | 订单类型，取值：`LIMIT`、`MARKET`。                                       |
| timeInForce      | String | 条件必填   | 有效方式，`type = LIMIT` 时必填，取值：`GTC`、`IOC`、`FOK`、`POST_ONLY`。       |
| quantity         | String | 是      | 下单数量，必须大于 0。                                                    |
| price            | String | 条件必填   | 限价订单价格，`type = LIMIT` 时必填。                                      |
| newClientOrderId | String | 是      | 客户自定义订单号（1-36 位，匹配 `^[\\.A-Z\:/a-z0-9_-]{1,36}$`）。              |
| tpTriggerPrice   | String | 否      | 预设止盈触发价。                                                        |
| slTriggerPrice   | String | 否      | 预设止损触发价。                                                        |
| TpWorkingType    | String | 否      | 止盈触发价计算基准，取值：`CONTRACT_PRICE`、`MARK_PRICE`，默认 `CONTRACT_PRICE`。 |
| SlWorkingType    | String | 否      | 止损触发价计算基准，取值：`CONTRACT_PRICE`、`MARK_PRICE`，默认 `CONTRACT_PRICE`。 |
| reduceOnly       | Boolean | 否     | 是否只减仓。                                                          |

</div>
<div class='api-align'>
  <div class='code-wrap'>
<strong>请求示例</strong>

```powershell
curl -X POST "https://api-contract.weex.com/capi/v3/order" \
   -H "ACCESS-KEY:*******" \
   -H "ACCESS-SIGN:*******" \
   -H "ACCESS-PASSPHRASE:*****" \
   -H "ACCESS-TIMESTAMP:1659076670000" \
   -H "Content-Type: application/json" \
   -d '{
     "symbol": "BTCUSDT",
     "side": "BUY",
     "positionSide": "LONG",
     "type": "LIMIT",
     "timeInForce": "GTC",
     "quantity": "0.01",
     "price": "69000",
     "newClientOrderId": "my-order-0001",
     "tpTriggerPrice": "70000",
     "slTriggerPrice": "68000",
     "TpWorkingType": "CONTRACT_PRICE",
     "SlWorkingType": "MARK_PRICE",
     "reduceOnly": false
   }'
```
  </div>
  </div>

</div>

<div class='api-content-wrap'>
  <div>
<strong>返回参数</strong>


| 参数名         | 类型    | 说明 |
|----------------|---------|------|
| orderId        | String  | 系统生成的订单 ID。 |
| clientOrderId  | String  | 回显的 `newClientOrderId`。 |
| success        | Boolean | 是否受理成功。 |
| errorCode      | String  | 当 `success = false` 时返回错误码；成功时为空。 |
| errorMessage   | String  | 当 `success = false` 时返回错误信息；成功时为空。 |

  </div>
  <div class='api-align'>

  <div class='code-wrap'>
<strong>返回示例</strong>

```json
{
  "orderId": "702345678901234567",
  "clientOrderId": "my-order-0001",
  "success": true,
  "errorCode": "",
  "errorMessage": ""
}
```
  </div>
    </div>
</div>
