Open / Close Futures Position
Endpoint: /v1/futures/order/create
Request Parameters
Required
Method: POST
Example
Bash
curl -X POST "https://oapi.websea.com/v1/futures/order/create" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Token: YOUR_TOKEN" \
-H "Nonce: 1700000000_abcd1" \
-H "Signature: GENERATED_SIGNATURE" \
-d "contract_type=open" \
-d "type=buy-limit" \
-d "symbol=BTC-USDT" \
-d "amount=100" \
-d "price=1"
Request Parameters
| Parameter | Required | Type | Example | Description |
|---|---|---|---|---|
| contract_type | Yes | string | open | Action type: open to open a position, close to close a position |
| type | Yes | string | buy-limit | Order type: buy-limit, sell-limit, buy-market, sell-market, buy-tactics, sell-tactics, buy-market-tactic, sell-market-tactics |
| lever_rate | Yes | int | 10 | Leverage multiplier (required for opening positions and strategy orders; not required for closing positions) |
| price | No | number | 1 | Order price (required for all limit orders) |
| amount | Yes | number | 100 | Number of contracts |
| symbol | Yes | string | ETH-USDT | Futures trading pair |
| trigger_price | No | string | 5 | Trigger price (required for conditional and strategy orders, and limit take-profit/stop-loss orders) |
| stop_loss_price | No | string | 3 | Stop-loss price (mutually exclusive with trigger_price) |
| stop_profit_price | No | string | 7 | Take-profit price (mutually exclusive with trigger_price) |
| is_full | No | int | 1 | Margin mode: 1 isolated margin, 2 cross margin. Default: 1 |
Response Parameters
| Parameter | Required | Type | Example | Description |
|---|---|---|---|---|
| errno | Yes | int | 0 | Status code |
| errmsg | Yes | string | success | Status message |
| result | Yes | object | See example | Result data |
Result Fields
| Parameter | Required | Type | Example | Description |
|---|---|---|---|---|
| order_id | Yes | string | BL786401542840282676 | Order ID |