Contract order

Place an order

post

Description: Contract full position trading order group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.addMarketOrder Server Screenshot.png

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 1 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; 12-Limit price open

directioninteger · int32Required

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

symbolIdinteger · longRequired

Product ID, 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

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;

remarkstringOptional

Remarks

accountCurrencystringRequired

Account currency

accountDigitsinteger · int32Required

Account Decimal Places

crossLevelNuminteger · int32Optional

Leverage ratio, only valid for opening positions, there should only be one leverage ratio for the same product

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

{
  "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
}
200

Success

{
  "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
}

Last updated