Trade/Stock

Place an order

post

Explanation: Place stock trading orders group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.placeOrder

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

accountCurrencystringRequired
accountDigitsinteger · int32Required
bizTypeinteger · int32Required

1-Market buy; 2-Market sell; 5-Liquidation forced order; 8-Manual forced order; 12-Limit buy; 13-Limit sell;

directioninteger · int32Required

1-Buy; 2-Sell;

symbolIdinteger · longRequired
digitsinteger · int32Required
requestTimeinteger · longRequired
requestPriceinteger · longRequired

Needs to be processed as an integer according to the decimal places of the product quote. For limit order placement, use this field as the limit price.

requestNumstringRequired
remarkstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.StockOrderApiService.placeOrder
POST /api/global/tradeapi.app.StockOrderApiService.placeOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 177

{
  "tradeType": 1,
  "accountCurrency": "text",
  "accountDigits": 1,
  "bizType": 1,
  "direction": 1,
  "symbolId": 1,
  "digits": 1,
  "requestTime": 1,
  "requestPrice": 1,
  "requestNum": "text",
  "remark": "text"
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "orderId": 1
  }
}

Cancel order

post

Explanation: Cancel unexecuted orders

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

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

bizTypeinteger · int32Required

14-User cancels pending order; 15-Backend cancels pending order; 16-Automatic liquidation cancels pending order;

orderIdinteger · longRequired
remarkstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.StockOrderApiService.cancelOrder
POST /api/global/tradeapi.app.StockOrderApiService.cancelOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 55

{
  "tradeType": 1,
  "bizType": 1,
  "orderId": 1,
  "remark": "text"
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true
}

Order information

post

Note: Query order information

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

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

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

{
  "tradeType": 1,
  "orderId": 1
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "orderId": 1,
    "bizType": 1,
    "direction": 1,
    "status": 1,
    "symbolId": 1,
    "symbolName": "text",
    "symbolCode": "text",
    "requestNum": "text",
    "requestPrice": "text",
    "requestTime": 1,
    "executeNum": "text"
  }
}

Entrustment order list

post

Note: Paginate query entrustment order list

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

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

orderIdsstringOptional

Separate multiple order IDs with commas

symbolIdinteger · longOptional
directioninteger · longOptional

1-Buy; 2-Sell;

statusinteger · int32Optional

0-Submitted; 1-Partially filled; 2-All filled; 3-Cancelled; 4-Failed;

currentinteger · int32Optional

Default 1

sizeinteger · int32Required

Default 20

executeStartTimeinteger · longRequired

13-digit timestamp

executeEndTimeinteger · longRequired

13-digit timestamp

sortFieldNamestringRequired

request_time-Entrust time; id-Order Id; symbol_id-Product Id; status-Status; create_time-Order creation time; (default request_time)

sortTypestringRequired

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

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

{
  "tradeType": 1,
  "orderIds": "text",
  "symbolId": 1,
  "direction": 1,
  "status": 1,
  "current": 1,
  "size": 1,
  "executeStartTime": 1,
  "executeEndTime": 1,
  "sortFieldName": "text",
  "sortType": "text"
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "total": 1,
    "size": 1,
    "current": 1,
    "records": [
      {
        "orderId": 1,
        "bizType": 1,
        "direction": 1,
        "status": 1,
        "symbolId": 1,
        "symbolName": "text",
        "symbolCode": "text",
        "requestNum": "text",
        "requestPrice": "text",
        "requestTime": 1,
        "executeNum": "text"
      }
    ]
  }
}

Customer entrustment list

post

Explanation: Query the current customer entrustment list group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryPendingOrderList

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

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

{
  "tradeType": 1
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": [
    {
      "orderId": 1,
      "bizType": 1,
      "direction": 1,
      "status": 1,
      "symbolId": 1,
      "symbolName": "text",
      "symbolCode": "text",
      "requestNum": "text",
      "requestPrice": "text",
      "requestTime": 1,
      "executeNum": "text"
    }
  ]
}

Place an order verification

post

Explanation: Verify the result of this order

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

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

accountCurrencystringRequired
accountDigitsinteger · int32Required
bizTypeinteger · int32Required

1-Market buy; 2-Market sell; 5-Liquidation forced order; 8-Manual forced order; 12-Limit buy; 13-Limit sell;

directioninteger · int32Required

1-Buy; 2-Sell;

symbolIdinteger · longRequired
digitsinteger · int32Required
requestTimeinteger · longRequired
requestPriceinteger · longRequired

