Trade/Isolated Margin Contract

Place an order

post

Explanation: Contract isolated trading order

group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.addMarketOrder

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Game ID, should be filled with 2 for this game

accountIdinteger · longOptional

Account ID, optional. If filled, trading will be conducted with this account

bizTypeinteger · int32Required

Business type, 1-market price open; 2-market price close; 10-limit price pending order; 11-stop loss pending order; 13-aggregate limit price open order; 14-aggregate limit price close order

directioninteger · int32Required

Order buy/sell direction, 1-Buy; 2-Sell;

symbolIdinteger · longRequired

Product ID

positionIdinteger · longOptional

Position ID, required when placing a closing order

requestTimeinteger · longRequired

Order request time, 13-digit timestamp

requestPricestringRequired

Price at the time of order placement, needs to be multiplied by 10 to the power of 'product price decimal places', converted to an integer for input. Only for order recording, not the actual transaction price.

requestNumstringRequired

Order quantity or order amount, used in conjunction with entryType

stopLossstringOptional

Stop loss unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.

takeProfitstringOptional

Take profit unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.

expireTypeinteger · int32Optional

Expiration type, only valid for pending orders. 1-Valid for the day; 2-Valid for the week; 3-30 days; 4-90 days; Default 2

remarkstringOptional

Remarks

accountCurrencystringRequired

Account currency

accountDigitsinteger · int32Required

Account Decimal Places

crossLevelNuminteger · int32Optional

Leverage ratio, this parameter needs to be consistent for the product. If not consistent, the order will not be successful

entryTypeintegerRequired

Order type 1 by quantity, 2 by amount

blacklistbooleanOptional

Blacklist customer orders (default false)

sourcestringOptional

H5: mobile web; PC_Web: pcweb; System: system; Android: Android native app; iOS: Apple native app; HOS: Hongmeng OS; PC_Win: pcwindows client; PC_Mac: pcmac client; default is the same as login source. (limited to 255 characters, enumeration is for reference only,Only letters, numbers, and underscores can be used)

thirdPartyOrderstringOptional

(limited to 255 characters,Only letters, numbers, and underscores can be used)

slippagestringOptional

Only market orders are valid. It can be a percentage (only supports 2 decimal places, rounding off any excess) or a floating-point type that only supports 4 decimal places, rounding off any excess). Other formats are not supported.

Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.addMarketOrder
POST /api/global/tradeapi.app.OrderApiService.addMarketOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 361

{
  "tradeType": 1,
  "accountId": 1,
  "bizType": 1,
  "direction": 1,
  "symbolId": 1,
  "positionId": 1,
  "requestTime": 1,
  "requestPrice": "text",
  "requestNum": "text",
  "stopLoss": "text",
  "takeProfit": "text",
  "expireType": 1,
  "remark": "text",
  "accountCurrency": "text",
  "accountDigits": 1,
  "crossLevelNum": 1,
  "entryType": 1,
  "blacklist": true,
  "source": "text",
  "thirdPartyOrder": "text",
  "slippage": "text"
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-dqxq8-qu20y7y-dq58lhn-39i483-1677570581",
  "code": "0",
  "data": {
    "tradeVolume": "0.1",
    "symbolId": 720,
    "orderId": 14460002,
    "fee": "-0.0668",
    "openOrClose": 1,
    "openPrice": "22.25",
    "takeProfit": "0",
    "positionId": 2023022819810,
    "interest": "0",
    "openDirection": 1,
    "stopLoss": "0",
    "executePrice": "22.25",
    "digits": 2,
    "symbolName": "BINAN_SOL_USDT",
    "profit": "0",
    "direction": 1
  },
  "bizCode": "",
  "tm": 162,
  "msgParams": null,
  "ok": true
}

Pending Order List

post

group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryPBOOrderPage

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional

Optional. If filled, trading will be conducted with this account

accountCurrencystringOptional
sortFieldNamestringOptional

Sort Field Name orderTime(openTime,orderId),symbolId,symbolCode

sortTypestringOptional

Sort Type desc Descending; asc Ascending

querySourcestringRequired

Query Source

thirdPartyOrderstringRequired

Third Party Order

