交易接口/股票交易

下单

post

说明:股票交易下单

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.placeOrder
Body
tradeTypeinteger · longRequired

本玩法下应填6

accountCurrencystringRequired
accountDigitsinteger · int32Required
bizTypeinteger · int32Required

1-市价买入;2-市价卖出;5-爆仓强平单;8-手动强平单;12-限价买入;13-限价卖出;

directioninteger · int32Required

1-买;2-卖;

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

需按产品报价小数位处理为整形。限价类下单,已该字段为限价

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

撤单

post

说明:撤销未成交单

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.cancelOrder
Body
tradeTypeinteger · longRequired

本玩法下应填6

bizTypeinteger · int32Required

14-用户取消挂单;15-后台取消挂单;16-爆仓自动取消挂单;

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
}

委托单信息

post

说明:查询委托单信息

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.queryOrderDetail
Body
tradeTypeinteger · longRequired

本玩法下应填6

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

委托单列表

post

说明:分页查询委托单列表

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.queryOrderPage
Body
tradeTypeinteger · longRequired

本玩法下应填6

orderIdsstringOptional

多个订单ID间以,分割

symbolIdinteger · longOptional
directioninteger · longOptional

1-买;2-卖;

statusinteger · int32Optional

0-已提交;1-部分成交;2-全部成交;3-已撤单;4-失败;

currentinteger · int32Optional

默认1

sizeinteger · int32Required

默认20

executeStartTimeinteger · longRequired

13位时间戳

executeEndTimeinteger · longRequired

13位时间戳

sortFieldNamestringRequired

request_time-委托时间;id-订单Id;symbol_id-产品Id;status-状态;create_time-订单创建时间;(默认request_time)

sortTypestringRequired

desc-降序; asc-升序;(默认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"
      }
    ]
  }
}

产品当前委托单列表

post

说明:分页查询委托单列表

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.queryOrderPage
Body
tradeTypeinteger · longRequired

本玩法下应填6

symbolIdinteger · longOptional
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: 28

{
  "tradeType": 1,
  "symbolId": 1
}
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"
      }
    ]
  }
}

下单校验

post

说明:校验本次下单结果

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.checkOrder
Body
tradeTypeinteger · longRequired

本玩法下应填6

accountCurrencystringRequired
accountDigitsinteger · int32Required
bizTypeinteger · int32Required

1-市价买入;2-市价卖出;5-爆仓强平单;8-手动强平单;12-限价买入;13-限价卖出;

directioninteger · int32Required

1-买;2-卖;

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

需按产品报价小数位处理为整形。限价类下单,已该字段为限价

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

交易试算

post

说明:试算可买卖股数

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.calculateOrder
Body
tradeTypeinteger · longRequired

本玩法下应填6

accountCurrencystringRequired
accountDigitsinteger · int32Required
directioninteger · int32Required

1-买;2-卖;

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

成交单列表

post

说明:查询成交单列表

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.queryDealPage
Body
tradeTypeinteger · longRequired

本玩法下应填6

symbolIdinteger · longOptional
bizTypeinteger · int32Optional

1-市价买入;2-市价卖出;5-爆仓强平单;8-手动强平单;12-限价买入;13-限价卖出;

directioninteger · int32Optional

1-买;2-卖;

currentinteger · int32Optional

默认1

sizeinteger · int32Optional

默认20

executeStartTimeinteger · longOptional

13位时间戳

executeEndTimeinteger · longOptional

13位时间戳

sortFieldNamestringOptional

execute_time-成交时间;id-成交单Id;symbol_id-产品Id;(默认execute_time)

sortTypestringOptional

desc-降序; asc-升序;(默认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
      }
    ]
  }
}

仓位成交列表

post

说明:查询仓位关联成交单列表

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.getPositionDealDetailList
Body
tradeTypeinteger · longRequired

本玩法下应填6

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

持仓详情

post

说明:查询持仓详情

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

本玩法下应填6

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

持仓列表

post

说明:查询持仓列表

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

本玩法下应填6

accountIdinteger · longOptional
statusinteger · int32Optional

1-持仓中;3-部分平仓;

orderIdinteger · longOptional
dealIdinteger · longOptional
symbolIdinteger · longOptional
startTimeinteger · longOptional

13位时间戳

endTimeinteger · longOptional

13位时间戳

sortFieldNamestringOptional

orderId-订单Id;openTime-执行时间;symbolId-产品Id;pnl-盈亏;

sortTypestringOptional

asc-升序;desc-降序;(默认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"
    }
  ]
}

资金流水

post

说明:分页查询账户资金流水

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

本玩法下应填6

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

0-不限制;601-存款;602-取款;603-额度调整;604-冻结;605-担保品;606-交易;607-借款;608-还款;609-划转;610-利息计算;611-利息结算;612-奖励;613-系统清零;614-公司行动;

statusinteger · int32Optional

0-不限制;1-初始化;2-处理成功;3-处理失败;

startTimeinteger · longOptional

13位时间戳

endTimeinteger · longOptional

13位时间戳

operateinteger · int32Optional

0-不限制;1-增加;2-减少;

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
      }
    ]
  }
}

资产信息

post

说明:查询账户资产信息

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

本玩法下应填6

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