Place Order
Places a limit or market order.
| Method | POST |
| Path | /v5/order/create |
| Auth | Authenticated. |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | Yes | linear for futures, option for options. See Categories. |
symbol | string | Yes | Trading pair, e.g. BTCUSDT. |
side | string | Yes | Buy or Sell. |
orderType | string | Yes | Limit (resting at a price) or Market (fill now at whatever price). |
qty | string | Yes | Quantity in the base asset. Must be a multiple of qtyStep from Instruments Info — round before sending. |
price | string | For Limit | Limit price. Must be a multiple of tickSize from Instruments Info. Ignored for Market orders. |
positionIdx | integer | Yes | Which side this order applies to. 0 = one-way mode (single net position). 1 = long side (hedge mode). 2 = short side (hedge mode). See Switch Position Mode. |
timeInForce | string | No | How long the order stays open. GTC = good till cancelled (default). IOC = fill what you can right now, cancel the rest. FOK = fill it all in one shot or cancel completely. |
orderLinkId | string | No | Your own order ID (up to 36 chars). Send a UUID on retries so duplicates are de-duped. Lets you look the order up later without keeping the server-issued orderId. |
Request
- Python
- Java
- Go
- Node.js
from reference_client import sign_request, BASE_URL
import requests, json
payload = {
"category": "linear",
"symbol": "BTCUSDT",
"side": "Buy",
"orderType": "Limit",
"qty": "0.001",
"price": "50000",
"positionIdx": 1,
"timeInForce": "GTC",
"orderLinkId": "my-order-1"
}
headers, path = sign_request("POST", "/v5/order/create")
r = requests.post(BASE_URL + path, headers=headers, data=json.dumps(payload))
print(r.json())
Map<String, Object> body = new HashMap<>();
body.put("category", "linear");
body.put("symbol", "BTCUSDT");
body.put("side", "Buy");
body.put("orderType", "Limit");
body.put("qty", "0.001");
body.put("price", "50000");
body.put("positionIdx", 1);
body.put("timeInForce", "GTC");
body.put("orderLinkId", "my-order-1");
HttpResponse<String> resp = client.send(
"POST", "/v5/order/create", null, body);
System.out.println(resp.body());
body := map[string]any{
"category": "linear",
"symbol": "BTCUSDT",
"side": "Buy",
"orderType": "Limit",
"qty": "0.001",
"price": "50000",
"positionIdx": 1,
"timeInForce": "GTC",
"orderLinkId": "my-order-1",
}
bodyJSON, _ := json.Marshal(body)
headers, p, err := SignRequest("POST", "/v5/order/create", nil)
if err != nil { panic(err) }
req, _ := http.NewRequest("POST", BaseURL+p, bytes.NewReader(bodyJSON))
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const body = {
"category": "linear",
"symbol": "BTCUSDT",
"side": "Buy",
"orderType": "Limit",
"qty": "0.001",
"price": "50000",
"positionIdx": 1,
"timeInForce": "GTC",
"orderLinkId": "my-order-1"
};
const {headers, path} = signRequest('POST', '/v5/order/create');
const r = await fetch(BASE_URL + path, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
console.log(await r.json());
Response
{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderId": "252b350d-ca18-4aca-9411-fcef79c122ec",
"orderLinkId": "my-order-1"
},
"retExtInfo": {},
"time": 1756460699967
}
| Field | Type | Description |
|---|---|---|
orderId | string | Server-issued order ID. Use this on follow-up calls. |
orderLinkId | string | Echo of the orderLinkId you sent. |
A retCode: 0 means the exchange has accepted your order — not that it has filled. To know when it actually fills, either subscribe to the Order Updates socket (recommended), or poll /v5/order/realtime every second or so.
Order acceptance vs execution
For a Limit GTC order, you'll typically see this sequence:
POST /v5/order/createreturnsretCode: 0withorderId— the order is resting.- Match — the order's
orderStatustransitions throughNew→PartiallyFilled→Filled(orCancelledif you cancel it). - Each fill produces an entry in Execution List.
For a Market order, the order is matched immediately and you'll see Filled (or PartiallyFilled if liquidity is thin) as soon as you query its status.