Responses
200Success
application/json
post
/global/tradeapi.app.CfdWBWOrderApiService.queryPBOOrderPage
POST /api/global/tradeapi.app.CfdWBWOrderApiService.queryPBOOrderPage HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 146

{
  "tradeType": 59,
  "accountCurrency": "aliqua fugiat laboris",
  "accountId": 85,
  "sortType": "eu ut enim Ut consequat",
  "sortFieldName": "Shao Ke County De"
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-dqxq8-qu20y7y-dq58lhn-39i483-1677570581",
  "code": "0",
  "data": {
    "tradeVolume": "0.1",
    "symbolId": 720,
    "orderId": 14460002,
    "fee": "-0.0668",
    "openOrClose": 1,
    "openPrice": "22.25",
    "takeProfit": "0",
    "positionId": 2023022819810,
    "interest": "0",
    "openDirection": 1,
    "stopLoss": "0",
    "executePrice": "22.25",
    "digits": 2,
    "symbolName": "BINAN_SOL_USDT",
    "profit": "0",
    "direction": 1
  },
  "bizCode": "",
  "tm": 162,
  "msgParams": null,
  "ok": true
}

Set position stop loss and take profit

post

Explanation: Set position stop loss and take profit group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.updateOrder

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional

Account ID, must fill in either account currency

accountCurrencystringOptional

Account currency, must fill in either account ID

orderIdinteger · longRequired

Order ID

positionIdinteger · longRequired

Position ID

accountDigitsinteger · longRequired

Account Decimal Places

stopLossstringOptional

Stop loss unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.

takeProfitstringOptional

Take profit unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.

remarkstringOptional

Remarks

Responses
200Success
application/json
post
/global/tradeapi.app.CfdWBWOrderApiService.updateOrder
POST /api/global/tradeapi.app.CfdWBWOrderApiService.updateOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 153

{
  "tradeType": 1,
  "accountId": 1,
  "accountCurrency": "text",
  "orderId": 1,
  "positionId": 1,
  "accountDigits": 1,
  "stopLoss": "text",
  "takeProfit": "text",
  "remark": "text"
}
200Success
{
  "msg": "Account balance is 0",
  "fail": true,
  "trace": "x-0ei175a-x4dh9u2-1g8s95r-m2708212-1677570735",
  "code": "E000031",
  "data": "tradeapi.app.OrderApiService.updateOrder",
  "bizCode": "CFD",
  "tm": 7,
  "msgParams": null,
  "ok": false
}

Order details

post

Explanation: View order details group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryOrderDetail

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional
accountCurrencystringOptional
orderIdinteger · longRequired
Responses
200Success
application/json
post
/global/tradeapi.app.CfdWBWOrderApiService.queryOrderDetail
POST /api/global/tradeapi.app.CfdWBWOrderApiService.queryOrderDetail HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "tradeType": 1,
  "accountId": 1,
  "accountCurrency": "text",
  "orderId": 1
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "orderId": 1,
    "busiiType": 1,
    "direction": 1,
    "status": 1,
    "userGroupId": 1,
    "accountId": 1,
    "symbolId": 1,
    "digits": 1,
    "contractSize": 1,
    "requestPrice": "text",
    "requestNum": "text",
    "requestTime": 1,
    "executeMarginRate": 1,
    "executeMarginRateDigits": 1,
    "spread": 1,
    "pointRatio": 1,
    "executePrice": "text",
    "executeRate": 1,
    "rateDigits": 1,
    "fee": "text",
    "feeDigits": 1,
    "executeTime": 1,
    "createTime": 1,
    "updateTime": 1,
    "positionId": 1,
    "stopLoss": "text",
    "takeProfit": "text",
    "remark": "text",
    "source": "text",
    "thirdPartyOrder": "text"
  }
}

Order list

post

Explanation: View order list

group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryOrderPage

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Game ID, should be filled with 2 for this game

accountIdinteger · longOptional

Account ID

accountCurrencystringOptional

Account currency

bizTypeinteger · int32Optional

