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

Demo Mode

Endpoint

Get Account Balance Demo (USER_DATA)

Get Account Balance Demo (USER_DATA).

GET
/capi/v3/sim/balance
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 Account Balance Demo (USER_DATA) › Responses

200

Successful response

​object[]
asset
​string

Asset name

balance
​string

Total balance

availableBalance
​string

Available balance

frozen
​string

Frozen amount

unrealizePnl
​string

Unrealized Profit and Loss


Place Order Demo (TRADE)

Place Order Demo (TRADE).

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

Place Order Demo (TRADE) › query Parameters

symbol
​string · required

Trading pair, for example BTCSUSDT.

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.

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.

Place Order Demo (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.


Get All Positions Demo (USER_DATA)

Get All Positions Demo (USER_DATA).

GET
/capi/v3/sim/position/allPosition
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 All Positions Demo (USER_DATA) › Responses

200

Successful response

​object[]
id
​integer

Position ID

asset
​string

Associated collateral asset

symbol
​string

Trading pair

side
​string

Position direction such as LONG or SHORT

marginType
​string

Margin mode of current position CROSSED: Cross ModeISOLATED: Isolated Mode

separatedMode
​string

Current position's separated mode COMBINED: Combined mode SEPARATED: Separated mode

separatedOpenOrderId
​integer

Opening order ID of separated position

leverage
​string

Position leverage

size
​string

Current position size

openValue
​string

Initial value at position opening

openFee
​string

Opening fee

fundingFee
​string

Funding fee

marginSize
​string

Margin amount (margin coin)

isolatedMargin
​string

Isolated margin

isAutoAppendIsolatedMargin
​boolean

Whether the auto-adding of funds for the isolated margin is enabled (only for isolated mode)

cumOpenSize
​string

Accumulated opened positions

cumOpenValue
​string

Accumulated value of opened positions

cumOpenFee
​string

Accumulated fees paid for opened positions

cumCloseSize
​string

Accumulated closed positions

cumCloseValue
​string

Accumulated value of closed positions

cumCloseFee
​string

Accumulated fees paid for closing positions

cumFundingFee
​string

Accumulated settled funding fees

cumLiquidateFee
​string

Accumulated liquidation fees

createdMatchSequenceId
​integer

Matching engine sequence ID at creation

updatedMatchSequenceId
​integer

Matching engine sequence ID at last update

createdTime
​integer

Creation time Unix millisecond timestamp

updatedTime
​integer

Update time Unix millisecond timestamp

unrealizePnl
​string

Unrealized PnL

liquidatePrice
​string

Estimated liquidation price If the value = 0, it means the position is at low risk and there is no liquidation price at this time


Get Order History Demo (USER_DATA)

Get Order History Demo (USER_DATA).

GET
/capi/v3/sim/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 Demo (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 Order History Demo (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.