Welcome to the new WEEX API documentation. Looking for the previous version?Switch to the legacy docs
WEEX
WEEX Futures REST API

Trade

Endpoint

Place Order (TRADE)

Place Order (TRADE).

POST
/capi/v3/order
https://api-contract.weex.com

Place Order (TRADE) › query Parameters

symbol
​string · required

Trading pair, for example BTCUSDT.

side
​string · required

Order side. Supported values: BUY, SELL.

positionSide
​string · required

Position side. Supported values: LONG, SHORT.

type
​string · required

Order type. Supported values: LIMIT, MARKET.

quantity
​string · required

Order quantity. Must be greater than 0.

newClientOrderId
​string · required

Client order identifier (1-36 characters, pattern ^[\.A-Z:/a-z0-9_-]{1,36}$).

timeInForce
​string

Time-in-force policy. Required when type = LIMIT. Supported values: GTC, IOC, FOK, POST_ONLY.

price
​string

Limit price. Required when type = LIMIT.

tpTriggerPrice
​string

Optional take-profit trigger price.

slTriggerPrice
​string

Optional stop-loss trigger price.

TpWorkingType
​string

Take-profit trigger price source. Supported values: CONTRACT_PRICE, MARK_PRICE. Default CONTRACT_PRICE.

SlWorkingType
​string

Stop-loss trigger price source. Supported values: CONTRACT_PRICE, MARK_PRICE. Default CONTRACT_PRICE.

reduceOnly
​boolean

Whether the order is reduce-only.

Place Order (TRADE) › Responses

200

Successful response

orderId
​string

Order ID assigned by the system.

clientOrderId
​string

Echo of newClientOrderId.

success
​boolean

Whether the order request was accepted.

errorCode
​string

Error code when success = false; otherwise empty.

errorMessage
​string

Error message when success = false; otherwise empty.


Place Orders Batch (TRADE)

Place Orders Batch (TRADE).

POST
/capi/v3/batchOrders
https://api-contract.weex.com

Place Orders Batch (TRADE) › query Parameters

batchOrders
​array · required

Up to 5 orders per request. Each element uses the same fields as Place Order (TRADE).

Place Orders Batch (TRADE) › Responses

200

Successful response

​object[]
orderId
​string

Order ID assigned by the system.

clientOrderId
​string

Echo of newClientOrderId.

success
​boolean

Whether the order request was accepted.

errorCode
​string

Error code when success = false; otherwise empty.

errorMessage
​string

Error message when success = false; otherwise empty.


Cancel Order (TRADE)

Cancel Order (TRADE).

DELETE
/capi/v3/order
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight1

Cancel Order (TRADE) › query Parameters

orderId
​integer

Target order ID. Required when origClientOrderId is not provided.

origClientOrderId
​string

Client order ID, 1-36 characters. Required when orderId is not provided.

Cancel Order (TRADE) › Responses

200

Successful response

orderId
​string

Cancelled order ID.

origClientOrderId
​string

Client order ID (if provided).

success
​boolean

Whether the cancel request succeeded.

errorCode
​string

Error code when success = false.

errorMessage
​string

Error description when success = false.


Cancel Orders Batch (TRADE)

Cancel Orders Batch (TRADE).

DELETE
/capi/v3/batchOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight5

Cancel Orders Batch (TRADE) › query Parameters

orderIdList
​integer

Up to 10 order IDs to cancel. Required when origClientOrderIdList is empty.

origClientOrderIdList
​array

Up to 10 client order IDs. Each must match ^[\.A-Z:/a-z0-9_-]{1,36}$. Required when orderIdList is empty.

Cancel Orders Batch (TRADE) › Responses

200

Successful response

​object[]
orderId
​string

Cancelled order ID.

origClientOrderId
​string

Client order ID (if provided).

success
​boolean

Whether the cancel request succeeded.

errorCode
​string

Error code when success = false.

errorMessage
​string

Error description when success = false.


Cancel All Open Orders (TRADE)

Cancel All Open Orders (TRADE).

DELETE
/capi/v3/allOpenOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight5

Cancel All Open Orders (TRADE) › query Parameters

symbol
​string

Trading pair to filter. Omit to cancel all open orders across symbols.

Cancel All Open Orders (TRADE) › Responses

200

Successful response

​object[]
orderId
​integer

ID of the cancelled order.

success
​boolean