Business type, 1-market price open; 2-market price close; 3-stop loss close order; 4-stop profit close order; 5-forced liquidation order; 6-expiration close order; 7-account closure order; 8-manual forced liquidation order; 9-delayed order; 10-limit price pending order; 11-stop loss pending order; 13-matching limit price open order; 14-matching limit price close order

directioninteger · int32Optional

Order buy/sell direction, 1-Buy; 2-Sell;

statusinteger · longOptional

Order status, 1-Order received; 2-Order executed; 3-Partial order executed; 4-Order canceled; 5-Partial order canceled; 6-Order rejected; 7-Order expired;

symbolIdinteger · int32Optional

Product ID

orderIdsstringOptional

Order ID string, multiple order IDs separated by commas

positionIdinteger · longOptional

Position ID

sizeinteger · longOptional

Number of items per page, default 20

currentintegerOptional

Current page number

querySourcestringOptional

H5: mobile web; PC_Web: pcweb; System: system; Android: Android native app; iOS: Apple native app; HOS: Hongmeng OS; PC_Win: pcwindows client; PC_Mac: pcmac client; default is the same as login source. (The enumeration is for reference only)

thirdPartyOrderstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.queryOrderPage
POST /api/global/tradeapi.app.OrderApiService.queryOrderPage HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 204

{
  "tradeType": 1,
  "accountId": 1,
  "accountCurrency": "text",
  "bizType": 1,
  "direction": 1,
  "status": 1,
  "symbolId": 1,
  "orderIds": "text",
  "positionId": 1,
  "size": 1,
  "current": 1,
  "querySource": "text",
  "thirdPartyOrder": "text"
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-11w38izu-238ws9-maphaym-1f261yz-1677573205",
  "code": "0",
  "data": [],
  "bizCode": "",
  "tm": 7,
  "msgParams": null,
  "ok": true
}

Closing record

post

Explanation: Query historical closing records

group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryHistoryCloseOrderList

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional
accountCurrencystringOptional
sortFieldNamestringRequired

pnl-Profit; openTime-Opening time; closeTime-Closing time; orderId-Order ID; symbolId-Product ID;

sortTypestringRequired

desc-Descending order; asc-Ascending order;

symbolIdinteger · longOptional
openStartTimeinteger · longOptional

13-digit timestamp

openEndTimeinteger · longOptional

13-digit timestamp

closeStartTimeinteger · longOptional

13-digit timestamp

closeEndTimeinteger · longOptional

13-digit timestamp

currentinteger · int32Optional

Default 1

sizeinteger · int32Optional

Default 20

querySourcestringOptional

H5: mobile web; PC_Web: pcweb; System: system; Android: Android native app; iOS: Apple native app; HOS: Hongmeng OS; PC_Win: pcwindows client; PC_Mac: pcmac client; default is the same as login source. (The enumeration is for reference only)

thirdPartyOrderstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.CfdWBWOrderApiService.queryHistoryCloseOrderList
POST /api/global/tradeapi.app.CfdWBWOrderApiService.queryHistoryCloseOrderList HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 245

{
  "tradeType": 1,
  "accountId": 1,
  "accountCurrency": "text",
  "sortFieldName": "text",
  "sortType": "text",
  "symbolId": 1,
  "openStartTime": 1,
  "openEndTime": 1,
  "closeStartTime": 1,
  "closeEndTime": 1,
  "current": 1,
  "size": 1,
  "querySource": "text",
  "thirdPartyOrder": "text"
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-77q3ivej-u4wi1d3a-5pbl5v-ypwj0-1677573497",
  "code": "0",
  "data": {
    "accountId": null,
    "trace": "x-77q3ivej-u4wi1d3a-5pbl5v-ypwj0-1677573497",
    "companyId": 360,
    "current": 1,
    "size": 20,
    "totalPage": 0,
    "ip": "47.242.92.158",
    "customerId": 1176,
    "list": [],
    "lang": "en-US",
    "totalPnl": 0,
    "customerNo": "86001175"
  },
  "bizCode": "",
  "tm": 6,
  "msgParams": null,
  "ok": true
}

Transaction records

post

Explanation: Query transaction record list

group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryTradeRecordPage

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · int32Required

Should be filled with 2 for this game

accountIdsstringOptional

Multiple separated by commas

