Skip to main content

Place Order

Places a limit or market order.

MethodPOST
Path/v5/order/create
AuthAuthenticated.

Body parameters

ParameterTypeRequiredDescription
categorystringYeslinear for futures, option for options. See Categories.
symbolstringYesTrading pair, e.g. BTCUSDT.
sidestringYesBuy or Sell.
orderTypestringYesLimit (resting at a price) or Market (fill now at whatever price).
qtystringYesQuantity in the base asset. Must be a multiple of qtyStep from Instruments Info — round before sending.
pricestringFor LimitLimit price. Must be a multiple of tickSize from Instruments Info. Ignored for Market orders.
positionIdxintegerYesWhich 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.
timeInForcestringNoHow 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.
orderLinkIdstringNoYour 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

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())

Response

{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderId": "252b350d-ca18-4aca-9411-fcef79c122ec",
"orderLinkId": "my-order-1"
},
"retExtInfo": {},
"time": 1756460699967
}
FieldTypeDescription
orderIdstringServer-issued order ID. Use this on follow-up calls.
orderLinkIdstringEcho 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:

  1. POST /v5/order/create returns retCode: 0 with orderId — the order is resting.
  2. Match — the order's orderStatus transitions through NewPartiallyFilledFilled (or Cancelled if you cancel it).
  3. 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.