Trade/Stock
Explanation: Place stock trading orders group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.placeOrder
Should be filled in as 6 for this gameplay
1-Market buy; 2-Market sell; 5-Liquidation forced order; 8-Manual forced order; 12-Limit buy; 13-Limit sell;
1-Buy; 2-Sell;
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.
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"
}{
"bizCode": "text",
"code": "text",
"msg": "text",
"tm": 1,
"trace": "text",
"msgParams": "text",
"ok": true,
"fail": true,
"data": {
"orderId": 1
}
}Explanation: Cancel unexecuted orders
group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.cancelOrder
Should be filled in as 6 for this gameplay
14-User cancels pending order; 15-Backend cancels pending order; 16-Automatic liquidation cancels pending order;
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"
}{
"bizCode": "text",
"code": "text",
"msg": "text",
"tm": 1,
"trace": "text",
"msgParams": "text",
"ok": true,
"fail": true
}Note: Query order information
group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryOrderDetail
Should be filled in as 6 for this gameplay
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
}{
"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"
}
}Note: Paginate query entrustment order list
group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryOrderPage
Should be filled in as 6 for this gameplay
Separate multiple order IDs with commas
1-Buy; 2-Sell;
0-Submitted; 1-Partially filled; 2-All filled; 3-Cancelled; 4-Failed;
Default 1
Default 20
13-digit timestamp
13-digit timestamp
request_time-Entrust time; id-Order Id; symbol_id-Product Id; status-Status; create_time-Order creation time; (default request_time)
desc-Descending order; asc-Ascending order; (default desc)
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"
}{
"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"
}
]
}
}Explanation: Query the current customer entrustment list group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryPendingOrderList
Should be filled in as 6 for this gameplay
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
}{
"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"
}
]
}Explanation: Verify the result of this order
group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.checkOrder
Should be filled in as 6 for this gameplay
1-Market buy; 2-Market sell; 5-Liquidation forced order; 8-Manual forced order; 12-Limit buy; 13-Limit sell;
1-Buy; 2-Sell;
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.
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"
}{
"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"
}
}Explanation: Trial calculation can buy and sell shares group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.calculateOrder
Should be filled in as 6 for this gameplay
1-Buy; 2-Sell;
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
}{
"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"
}
}Note: Query deal list group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryDealPage
Should be filled in as 6 for this gameplay
1-Market buy; 2-Market sell; 5-Liquidation forced order; 8-Manual forced order; 12-Limit buy; 13-Limit sell;
1-Buy; 2-Sell;
Default 1
Default 20
13-digit timestamp
13-digit timestamp
execute_time-Deal time; id-Deal ID; symbol_id-Product ID; (default execute_time)
desc-Descending order; asc-Ascending order; (default desc)
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"
}{
"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
}
]
}
}Description: Query the list of position-related transaction orders
group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.getPositionDealDetailList
Should be filled in as 6 for this gameplay
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
}{
"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"
}
}Description: Query position details
group=tradeApi version=0.0.1 bizType=tradeapi.app.PositionApiService.queryPositionDetail
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled in as 6 for this gameplay
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
}{
"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"
}
}Description: Query position list
group=tradeApi version=0.0.1 bizType=tradeapi.app.PositionApiService.queryPositionPage
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled in as 6 for this gameplay
1-Position Holding; 3-Partial Closing;
13-digit timestamp
13-digit timestamp
orderId-Order Id; openTime-Execution Time; symbolId-Product Id; pnl-Profit and Loss;
asc-Ascending Order; desc-Descending Order; (default desc)
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"
}{
"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"
}
]
}Explanation: Pagination query account capital flow group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryCapitalFlowList
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled in as 6 for this gameplay
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;
0-Unrestricted; 1-Initialization; 2-Processing successful; 3-Processing failed;
13-digit timestamp
13-digit timestamp
0-Unrestricted; 1-Increase; 2-Decrease;
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"
}{
"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
}
]
}
}Explanation: Query account asset information
group=tradeApi version=0.0.1 bizType=tradeapi.app.AccountApiService.queryAccountAssetsInfo
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled in as 6 for this gameplay
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"
}{
"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