sortFieldNamestringRequired

Sorting field names, executeTime-transaction time; direction-direction; symbolId-product id;

sortTypestringRequired

Sorting type, desc-descending order; asc-ascending order;

symbolIdinteger · longOptional

Product ID

directioninteger · int32Optional

Buy/sell direction, -1-all; 1-buy; 2-sell;

orderTypeinteger · int32Optional

Order type, -1-all; 1-open; 2-close; 3-market price; 4-limit price;

executeStartTimeinteger · longOptional

Transaction start time, 13-digit timestamp

executeEndTimeinteger · longOptional

Transaction end time, 13-digit timestamp

currentinteger · int32Optional

Page number, default 1

sizeinteger · int32Optional

Number of data per page, default 20

querySourcestringOptional

H5: mobile web; PC_Web: pcweb; System: system; Android: Android native app; iOS: Apple native app; HOS: Hongmeng OS; PC_Win: pcwindows client; PC_Mac: pcmac client; default is the same as login source. (The enumeration is for reference only)

thirdPartyOrderstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.queryTradeRecordPage
POST /api/global/tradeapi.app.OrderApiService.queryTradeRecordPage HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 224

{
  "tradeType": 1,
  "accountIds": "text",
  "sortFieldName": "text",
  "sortType": "text",
  "symbolId": 1,
  "direction": 1,
  "orderType": 1,
  "executeStartTime": 1,
  "executeEndTime": 1,
  "current": 1,
  "size": 1,
  "querySource": "text",
  "thirdPartyOrder": "text"
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-w864w4d-7143je-n2w23-0124-1677573722",
  "code": "0",
  "data": {
    "accountId": null,
    "current": 1,
    "trace": "x-w864w4d-7143je-n2w23-0124-1677573722",
    "companyId": 360,
    "size": 20,
    "totalPage": 0,
    "ip": "47.242.92.158",
    "customerId": 1176,
    "bizTypeText": {
      "1": "Market Open",
      "2": "Pre-set Limit Open",
      "3": "Pre-set Stop Loss Open",
      "4": "Market Close",
      "5": "Stop profit Close",
      "6": "Stop Loss Close",
      "7": "System Close",
      "8": "Expiry Close",
      "9": "Limit Open"
    },
    "list": [],
    "lang": "en-US",
    "customerNo": "86001175"
  },
  "bizCode": "",
  "tm": 7,
  "msgParams": null,
  "ok": true
}

Set position leverage multiplier

post
group=tradeApi
version=0.0.1
bizType=tradeapi.app.PositionApiService.updateCrossLevelNum
Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

symbolIdinteger · longRequired

Product ID

requestTimeinteger · int32Required

Leverage ratio

Responses
200Success
application/json
post
/global/tradeapi.app.PositionApiService.updateCrossLevelNum
POST /api/global/tradeapi.app.PositionApiService.updateCrossLevelNum HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 44

{
  "tradeType": 1,
  "symbolId": 1,
  "requestTime": 1
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-6s8tc-2v65-i8270878-1727-1677574098",
  "code": "0",
  "data": {
    "crossLevelNum": 11
  },
  "bizCode": "",
  "tm": 17,
  "msgParams": null,
  "ok": true
}

Modify position margin

post

Note: Contract - full position gameplay, set the leverage multiple of customers on products, affecting all positions of the product group=tradeApi version=0.0.1 bizType=tradeapi.app.PositionApiService.updateOccupyTheMargin

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longRequired

Account ID

accountCurrencystringOptional

Account currency

positionIdintegerOptional

Position ID

accountDigitsstringRequired

Account Decimal Places

occupyTheMarginstringRequired

Modify the amount of margin occupied, can be negative

orderIdintegerRequired

Order ID

remarkstringRequired

Remarks

Responses
200Success
application/json
post
/global/tradeapi.app.PositionApiService.updateOccupyTheMargin
POST /api/global/tradeapi.app.PositionApiService.updateOccupyTheMargin HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 145

