Trade/Leveraged

Place an order

post

Description: Contract margin trading order group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.addOrder

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 order; 12-Market by amount order; 13-Limit order

directioninteger · int32Required

1-Buy; 2-Sell;

symbolIdinteger · longRequired
requestTimeinteger · longRequired

13-digit timestamp

requestPricestringRequired

Needs to be multiplied by 10 to the power of 'product price decimal places' and passed as an integer. Only for order recording, not the actual transaction price.

requestNumstringRequired
remarkstringOptional
accountCurrencystringRequired
accountDigitsinteger · int32Required
operationTypeintegerRequired

Operation type. 1- Normal; 2- Automatic borrowing; 3- Automatic repayment

expireTypestringRequired

Required for pending orders, expiration type 1. Valid on the same day 2. Valid for the same week

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

{
  "tradeType": 1,
  "accountId": 1,
  "bizType": 1,
  "direction": 1,
  "symbolId": 1,
  "requestTime": 1,
  "requestPrice": "text",
  "requestNum": "text",
  "remark": "text",
  "accountCurrency": "text",
  "accountDigits": 1,
  "operationType": 1,
  "expireType": "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
}

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

Fill in 3 for this gameplay

accountIdinteger · longOptional
accountCurrencystringOptional
orderIdinteger · longRequired
positionIdinteger · longRequired
accountDigitsinteger · longRequired
stopLossstringRequired

Needs to be multiplied by 10 to the power of 'product quote decimal places', processed as an integer and passed in.

takeProfitstringRequired

Needs to be multiplied by 10 to the power of 'product quote decimal places', processed as an integer and passed in.

remarkstringRequired
Responses
200Success
application/json
post
/global/tradeapi.app.CrossLeverOrderApiService.updateOrder
POST /api/global/tradeapi.app.CrossLeverOrderApiService.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
}

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

executeTime-transaction time; direction-direction; symbolId-product id;

sortTypestringRequired

desc-Descending order; asc-Ascending order;

symbolIdinteger · longOptional
directioninteger · int32Optional

-1-all; 1-buy; 2-sell;

orderTypeinteger · int32Optional

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

executeStartTimeinteger · longOptional

13-digit timestamp

executeEndTimeinteger · longOptional

13-digit timestamp

currentinteger · int32Optional

Default 1

sizeinteger · int32Optional

Default 20

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

{
  "tradeType": 1,
  "accountIds": "text",
  "sortFieldName": "text",
  "sortType": "text",
  "symbolId": 1,
  "direction": 1,
  "orderType": 1,
  "executeStartTime": 1,
  "executeEndTime": 1,
  "current": 1,
  "size": 1
}
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
}

Get cross-currency repayment exchange rate

post

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

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

sourceCurrencystringRequired

Source currency

targetCurrencystringRequired

Target currency

customerCurrencystringRequired

Total asset currency

requestNumnumberRequired

Request Quantity

requestTimeintegerRequired

Order request time

remarkstringRequired

Remarks

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

{
  "tradeType": 1,
  "sourceCurrency": "text",
  "targetCurrency": "text",
  "customerCurrency": "text",
  "requestNum": 1,
  "requestTime": 1,
  "remark": "text"
}
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
}

Cross-currency repayment

post

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

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

sourceCurrencystringRequired

Source currency

targetCurrencystringRequired

Target currency

customerCurrencystringRequired

Total asset currency

requestNumnumberRequired

Request Quantity

requestTimeintegerRequired

Order request time

remarkstringRequired

Remarks

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

{
  "tradeType": 1,
  "sourceCurrency": "text",
  "targetCurrency": "text",
  "customerCurrency": "text",
  "requestNum": 1,
  "requestTime": 1,
  "remark": "text"
}
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
}

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
sizeinteger · longOptional
currentinteger · longOptional
businessTypeinteger · int32Optional

0-Unrestricted; 1-Deposit; 2-Withdrawal; 3-System reset; 4-Limit adjustment; 5-Freeze; 6-Transaction; 36-Transfer; 42-Reward;

statusinteger · int32Optional

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

startTimeinteger · longOptional

13-digit timestamp

endTimeinteger · longOptional

13-digit timestamp

operateinteger · int32Optional

0-Unrestricted; 1-Increase; 2-Decrease;

assetsIdinteger · longOptional
langstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.CrossLeverOrderApiService.queryCapitalFlowList
POST /api/global/tradeapi.app.CrossLeverOrderApiService.queryCapitalFlowList HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 143

{
  "tradeType": 1,
  "accountId": 1,
  "size": 1,
  "current": 1,
  "businessType": 1,
  "status": 1,
  "startTime": 1,
  "endTime": 1,
  "operate": 1,
  "assetsId": 1,
  "lang": "text"
}
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
}

Last updated