Whether this order was successfully cancelled.

errorCode
​string

Error code when success = false.

errorMessage
​string

Error message when success = false.


Close Positions (TRADE)

Close Positions (TRADE).

POST
/capi/v3/closePositions
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight40

Close Positions (TRADE) › query Parameters

symbol
​string

Trading pair to close.

positionId
​integer

Position ID.

Close Positions (TRADE) › Responses

200

Successful response

​object[]
positionId
​integer

Position identifier.

success
​boolean

Whether the close action succeeded.

successOrderId
​integer

Order ID created to close the position (when successful).

errorMessage
​string

Failure reason when success = false.


Place Conditional Order (TRADE)

Place Conditional Order (TRADE).

POST
/capi/v3/algoOrder
https://api-contract.weex.com

Place Conditional Order (TRADE) › query Parameters

symbol
​string · required

Trading pair, e.g. BTCUSDT.

side
​string · required

Order side. Values: BUY, SELL.

positionSide
​string · required

Position side. Values: LONG, SHORT.

type
​string · required

Conditional order type. Values: STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_MARKET.

quantity
​string · required

Order quantity. Must be > 0.

clientAlgoId
​string · required

Client-defined identifier (1-36 characters, pattern ^[\.A-Z:/a-z0-9_-]{1,36}$).

price
​string

Execution price. Required when type is STOP or TAKE_PROFIT.

triggerPrice
​string

Trigger price. Required when type is STOP, TAKE_PROFIT, STOP_MARKET, or TAKE_PROFIT_MARKET.

presetTakeProfitPrice
​string

Optional take-profit trigger price.

presetStopLossPrice
​string

Optional stop-loss trigger price.

TpWorkingType
​string

Take-profit trigger type: CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE.

SlWorkingType
​string

Stop-loss trigger type: CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE.

activatePrice
​string

Trailing stop activation price. Only valid when type = TRAILING_MARKET. If omitted, the current market price is used based on workingType.

callbackRate
​string

Trailing stop callback rate. Required when type = TRAILING_MARKET. Range: [0.001, 0.9999].

workingType
​string

Price type used for trailing activation and callback. Values: CONTRACT_PRICE, MARK_PRICE. Default CONTRACT_PRICE.

reduceOnly
​boolean

Whether the order is reduce-only.

Place Conditional Order (TRADE) › Responses

200

Successful response

orderId
​string

Order ID assigned by the system.

clientOrderId
​string

Echo of newClientOrderId.

success
​boolean

Whether the order request was accepted.

errorCode
​string

Error code when success = false; otherwise empty.

errorMessage
​string

Error message when success = false; otherwise empty.


Cancel Conditional Order (TRADE)

Cancel Conditional Order (TRADE).

DELETE
/capi/v3/algoOrder
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight1

Cancel Conditional Order (TRADE) › query Parameters

orderId
​integer · required

Conditional order ID to cancel.

Cancel Conditional Order (TRADE) › Responses

200

Successful response

orderId
​string

Cancelled order ID.

origClientOrderId
​string

Client order ID (if provided).

success
​boolean

Whether the cancel request succeeded.

errorCode
​string

Error code when success = false.

errorMessage
​string

Error description when success = false.


Cancel All Conditional Orders (TRADE)

Cancel All Conditional Orders (TRADE).

DELETE
/capi/v3/algoOpenOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight5

Cancel All Conditional Orders (TRADE) › query Parameters

symbol
​string

Trading pair filter. Omit to cancel all conditional orders.

Cancel All Conditional Orders (TRADE) › Responses

200

Successful response

​object[]
orderId
​integer

Conditional order ID.

success
​boolean

Whether the cancel succeeded.

errorCode
​string

Error code when success = false.

errorMessage
​string

Error description when success = false.


Place TP/SL Conditional Orders (TRADE)

Place TP/SL Conditional Orders (TRADE).

POST
/capi/v3/placeTpSlOrder
https://api-contract.weex.com

Place TP/SL Conditional Orders (TRADE) › query Parameters

symbol
​string · required

Trading pair.

clientAlgoId
​string · required

Client-defined identifier (1-36 characters, pattern ^[\.A-Z:/a-z0-9_-]{1,36}$).

planType
​string · required

Plan type. Values: TAKE_PROFIT, STOP_LOSS.

triggerPrice
​string · required

Trigger price (> 0).

positionSide
​string · required