{
  "tradeType": 1,
  "accountId": 1,
  "accountCurrency": "text",
  "positionId": 1,
  "accountDigits": "text",
  "occupyTheMargin": "text",
  "orderId": 1,
  "remark": "text"
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-6s8tc-2v65-i8270878-1727-1677574098",
  "code": "0",
  "data": {
    "crossLevelNum": 11
  },
  "bizCode": "",
  "tm": 17,
  "msgParams": null,
  "ok": true
}

Order Trial Calculation

post

Explanation: Calculate margin and commission for placing orders group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.calculateMarketOrder

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional

Optional. If filled, trading will be conducted with this account

bizTypeinteger · int32Required

Business type, 1-market price open; 2-market price close; 10-limit price pending order; 11-stop loss pending order; 13-aggregate limit price open order; 14-aggregate limit price close order

directioninteger · int32Required

1-Buy; 2-Sell;

symbolIdinteger · longRequired
positionIdinteger · longOptional

Required when placing a closing order

requestTimeinteger · longRequired

13-digit timestamp

requestPricestringRequired

For order record only, not the actual transaction price*

requestNumstringRequired
expireTypeinteger · int32Optional

Only valid for pending orders. 1-Valid for the day; 2-Valid for the week;

remarkstringOptional
accountCurrencystringRequired
accountDigitsinteger · int32Required
crossLevelNuminteger · int32Optional

Only valid for opening positions, only one leverage ratio should be set for the same product

stopLossnumber · doubleOptional

Stop loss unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.

takeProfitnumber · doubleOptional

Take profit unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.

Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.calculateMarketOrder
POST /api/global/tradeapi.app.OrderApiService.calculateMarketOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 261

{
  "tradeType": 1,
  "accountId": 1,
  "bizType": 1,
  "direction": 1,
  "symbolId": 1,
  "positionId": 1,
  "requestTime": 1,
  "requestPrice": "text",
  "requestNum": "text",
  "expireType": 1,
  "remark": "text",
  "accountCurrency": "text",
  "accountDigits": 1,
  "crossLevelNum": 1,
  "stopLoss": 1,
  "takeProfit": 1
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-7rf727-m64d8ar-72dn4ij-23o3vt-1677574738",
  "code": "0",
  "data": {
    "margin": "10000.6584",
    "calculatePrice": "136.719",
    "fee": "0.0000"
  },
  "bizCode": "",
  "tm": 31,
  "msgParams": null,
  "ok": true
}

Calculate Liquidation Price

post

Explanation: Calculate Liquidation Price

group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.calculationBurstPrice

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional

Optional

positionIdinteger · longRequired
adjustMarginnumber · doubleRequired

Positive number to increase margin amount; negative number to decrease margin amount

Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.calculationBurstPrice
POST /api/global/tradeapi.app.OrderApiService.calculationBurstPrice HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 61

{
  "tradeType": 1,
  "accountId": 1,
  "positionId": 1,
  "adjustMargin": 1
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-7rf727-m64d8ar-72dn4ij-23o3vt-1677574738",
  "code": "0",
  "data": {
    "evaluateClosePrice": "136.719"
  },
  "bizCode": "",
  "tm": 31,
  "msgParams": null,
  "ok": true
}

Position Details

post

Description: Query position details

group=tradeApi version=0.0.1 bizType=tradeapi.app.PositionApiService.queryPositionDetail

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional
accountCurrencystringOptional
positionIdinteger · longRequired
Responses
200Success
application/json
post
/global/tradeapi.app.PositionApiService.queryPositionDetail
POST /api/global/tradeapi.app.PositionApiService.queryPositionDetail HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 69

