Contract Open/Close Positions
Address: /openApi/contract/add
Receiving Parameters
Required
Submission method: post
Submission Parameters
| Parameter Name |
Required |
Type |
Example |
Description |
| contract_type |
Yes |
string |
open |
Type open for opening a position, close for closing a position |
| type |
Yes |
string |
buy-limit |
Order type buy-limit (normal buy order) sell-limit (normal sell order) buy-market (market buy order) sell-market (market sell order) buy-tactics (tactical buy order) sell-tactics (tactical sell order) buy-market-tactic (tactical market buy order) sell-market-tactics (tactical market sell order) |
| lever_rate |
Yes |
int |
10 |
Leverage multiple (required for opening positions, required for strategy delegation, not filled for closing positions) |
| price |
No |
number |
1 |
Order Price |
| amount |
Yes |
number |
100 |
quantity |
| symbol |
Yes |
string |
ETH-USDT |
Contract Trading Pair Name |
| trigger_price |
No |
string |
5 |
Trigger Price Mandatory for planned strategy orders |
| stop_loss_price |
No |
string |
3 |
Stop loss price |
| stop_profit_price |
No |
string |
7 |
Stop-profit Price |
| is_full |
No |
int |
1 |
Mode 1 isolated margin 2 cross margin Default 1 |
Return Parameters
| Parameter Name |
Required |
Type |
Example |
Description |
| errno |
Yes |
int |
0 |
Return Status Code |
| errmsg |
Yes |
string |
success |
Return data |
| result |
Yes |
object |
See example |
Return data |
result Parameters
| Parameter Name |
Required |
Type |
Example |
Description |
| order_id |
Yes |
string |
BL786401542840282676 |
Order ID |
Return Example
JSON{
"errno": 0,
"errmsg": "success",
"result": {
"order_id": "BL786401542840282676"
}
}