Position side (LONG, SHORT).

executePrice
​string

Execution price. Set to 0 or omit for market execution. Copy-trading API keys only support market close, so this field must be 0 or omitted.

quantity
​string

Quantity to execute. Set to 0 or omit to set TP/SL for the full position. Copy-trading API keys must close the full position, so this field must be 0 or omitted.

triggerPriceType
​string

Trigger source. CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE.

reduceOnly
​boolean

Whether the order is reduce-only.

Place TP/SL Conditional Orders (TRADE) › Responses

200

Successful response

​object[]
success
​boolean

Whether the plan order was accepted.

orderId
​integer

Plan order ID when successful.

errorCode
​string

Error code when success = false.

errorMessage
​string

Error description when success = false.


Modify TP/SL Conditional Order (TRADE)

Modify TP/SL Conditional Order (TRADE).

POST
/capi/v3/modifyTpSlOrder
https://api-contract.weex.com

Modify TP/SL Conditional Order (TRADE) › query Parameters

orderId
​integer · required

Conditional order ID to modify.

triggerPrice
​string · required

New trigger price (> 0).

executePrice
​string

New execution price. Set to 0 or omit to switch to market execution. Copy-trading API keys only support market close, so this field must be 0 or omitted.

triggerPriceType
​string

Trigger price source. CONTRACT_PRICE or MARK_PRICE. Default CONTRACT_PRICE.

Modify TP/SL Conditional Order (TRADE) › Responses

200

Successful response

success
​boolean

Whether the modification was accepted.


Get Order Info (USER_DATA)

Get Order Info (USER_DATA).

GET
/capi/v3/order
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight2

Get Order Info (USER_DATA) › query Parameters

orderId
​integer · required

Order ID to query.

Get Order Info (USER_DATA) › Responses

200

Successful response

avgPrice
​string

Average fill price.

clientOrderId
​string

Client-defined order ID.

cumQuote
​string

Cumulative filled amount in the quote asset.

executedQty
​string

Filled quantity in the base asset.

orderId
​integer

System order ID.

origQty
​string

Original order quantity.

price
​string

Order price.

reduceOnly
​boolean

Whether the order can only reduce positions.

side
​string

Order side. See Order Side for possible values.

positionSide
​string

Position side. See Position Mode.

status
​string

Order status. See Order Status.

stopPrice
​string

Stop price / trigger price (if applicable).

symbol
​string

Trading pair.

time
​integer

Order creation time (ms).

timeInForce
​string

Time-in-force policy. See Time in Force.

type
​string

Order type. See Order Type.

updateTime
​integer

Last update time (ms).

workingType
​string

Trigger price type. See Trigger Price Type.


Get Current Orders (USER_DATA)

Get Current Orders (USER_DATA).

GET
/capi/v3/openOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight2

Get Current Orders (USER_DATA) › query Parameters

symbol
​string

Filter by trading pair.

orderId
​string

Only return orders with ID greater than the specified value.

startTime
​integer

Filter orders created after this timestamp (ms).

endTime
​integer

Filter orders created before this timestamp (ms).

limit
​integer

Page size, 1-100. Default 100.

page
​integer

Page index starting from 0. Default 0.

Get Current Orders (USER_DATA) › Responses

200

Successful response

​object[]
avgPrice
​string

Average fill price.

clientOrderId
​string

Client-defined order ID.

cumQuote
​string

Cumulative filled amount in the quote asset.

executedQty
​string

Filled quantity in the base asset.

orderId
​integer

System order ID.

origQty
​string

Original order quantity.

price
​string

Order price.

reduceOnly
​boolean

Whether the order can only reduce positions.

side
​string

Order side. See Order Side for possible values.

positionSide
​string

Position side. See Position Mode.

status
​string

Order status. See Order Status.

stopPrice
​string

Stop price / trigger price (if applicable).

symbol
​string

Trading pair.

time
​integer

Order creation time (ms).

timeInForce
​string

Time-in-force policy. See Time in Force.

type
​string

Order type. See Order Type.

updateTime
​integer

Last update time (ms).

workingType
​string

Trigger price type. See Trigger Price Type.

priceProtect
​boolean
priceMatch
​string
selfTradePreventionMode
​string
goodTillDate
​integer

Get Current Trailing Orders (USER_DATA)

Get Current Trailing Orders (USER_DATA).