{
  "tradeType": 1,
  "accountId": 1,
  "accountCurrency": "text",
  "positionId": 1
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-11wdkt-kg9i-ld2y-53mz854-1677571927",
  "code": "0",
  "data": {
    "symbolId": 720,
    "orderId": 14460003,
    "dealId": 94870543,
    "canReduceMargin": "0.0000",
    "openPrice": "22.18",
    "remark": null,
    "takeProfitDecimal": "0.00",
    "closeNum": 0,
    "closeFee": "0.0000",
    "takeProfit": "0",
    "occupyTheMargin": "0.0000",
    "interest": "0.0000",
    "maintenanceMargin": "0.0000",
    "closeVolume": 0,
    "openVolume": 0.1,
    "closeTime": 0,
    "closeAccountDigits": 4,
    "symbolName": "BINAN_SOL_USDT",
    "openTime": 1677571033093,
    "profit": null,
    "tradeType": 1,
    "direction": 1,
    "singleMargin": null,
    "margin": null,
    "openContractSize": 1,
    "resp": null,
    "openMargin": "0.2209",
    "openNum": 0.1,
    "openFee": "0.0665",
    "closeSymbolDigits": 2,
    "warningMargin": "0.0000",
    "stopLossDecimal": "0.00",
    "adjustCrossLevel": "1-100",
    "openSymbolDigits": 2,
    "volume": 0.1,
    "accountId": 1031767,
    "companyId": 360,
    "positionId": 2023022819827,
    "closeFreeDigits": null,
    "stopLoss": "0",
    "minVolume": null,
    "marginSetType": "2",
    "crossLevelNum": 10,
    "openAccountDigits": 4,
    "closePrice": "0.0000",
    "status": "1"
  },
  "bizCode": "C",
  "tm": 27,
  "msgParams": null,
  "ok": true
}

Position List

post

Description: Query position list

group=tradeApi version=0.0.1 bizType=tradeapi.app.PositionApiService.queryPositionPage

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional

Account ID

accountCurrencystringOptional

Account currency

statusinteger · int32Optional

1-Position Holding; 3-Partial Closing;

orderIdinteger · longOptional

Order ID

dealIdinteger · longOptional

Deal ID

symbolIdinteger · longOptional

Product ID

startTimeinteger · longOptional

13-digit timestamp

endTimeinteger · longOptional

13-digit timestamp

sortFieldNamestringOptional

orderId-Order Id; openTime-Execution Time; symbolId-Product Id; pnl-Profit and Loss;

sortTypestringOptional

asc-Ascending Order; desc-Descending Order; (default desc)

sizeinteger · longOptional

Default 20

currentinteger · longOptional

Default 1

querySourcestringOptional

H5: mobile web; PC_Web: pcweb; System: system; Android: Android native app; iOS: Apple native app; HOS: Hongmeng OS; PC_Win: pcwindows client; PC_Mac: pcmac client; default is the same as login source. (The enumeration is for reference only)

thirdPartyOrderstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.PositionApiService.queryPositionPage
POST /api/global/tradeapi.app.PositionApiService.queryPositionPage HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 235

{
  "tradeType": 1,
  "accountId": 1,
  "accountCurrency": "text",
  "status": 1,
  "orderId": 1,
  "dealId": 1,
  "symbolId": 1,
  "startTime": 1,
  "endTime": 1,
  "sortFieldName": "text",
  "sortType": "text",
  "size": 1,
  "current": 1,
  "querySource": "text",
  "thirdPartyOrder": "text"
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-6d6k11o7-00ve031-d863o8-4hk417e-1677572056",
  "code": "0",
  "data": [
    {
      "symbolId": 967,
      "orderId": 24153319,
      "dealId": 13394059,
      "canReduceMargin": "0.0000",
      "openPrice": "7.05",
      "remark": null,
      "takeProfitDecimal": "0.00",
      "closeNum": 0,
      "closeFee": "0.0000",
      "takeProfit": "0",
      "occupyTheMargin": "0.0000",
      "interest": "0.0000",
      "maintenanceMargin": "0.0000",
      "closeVolume": 0,
      "openVolume": 1,
      "closeTime": 0,
      "closeAccountDigits": 4,
      "symbolName": "AXS/USDT_PRD",
      "openTime": 1672023552024,
      "profit": null,
      "tradeType": 1,
      "direction": 1,
      "singleMargin": null,
      "margin": null,
      "openContractSize": 1,
      "resp": null,
      "openMargin": "0.3480",
      "openNum": 1,
      "openFee": "0.3525",
      "closeSymbolDigits": 2,
      "warningMargin": "0.0000",
      "stopLossDecimal": "0.00",
      "adjustCrossLevel": "1-100",
      "openSymbolDigits": 2,
      "volume": 1,
      "accountId": 1031767,
      "companyId": 360,
      "positionId": 2022122620993,
      "closeFreeDigits": null,
      "stopLoss": "0",
      "minVolume": null,
      "marginSetType": "2",
      "crossLevelNum": 20,
      "openAccountDigits": 4,
      "closePrice": "0.0000",
      "status": "1"
    }
  ],
  "bizCode": "C",
  "tm": 21,
  "msgParams": null,
  "ok": true
}

