# Trade

Futures order trading (private)

## Get single order

> Query a single order by order ID. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Order":{"type":"object","properties":{"orderId":{"type":"integer","format":"int64","description":"Order ID"},"symbol":{"type":"string","description":"Futures symbol"},"type":{"type":"string","description":"Order type","enum":["LIMIT","MARKET_QTY","IOC","FOK","POSTONLY"]},"positionMode":{"type":"string","description":"Position mode","enum":["BUYSELL","OPENCLOSE"]},"isolatedMode":{"type":"string","description":"Margin mode","enum":["CROSS","ISOLATED_BOTH","ISOLATED_LONG","ISOLATED_SHORT"]},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"positionSide":{"type":"string","description":"Position side","enum":["BOTH","LONG","SHORT"]},"price":{"type":"string","description":"Order price"},"origSize":{"type":"string","description":"Original order quantity as submitted by user"},"size":{"type":"string","description":"Actual order quantity (may be trimmed for reduce-only orders)"},"amount":{"type":"string","description":"Market buy order amount"},"filledSize":{"type":"string","description":"Filled quantity"},"filledAmount":{"type":"string","description":"Filled amount"},"status":{"type":"string","description":"Order status. OPEN includes SUBMITTED/CONFIRMED/PARTIAL_FILLED. CLOSED includes FILLED/CANCELED/REJECTED.","enum":["OPEN","CLOSED"]},"reduceOnly":{"type":"boolean","description":"Whether this is a reduce-only order. Only applicable in one-way mode (BUYSELL)."},"clientOrderId":{"type":"string","description":"Client order ID"},"source":{"type":"string","description":"Order source","enum":["MANUAL","API","SYSTEM","TRIGGER"]},"createTime":{"type":"integer","format":"int64","description":"Creation time in milliseconds"},"updateTime":{"type":"integer","format":"int64","description":"Last update time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/order":{"get":{"tags":["Trade"],"summary":"Get single order","description":"Query a single order by order ID. Weight: 5.","operationId":"getOrder","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"name":"symbol","in":"query","required":true,"description":"Futures symbol","schema":{"type":"string"}},{"name":"orderId","in":"query","required":true,"description":"Order ID","schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Place order

> Place a new futures order (async). Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/order":{"post":{"tags":["Trade"],"summary":"Place order","description":"Place a new futures order (async). Weight: 5.","operationId":"placeOrder","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["symbol","side","type"],"properties":{"clientOrderId":{"type":"string","description":"Client order ID for deduplication (server validates within 2 hours). Max 64 characters, alphanumeric and hyphen only."},"symbol":{"type":"string","description":"Futures symbol"},"positionSide":{"type":"string","description":"Position side. Required for hedge mode (LONG/SHORT). Defaults to BOTH for one-way mode.","enum":["BOTH","LONG","SHORT"]},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"type":{"type":"string","description":"Order type","enum":["LIMIT","MARKET_QTY","IOC","FOK","POSTONLY"]},"size":{"type":"string","description":"Order quantity. Required for limit orders."},"price":{"type":"string","description":"Order price. Required for limit orders."},"reduceOnly":{"type":"boolean","description":"Reduce-only flag. Only applicable in one-way mode (BUYSELL). Defaults to false. Must be false in hedge mode (OPENCLOSE).","default":false}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"orderId":{"type":"integer","format":"int64","description":"Order ID"}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Cancel order

> Cancel an existing order (async). Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/order":{"delete":{"tags":["Trade"],"summary":"Cancel order","description":"Cancel an existing order (async). Weight: 5.","operationId":"cancelOrder","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["symbol","orderId"],"properties":{"symbol":{"type":"string","description":"Futures symbol"},"orderId":{"type":"integer","format":"int64","description":"Order ID to cancel"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Batch place orders

> Place multiple limit orders in a single request (async). Maximum 20 orders per request. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/massOrder":{"post":{"tags":["Trade"],"summary":"Batch place orders","description":"Place multiple limit orders in a single request (async). Maximum 20 orders per request. Weight: 5.","operationId":"batchPlaceOrders","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["symbol","orders"],"properties":{"symbol":{"type":"string","description":"Futures symbol"},"orders":{"type":"array","description":"Limit order list. Maximum 20 orders.","maxItems":20,"items":{"type":"object","required":["side","type"],"properties":{"clientOrderId":{"type":"string","description":"Client order ID for deduplication. Max 64 characters, alphanumeric and hyphen only."},"positionSide":{"type":"string","description":"Position side. Required for hedge mode.","enum":["BOTH","LONG","SHORT"]},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"size":{"type":"string","description":"Order quantity. Required for limit orders."},"price":{"type":"string","description":"Order price. Required for limit orders."},"type":{"type":"string","description":"Order type. Must be LIMIT.","enum":["LIMIT"]},"reduceOnly":{"type":"boolean","description":"Reduce-only flag. Must be false in hedge mode.","default":false}}}}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"orderIds":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"integer","format":"int64","description":"Order ID"},"clientOrderId":{"type":"string","description":"Client order ID"}}}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Get order by client order ID

> Query an order by client order ID. Only orders within a certain time window can be queried. For normal queries, use /v1/trade/order instead. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Order":{"type":"object","properties":{"orderId":{"type":"integer","format":"int64","description":"Order ID"},"symbol":{"type":"string","description":"Futures symbol"},"type":{"type":"string","description":"Order type","enum":["LIMIT","MARKET_QTY","IOC","FOK","POSTONLY"]},"positionMode":{"type":"string","description":"Position mode","enum":["BUYSELL","OPENCLOSE"]},"isolatedMode":{"type":"string","description":"Margin mode","enum":["CROSS","ISOLATED_BOTH","ISOLATED_LONG","ISOLATED_SHORT"]},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"positionSide":{"type":"string","description":"Position side","enum":["BOTH","LONG","SHORT"]},"price":{"type":"string","description":"Order price"},"origSize":{"type":"string","description":"Original order quantity as submitted by user"},"size":{"type":"string","description":"Actual order quantity (may be trimmed for reduce-only orders)"},"amount":{"type":"string","description":"Market buy order amount"},"filledSize":{"type":"string","description":"Filled quantity"},"filledAmount":{"type":"string","description":"Filled amount"},"status":{"type":"string","description":"Order status. OPEN includes SUBMITTED/CONFIRMED/PARTIAL_FILLED. CLOSED includes FILLED/CANCELED/REJECTED.","enum":["OPEN","CLOSED"]},"reduceOnly":{"type":"boolean","description":"Whether this is a reduce-only order. Only applicable in one-way mode (BUYSELL)."},"clientOrderId":{"type":"string","description":"Client order ID"},"source":{"type":"string","description":"Order source","enum":["MANUAL","API","SYSTEM","TRIGGER"]},"createTime":{"type":"integer","format":"int64","description":"Creation time in milliseconds"},"updateTime":{"type":"integer","format":"int64","description":"Last update time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/orderByClientOrderId":{"get":{"tags":["Trade"],"summary":"Get order by client order ID","description":"Query an order by client order ID. Only orders within a certain time window can be queried. For normal queries, use /v1/trade/order instead. Weight: 5.","operationId":"getOrderByClientOrderId","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"name":"symbol","in":"query","required":true,"description":"Futures symbol","schema":{"type":"string"}},{"name":"clientOrderId","in":"query","required":true,"description":"Client order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Get open orders

> Query currently active (open) orders. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Order":{"type":"object","properties":{"orderId":{"type":"integer","format":"int64","description":"Order ID"},"symbol":{"type":"string","description":"Futures symbol"},"type":{"type":"string","description":"Order type","enum":["LIMIT","MARKET_QTY","IOC","FOK","POSTONLY"]},"positionMode":{"type":"string","description":"Position mode","enum":["BUYSELL","OPENCLOSE"]},"isolatedMode":{"type":"string","description":"Margin mode","enum":["CROSS","ISOLATED_BOTH","ISOLATED_LONG","ISOLATED_SHORT"]},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"positionSide":{"type":"string","description":"Position side","enum":["BOTH","LONG","SHORT"]},"price":{"type":"string","description":"Order price"},"origSize":{"type":"string","description":"Original order quantity as submitted by user"},"size":{"type":"string","description":"Actual order quantity (may be trimmed for reduce-only orders)"},"amount":{"type":"string","description":"Market buy order amount"},"filledSize":{"type":"string","description":"Filled quantity"},"filledAmount":{"type":"string","description":"Filled amount"},"status":{"type":"string","description":"Order status. OPEN includes SUBMITTED/CONFIRMED/PARTIAL_FILLED. CLOSED includes FILLED/CANCELED/REJECTED.","enum":["OPEN","CLOSED"]},"reduceOnly":{"type":"boolean","description":"Whether this is a reduce-only order. Only applicable in one-way mode (BUYSELL)."},"clientOrderId":{"type":"string","description":"Client order ID"},"source":{"type":"string","description":"Order source","enum":["MANUAL","API","SYSTEM","TRIGGER"]},"createTime":{"type":"integer","format":"int64","description":"Creation time in milliseconds"},"updateTime":{"type":"integer","format":"int64","description":"Last update time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/openOrders":{"get":{"tags":["Trade"],"summary":"Get open orders","description":"Query currently active (open) orders. Weight: 5.","operationId":"getOpenOrders","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"name":"symbol","in":"query","description":"Futures symbol. Returns all symbols if not specified.","schema":{"type":"string"}},{"name":"endTime","in":"query","description":"End time (exclusive), defaults to current time. Milliseconds.","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 1-500.","schema":{"type":"integer","default":100,"minimum":1,"maximum":500}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Get history orders

> Query historical closed orders. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Order":{"type":"object","properties":{"orderId":{"type":"integer","format":"int64","description":"Order ID"},"symbol":{"type":"string","description":"Futures symbol"},"type":{"type":"string","description":"Order type","enum":["LIMIT","MARKET_QTY","IOC","FOK","POSTONLY"]},"positionMode":{"type":"string","description":"Position mode","enum":["BUYSELL","OPENCLOSE"]},"isolatedMode":{"type":"string","description":"Margin mode","enum":["CROSS","ISOLATED_BOTH","ISOLATED_LONG","ISOLATED_SHORT"]},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"positionSide":{"type":"string","description":"Position side","enum":["BOTH","LONG","SHORT"]},"price":{"type":"string","description":"Order price"},"origSize":{"type":"string","description":"Original order quantity as submitted by user"},"size":{"type":"string","description":"Actual order quantity (may be trimmed for reduce-only orders)"},"amount":{"type":"string","description":"Market buy order amount"},"filledSize":{"type":"string","description":"Filled quantity"},"filledAmount":{"type":"string","description":"Filled amount"},"status":{"type":"string","description":"Order status. OPEN includes SUBMITTED/CONFIRMED/PARTIAL_FILLED. CLOSED includes FILLED/CANCELED/REJECTED.","enum":["OPEN","CLOSED"]},"reduceOnly":{"type":"boolean","description":"Whether this is a reduce-only order. Only applicable in one-way mode (BUYSELL)."},"clientOrderId":{"type":"string","description":"Client order ID"},"source":{"type":"string","description":"Order source","enum":["MANUAL","API","SYSTEM","TRIGGER"]},"createTime":{"type":"integer","format":"int64","description":"Creation time in milliseconds"},"updateTime":{"type":"integer","format":"int64","description":"Last update time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/historyOrders":{"get":{"tags":["Trade"],"summary":"Get history orders","description":"Query historical closed orders. Weight: 5.","operationId":"getHistoryOrders","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"name":"symbol","in":"query","description":"Futures symbol","schema":{"type":"string"}},{"name":"startTime","in":"query","description":"Start time in milliseconds","schema":{"type":"integer","format":"int64"}},{"name":"endTime","in":"query","description":"End time in milliseconds. Defaults to current time.","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"Number of results to return. Default 50, range 1-200.","schema":{"type":"integer","default":50,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Get fills

> Query trade fill records sorted by time in descending order. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Fill":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Fill ID"},"orderId":{"type":"integer","format":"int64","description":"Order ID"},"symbol":{"type":"string","description":"Futures symbol"},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"role":{"type":"string","description":"Fill role","enum":["TAKER","MAKER"]},"price":{"type":"string","description":"Fill price"},"size":{"type":"string","description":"Fill quantity"},"fee":{"type":"string","description":"Fee amount"},"feeCoin":{"type":"string","description":"Fee currency"},"feeType":{"type":"string","description":"Fee type. TRADING: trading fee, LIQUIDATION: liquidation fee.","enum":["TRADING","LIQUIDATION"]},"timestamp":{"type":"integer","format":"int64","description":"Fill time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/fills":{"get":{"tags":["Trade"],"summary":"Get fills","description":"Query trade fill records sorted by time in descending order. Weight: 5.","operationId":"getFills","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"name":"symbol","in":"query","required":true,"description":"Futures symbol","schema":{"type":"string"}},{"name":"startTime","in":"query","description":"Start time in milliseconds","schema":{"type":"integer","format":"int64"}},{"name":"endTime","in":"query","description":"End time in milliseconds","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 1-200.","schema":{"type":"integer","default":100,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"fills":{"type":"array","description":"Fills sorted by time in descending order","items":{"$ref":"#/components/schemas/Fill"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Get fills by order ID

> Query trade fill records for a specific order sorted by time in descending order. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Fill":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Fill ID"},"orderId":{"type":"integer","format":"int64","description":"Order ID"},"symbol":{"type":"string","description":"Futures symbol"},"side":{"type":"string","description":"Order side","enum":["BUY","SELL"]},"role":{"type":"string","description":"Fill role","enum":["TAKER","MAKER"]},"price":{"type":"string","description":"Fill price"},"size":{"type":"string","description":"Fill quantity"},"fee":{"type":"string","description":"Fee amount"},"feeCoin":{"type":"string","description":"Fee currency"},"feeType":{"type":"string","description":"Fee type. TRADING: trading fee, LIQUIDATION: liquidation fee.","enum":["TRADING","LIQUIDATION"]},"timestamp":{"type":"integer","format":"int64","description":"Fill time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/fillsByOrderId":{"get":{"tags":["Trade"],"summary":"Get fills by order ID","description":"Query trade fill records for a specific order sorted by time in descending order. Weight: 5.","operationId":"getFillsByOrderId","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"name":"symbol","in":"query","required":true,"description":"Futures symbol","schema":{"type":"string"}},{"name":"orderId","in":"query","required":true,"description":"Order ID","schema":{"type":"integer","format":"int64"}},{"name":"fromId","in":"query","description":"Starting fill ID","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 1-200.","schema":{"type":"integer","default":100,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"fills":{"type":"array","description":"Fills sorted by time in descending order","items":{"$ref":"#/components/schemas/Fill"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Cancel all orders

> Cancel all open orders for a specific symbol (async). Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/allOrders":{"delete":{"tags":["Trade"],"summary":"Cancel all orders","description":"Cancel all open orders for a specific symbol (async). Weight: 5.","operationId":"cancelAllOrders","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["symbol"],"properties":{"symbol":{"type":"string","description":"Futures symbol"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Get funding fee records

> Query funding fee payment records sorted by time in descending order. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Trade","description":"Futures order trading (private)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"PIONEX-KEY","description":"API Key authentication. Requires two headers:\n- `PIONEX-KEY`: Your API Key\n- `PIONEX-SIGNATURE`: HMAC SHA256 hex signature\n\nAnd a `timestamp` query parameter (milliseconds).\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current timestamp in milliseconds (valid range +/- 20 seconds)","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"FundingFeeRecord":{"type":"object","properties":{"symbol":{"type":"string","description":"Futures symbol"},"isolatedMode":{"type":"string","description":"Margin mode. CROSS for cross margin, ISOLATED for all isolated types.","enum":["CROSS","ISOLATED"]},"fundingFee":{"type":"string","description":"Funding fee amount"},"fundingCoin":{"type":"string","description":"Funding fee currency"},"timestamp":{"type":"integer","format":"int64","description":"Funding fee time in milliseconds"},"fundingRate":{"type":"string","description":"Funding rate used for calculation"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/uapi/v1/trade/fundingFee":{"get":{"tags":["Trade"],"summary":"Get funding fee records","description":"Query funding fee payment records sorted by time in descending order. Weight: 5.","operationId":"getFundingFees","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"name":"symbol","in":"query","description":"Futures symbol","schema":{"type":"string"}},{"name":"startTime","in":"query","description":"Start time in milliseconds","schema":{"type":"integer","format":"int64"}},{"name":"endTime","in":"query","description":"End time in milliseconds","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 1-200.","schema":{"type":"integer","default":100,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"fundings":{"type":"array","description":"Funding fee records sorted by time in descending order","items":{"$ref":"#/components/schemas/FundingFeeRecord"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pionex.com/docs/api-docs/futures-api/trade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