GET
/capi/v3/trailing/openOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight2

Get Current Trailing Orders (USER_DATA) › query Parameters

symbol
​string

Filter by trading pair.

orderId
​string

Only return orders with ID greater than the specified value.

startTime
​integer

Filter orders created after this timestamp (ms).

endTime
​integer

Filter orders created before this timestamp (ms).

limit
​integer

Page size, 1-100. Default 100.

page
​integer

Page index starting from 0. Default 0.

Get Current Trailing Orders (USER_DATA) › Responses

200

Successful response

​object[]
avgPrice
​string

Average fill price.

clientOrderId
​string

Client-defined order ID.

cumQuote
​string

Cumulative filled amount in the quote asset.

executedQty
​string

Filled quantity in the base asset.

orderId
​integer

System order ID.

origQty
​string

Original order quantity.

price
​string

Order price.

reduceOnly
​boolean

Whether the order can only reduce positions.

side
​string

Order side. See Order Side for possible values.

positionSide
​string

Position side. See Position Mode.

status
​string

Order status. See Order Status.

stopPrice
​string

Stop price / trigger price (if applicable).

symbol
​string

Trading pair.

time
​integer

Order creation time (ms).

timeInForce
​string

Time-in-force policy. See Time in Force.

type
​string

Order type. See Order Type.

updateTime
​integer

Last update time (ms).

workingType
​string

Trigger price type. See Trigger Price Type.

activatePrice
​string

Activation price. This field is returned when available.

callbackRate
​string

Callback rate percentage. This field is returned when available.


Get Order History (USER_DATA)

Get Order History (USER_DATA).

GET
/capi/v3/order/history
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight10

Get Order History (USER_DATA) › query Parameters

symbol
​string

Filter by trading pair.

limit
​integer

Number of records per page, 1-100. Default 100.

startTime
​integer

Start time (ms). Must be less than or equal to endTime.

endTime
​integer

End time (ms). Must be within 90 days of startTime.

page
​integer

Page index starting from 0. Default 0.

Get Order History (USER_DATA) › Responses

200

Successful response

​object[]
orderId
​integer

System order ID.

symbol
​string

Trading pair.

side
​string

Order side. See Order Side for possible values.

positionSide
​string

Position side. See Position Mode.

status
​string

Order status. See Order Status.

type
​string

Order type. See Order Type.

time
​integer

Order creation time (ms).

price
​string

Order price.

origQty
​string

Original order quantity.

executedQty
​string

Filled quantity in the base asset.

avgPrice
​string

Average fill price.

updateTime
​integer

Last update time (ms).

clientOrderId
​string

Client-defined order ID.

cumQuote
​string

Cumulative filled amount in the quote asset.

timeInForce
​string

Time-in-force policy. See Time in Force.

reduceOnly
​boolean

Whether the order can only reduce positions.

stopPrice
​string

Stop price / trigger price (if applicable).

workingType
​string

Trigger price type. See Trigger Price Type.


Get Trailing Order History (USER_DATA)

Get Trailing Order History (USER_DATA).

GET
/capi/v3/trailing/historyOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight10

Get Trailing Order History (USER_DATA) › query Parameters

symbol
​string

Filter by trading pair.

limit
​integer

Number of records per page, 1-1000. Default 500.

startTime
​integer

Start time (ms). Must be less than or equal to endTime.

endTime
​integer

End time (ms). Must be within 90 days of startTime.

page
​integer

Page index starting from 0. Default 0.

Get Trailing Order History (USER_DATA) › Responses

200

Successful response

​object[]
avgPrice
​string

Average fill price.

clientOrderId
​string

Client-defined order ID.

cumQuote
​string

Cumulative filled amount in the quote asset.

executedQty
​string

Filled quantity in the base asset.

orderId
​integer

System order ID.

origQty
​string

Original order quantity.

price
​string

Order price.

reduceOnly
​boolean

Whether the order can only reduce positions.

side
​string

Order side. See Order Side for possible values.

positionSide
​string

Position side. See Position Mode.

status
​string

Order status. See Order Status.

stopPrice
​string

Stop price / trigger price (if applicable).

symbol
​string

Trading pair.

time
​integer

Order creation time (ms).

timeInForce
​string

Time-in-force policy. See Time in Force.

type
​string

Order type. See Order Type.

updateTime
​integer

Last update time (ms).

workingType
​string