Fund Flow

post

Explanation: Pagination query account capital flow group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryCapitalFlowList

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Should be filled with 2 for this game

accountIdinteger · longOptional

Account ID

sizeinteger · longOptional

Number of data entries per page

currentinteger · longOptional

Current Page

businessTypeinteger · int32Optional

Business type, 0-unrestricted; 1-deposit; 2-withdrawal; 3-system reset; 4-credit adjustment; 5-freeze; 6-transaction; 36-transfer; 42-reward;

statusinteger · int32Optional

Status, 0-Unrestricted; 1-Initialization; 2-Processing successful; 3-Processing failed;

startTimeinteger · longOptional

Start time, 13-digit timestamp

endTimeinteger · longOptional

End time, 13-digit timestamp

operateinteger · int32Optional

Capital flow direction, 0-Unrestricted; 1-Increase; 2-Decrease;

Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.queryCapitalFlowList
POST /api/global/tradeapi.app.OrderApiService.queryCapitalFlowList HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 116

{
  "tradeType": 1,
  "accountId": 1,
  "size": 1,
  "current": 1,
  "businessType": 1,
  "status": 1,
  "startTime": 1,
  "endTime": 1,
  "operate": 1
}
200Success
{
  "msg": "Success",
  "fail": false,
  "trace": "x-n72ql-snasw1-ts561r-31e7q-1677572540",
  "code": "0",
  "data": {
    "total": 40,
    "current": 1,
    "size": 20,
    "records": [
      {
        "amount": "-0.0665",
        "businessType1": 6001,
        "amountAfter": "109849175.3769",
        "businessType1Name": "Open position fee",
        "updateTime": 1677571033166,
        "remark": null,
        "version": 0,
        "subjectId": 1504110734228991000,
        "accountId": 1031767,
        "createTime": 1677571033151,
        "businessTypeName": "transaction",
        "createdBy": null,
        "updateBy": null,
        "bookkeepId": 2023022819827,
        "currency": "USDT",
        "digits": 4,
        "amountIn": "0.0000",
        "amountOut": "0.0665",
        "id": 238603703,
        "businessType": 6,
        "customerNo": "86001175",
        "status": 2
      }
    ]
  },
  "bizCode": "A",
  "tm": 13,
  "msgParams": null,
  "ok": true
}

Cancel limit order(For aggregation mode only)

post

Explanation: Cancel limit order(For aggregation mode only) group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.closeTradePboOrder

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Game ID, should be filled with 2 for this game

orderIdinteger · int32Required

Order ID

Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.closeTradePboOrder
POST /api/global/tradeapi.app.OrderApiService.closeTradePboOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 27

{
  "tradeType": 1,
  "orderId": 1
}
200Success
{
  "msg": "ut",
  "ok": false,
  "msgParams": "aute",
  "trace": "deserunt commodo cillum",
  "bizCode": "34",
  "code": "60",
  "fail": true,
  "tm": 67,
  "data": {}
}

Check Order Status

post

Description: Check Order Status

group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.checkOrderStatus

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

Game ID, should be filled with 2 for this game

orderIdinteger · longRequired

Order ID

operatorTypeinteger · min: 1 · max: 2Required

1=Adjust leverage ratio, 2=Adjust margin, 3=Order execution status

Responses
200Success
application/json
post
/global/tradeapi.app.OrderApiService.checkOrderStatus
POST /api/global/tradeapi.app.OrderApiService.checkOrderStatus HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 44

{
  "tradeType": 1,
  "orderId": 1,
  "operatorType": 1
}
200Success
{
  "msg": "ut",
  "ok": false,
  "msgParams": "aute",
  "trace": "deserunt commodo cillum",
  "bizCode": "34",
  "code": "60",
  "fail": true,
  "tm": 67,
  "data": {}
}

Last updated