Needs to be processed as an integer according to the decimal places of the product quote. For limit order placement, use this field as the limit price.

requestNumstringRequired
remarkstringOptional
Responses
200Success
application/json
post
/global/tradeapi.app.StockOrderApiService.checkOrder
POST /api/global/tradeapi.app.StockOrderApiService.checkOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 177

{
  "tradeType": 1,
  "accountCurrency": "text",
  "accountDigits": 1,
  "bizType": 1,
  "direction": 1,
  "symbolId": 1,
  "digits": 1,
  "requestTime": 1,
  "requestPrice": 1,
  "requestNum": "text",
  "remark": "text"
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "direction": 1,
    "beforePositionNum": "text",
    "afterPositionNum": "text",
    "loanAmount": "text"
  }
}

Trading trial calculation

post

Explanation: Trial calculation can buy and sell shares group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.calculateOrder

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

accountCurrencystringRequired
accountDigitsinteger · int32Required
directioninteger · int32Required

1-Buy; 2-Sell;

symbolIdinteger · longRequired
digitsinteger · int32Required
Responses
200Success
application/json
post
/global/tradeapi.app.StockOrderApiService.calculateOrder
POST /api/global/tradeapi.app.StockOrderApiService.calculateOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 96

{
  "tradeType": 1,
  "accountCurrency": "text",
  "accountDigits": 1,
  "direction": 1,
  "symbolId": 1,
  "digits": 1
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "canClosePositionNum": "text",
    "canSellNum": "text",
    "canBuyNum": "text",
    "canLoanBuyNum": "text"
  }
}

Deal list

post

Note: Query deal list group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryDealPage

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

symbolIdinteger · longOptional
bizTypeinteger · int32Optional

1-Market buy; 2-Market sell; 5-Liquidation forced order; 8-Manual forced order; 12-Limit buy; 13-Limit sell;

directioninteger · int32Optional

1-Buy; 2-Sell;

currentinteger · int32Optional

Default 1

sizeinteger · int32Optional

Default 20

executeStartTimeinteger · longOptional

13-digit timestamp

executeEndTimeinteger · longOptional

13-digit timestamp

sortFieldNamestringOptional

execute_time-Deal time; id-Deal ID; symbol_id-Product ID; (default execute_time)

sortTypestringOptional

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

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

{
  "tradeType": 1,
  "symbolId": 1,
  "bizType": 1,
  "direction": 1,
  "current": 1,
  "size": 1,
  "executeStartTime": 1,
  "executeEndTime": 1,
  "sortFieldName": "text",
  "sortType": "text"
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "accountId": 1,
    "companyId": 1,
    "customerId": 1,
    "customerNo": "text",
    "current": 1,
    "size": 1,
    "totalPage": 1,
    "list": [
      {
        "dealId": 1,
        "orderId": 1,
        "bizType": 1,
        "direction": 1,
        "symbolId": 1,
        "symbolName": "text",
        "symbolCode": "text",
        "executeNum": "text",
        "executePrice": "text",
        "tradeAmount": "text",
        "commission": "text",
        "executeTime": 1
      }
    ]
  }
}

Position transaction list

post

Description: Query the list of position-related transaction orders

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

Body
tradeTypeinteger · longRequired

Should be filled in as 6 for this gameplay

positionIdinteger · longRequired
Responses
200Success
application/json
post
/global/tradeapi.app.StockOrderApiService.getPositionDealDetailList
POST /api/global/tradeapi.app.StockOrderApiService.getPositionDealDetailList HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 30

{
  "tradeType": 1,
  "positionId": 1
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "direction": 1,
    "executeTime": 1,
    "executePrice": "text",
    "executeNumber": "text",
    "executeAmount": "text"
  }
}

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 in as 6 for this gameplay

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

{
  "tradeType": 1,
  "accountId": 1,
  "positionId": 1
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "positionId": 1,
    "orderId": 1,
    "dealId": 1,
    "status": "text",
    "direction": 1,
    "symbolId": 1,
    "symbolName": "text",
    "openAccountDigits": 1,
    "openSymbolDigits": 1,
    "openContractSize": 1,
    "openPrice": "text",
    "openNum": "text",
    "closeAccountDigits": 1,
    "closeSymbolDigits": 1,
    "closePrice": "text",
    "closeFreeDigits": "text",
    "profit": "text",
    "openMargin": "text",
    "stopLoss": "text",
    "takeProfit": "text",
    "remark": "text",
    "margin": "text",
    "openTime": 1,
    "closeTime": 1,
    "openFee": "text",
    "closeFee": "text",
    "closeNum": "text",
    "openVolume": "text",
    "closeVolume": "text",
    "minVolume": "text",
    "stopLossDecimal": "text",
    "takeProfitDecimal": "text",
    "volume": "text",
    "marginSetType": "text"
  }
}

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 in as 6 for this gameplay