Trigger price type. See Trigger Price Type.

activatePrice
​string

Activation price. This field is returned when available.

callbackRate
​string

Callback rate percentage. This field is returned when available.


Get Trade Details (USER_DATA)

Get Trade Details (USER_DATA).

GET
/capi/v3/userTrades
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight5

Get Trade Details (USER_DATA) › query Parameters

symbol
​string

Trading pair filter.

orderId
​integer

Only return trades associated with this order.

startTime
​integer

Start time (ms).

endTime
​integer

End time (ms). Must be ≥ startTime.

limit
​integer

Number of records (1-100). Default 100.

Get Trade Details (USER_DATA) › Responses

200

Successful response

​object[]
id
​integer

Trade ID.

orderId
​integer

Associated order ID.

symbol
​string

Trading pair.

buyer
​boolean

Whether the user was the buyer.

commission
​string

Commission amount.

commissionAsset
​string

Asset used to pay commission.

maker
​boolean

true if maker, false if taker.

price
​string

Trade price.

qty
​string

Filled quantity (base asset).

quoteQty
​string

Filled amount (quote asset).

realizedPnl
​string

Realised PnL for this fill.

side
​string

Order side, BUY or SELL.

positionSide
​string

Position side, LONG or SHORT.

time
​integer

Trade time (ms).


Get Current Conditional Orders (USER_DATA)

Get Current Conditional Orders (USER_DATA).

GET
/capi/v3/openAlgoOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight3

Get Current Conditional Orders (USER_DATA) › query Parameters

symbol
​string

Trading pair filter.

startTime
​integer

Start time (ms).

endTime
​integer

End time (ms). Must be ≥ startTime.

page
​integer

Page number starting from 1. Default 1.

limit
​integer

Page size, 1-100. Default 100.

Get Current Conditional Orders (USER_DATA) › Responses

200

Successful response

​object[]
algoId
​integer

Conditional order ID.

clientAlgoId
​string

Client-defined ID.

algoType
​string

Conditional order category. Currently only CONDITIONAL is returned.

orderType
​string

Triggered order type. Values: STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET.

symbol
​string

Trading pair.

side
​string

Order side. Values: BUY, SELL.

positionSide
​string

Position side. Values: LONG, SHORT.

timeInForce
​string

Time-in-force for the triggered order. Values: GTC, IOC, FOK, POST_ONLY.

quantity
​string

Requested quantity.

algoStatus
​string

Conditional order status. Values: NEW, PENDING, UNTRIGGERED, FILLED, CANCELED, CANCELING.

actualOrderId
​integer | null

ID of the triggered active order (if any).

actualPrice
​string

Execution price (if triggered).

triggerPrice
​string

Trigger price.

price
​string

Execution price configured for the triggered order.

tpTriggerPrice
​string

Linked take-profit trigger price (if configured).

tpPrice
​string

Linked take-profit execution price (if configured).

slTriggerPrice
​string

Linked stop-loss trigger price (if configured).

slPrice
​string

Linked stop-loss execution price (if configured).

tpOrderType
​string

Take-profit trigger price source. Values: CONTRACT_PRICE, MARK_PRICE.

workingType
​string

Trigger price source. Values: CONTRACT_PRICE, MARK_PRICE.

closePosition
​boolean

Whether the triggered order will close the entire position.

reduceOnly
​boolean

Whether the triggered order is reduce-only.

createTime
​integer

Creation time (ms).

updateTime
​integer

Last update time (ms).

triggerTime
​integer

Trigger time (ms). Returns 0 if the order has not been triggered.


Get Conditional Order History (USER_DATA)

Get Conditional Order History (USER_DATA).

GET
/capi/v3/allAlgoOrders
https://api-contract.weex.com
Request weight
This endpoint consumes IP-based request weight. Heavier endpoints consume more of your IP rate-limit capacity.
Learn more in the Access Restrictions section.
IP weight5

Get Conditional Order History (USER_DATA) › query Parameters

symbol
​string

Trading pair filter.

startTime
​integer

Start time (ms).

endTime
​integer

End time (ms). Must be within 90 days of startTime.

limit
​integer

Page size, 1-1000. Default 500.

Get Conditional Order History (USER_DATA) › Responses

200

Successful response

​object[]

Current page of conditional orders. Each element follows the schema described in Get Current Conditional Orders.

hasMore
​boolean

true if more data is available.