accountIdinteger · longOptional
statusinteger · int32Optional

1-Position Holding; 3-Partial Closing;

orderIdinteger · longOptional
dealIdinteger · longOptional
symbolIdinteger · longOptional
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)

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

{
  "tradeType": 1,
  "accountId": 1,
  "status": 1,
  "orderId": 1,
  "dealId": 1,
  "symbolId": 1,
  "startTime": 1,
  "endTime": 1,
  "sortFieldName": "text",
  "sortType": "text"
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": [
    {
      "positionId": 1,
      "orderId": 1,
      "dealId": 1,
      "status": "text",
      "direction": 1,
      "symbolId": 1,
      "symbolName": "text",
      "openAccountDigits": 1,
      "openSymbolDigits": 1,
      "openContractSize": 1,
      "openPrice": "text",
      "openNum": "text",
      "closeAccountDigits": 1,
      "closeSymbolDigits": 1,
      "closePrice": "text",
      "closeFreeDigits": "text",
      "profit": "text",
      "openMargin": "text",
      "stopLoss": "text",
      "takeProfit": "text",
      "remark": "text",
      "margin": "text",
      "openTime": 1,
      "closeTime": 1,
      "openFee": "text",
      "closeFee": "text",
      "closeNum": "text",
      "openVolume": "text",
      "closeVolume": "text",
      "minVolume": "text",
      "stopLossDecimal": "text",
      "takeProfitDecimal": "text",
      "volume": "text",
      "marginSetType": "text"
    }
  ]
}

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 in as 6 for this gameplay

accountIdinteger · longOptional
sizeinteger · longOptional
currentinteger · longOptional
businessTypeinteger · int32Optional

0-Unlimited; 601-Deposit; 602-Withdrawal; 603-Limit Adjustment; 604-Freeze; 605-Collateral; 606-Trade; 607-Borrow; 608-Repayment; 609-Transfer; 610-Interest Calculation; 611-Interest Settlement; 612-Reward; 613-System Clearing; 614-Company Action;

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.StockOrderApiService.queryCapitalFlowList
POST /api/global/tradeapi.app.StockOrderApiService.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
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "total": 1,
    "size": 1,
    "current": 1,
    "records": [
      {
        "remark": "text",
        "createTime": 1,
        "updateTime": 1,
        "subjectId": 1,
        "bookkeepId": 1,
        "amountIn": "text",
        "amountOut": "text",
        "status": 1,
        "amountAfter": "text",
        "businessType": 1,
        "businessType1": 1,
        "customerNo": "text",
        "digits": "text",
        "currency": "text",
        "businessTypeName": "text",
        "businessType1Name": "text",
        "accountId": 1
      }
    ]
  }
}

Asset information

post

Explanation: Query account asset information

group=tradeApi version=0.0.1 bizType=tradeapi.app.AccountApiService.queryAccountAssetsInfo

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 in as 6 for this gameplay

currencyCodestringRequired
Responses
200Success
application/json
post
/global/tradeapi.app.StockAccountApiService.queryAccountAssetsInfo
POST /api/global/tradeapi.app.StockAccountApiService.queryAccountAssetsInfo HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "tradeType": 1,
  "currencyCode": "text"
}
200Success
{
  "bizCode": "text",
  "code": "text",
  "msg": "text",
  "tm": 1,
  "trace": "text",
  "msgParams": "text",
  "ok": true,
  "fail": true,
  "data": {
    "companyId": 1,
    "tradeType": 1,
    "accountId": 1,
    "customerNo": "text",
    "customerId": 1,
    "digits": 1,
    "assetsId": 1,
    "currency": "text",
    "balance": "text",
    "lockAmount": "text",
    "positionMarketValue": "text",
    "positionBuyMarketValue": "text",
    "positionSellMarketValue": "text",
    "equity": "text",
    "pnl": "text",
    "liabilitiesPrincipal": "text",
    "margin": "text",
    "warningMargin": "text",
    "maintainMargin": "text",
    "maxDayPurchasePower": "text",
    "maxNightPurchasePower": "text",
    "withdrawAmount": "text",
    "residualLiquidity": "text",
    "riskLevel": 1,
    "crossLevel": "text"
  }
}

Last updated