外部结算接口

外部系统调额

post

1:当用户在一个平台内进行下单,平台会发送这个请求到外部系统。这个请求必须在3秒内回复,否则平台判定为超时而取消该项操作,同时也会发送 "取消外部系统划账调额" 到外部系统,以便外部系统保持数据的一致性。 2:特殊说明,调用 “取消外部系统调额”接口,如果发生异常或者没有收到正确响应,会重试指定次数后,中止后续操作。

Header parameters
tracestringRequired

全局链路标志

Example: {{mock_trace}}
companyIdintegerOptional

Company Id,用户所在国家

Example: 0
timestampnumberRequired

请求发起时间戳,精确到毫秒,13位

Example: 0
Body
thirdServerCodestringRequired

第三方系统客户唯一编号

userNamestring · max: 48Required

TradeBoss 用户身份唯一编号

currencystring · max: 16Required

账户货币code,标准ISO 3字元货币单位

bizTypeintegerRequired

业务类型,1-市价开;2-市价平;10-限价预埋单;11-停损预埋单;12-限价开

operationTypestringRequired

操作类型,OPEN_POSITION=开仓,NORMAL_CLOSE=正常平仓,ABNORMAL_OVERTRADING=异常穿仓,当为NORMAL_CLOSE,OPEN_POSITION时,amount只能为正数;当为ABNORMAL_OVERTRADING时,amount为负数,外部系统可自主决定是否继续扣除额度,来完结此交易,也可以忽略此请求。

amountstringRequired

金额,结合operationType使用

amountDigitsintegerRequired

金额小数位

orderIdinteger · longRequired

订单id

requestUniqueNostring · max: 48Required

请求唯一编号,多次请求需要保持业务幂等

requestTimeinteger · longRequired

请求发起时间戳,精确到毫秒,13位

ipstringRequired

用户ip

metadatastring · max: 200Optional

备注信息,json格式

Responses
200Success
application/json
post
/
POST /api/ HTTP/1.1
Host: prewppc-3.cmfbl.com
trace: text
timestamp: 1
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}
Deprecated

取消操作

post

当请求超时或者第三方系统返回错误信息,就会发出此请求,来取消对应操作。

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
usernamestring · max: 48Required

客户身份唯一编号

tx_reverse_idstring · max: 48Required

回退唯一交易编号,这个编号是对应之前请求时的 txid,与reverse_type配合使用,第三方系统需要检查这个tx_reverse_id是否有处理过,如果已经被正确处理过,则返回成功即可

reverse_typeintegerRequired

回退类型,1下单,2平仓

txidstring · max: 48Required

唯一交易编号,多次请求需要保持业务幂等

requesttimeinteger · longRequired

请求发起时间戳,精确到毫秒,13位

ipstringRequired

用户ip

cancel_remarkstring · max: 200Required

取消原因简述

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

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}

取消外部系统调额

post

当“外部系统调额”,请求超时或者外部系统返回错误信息,平台就会发出此请求到外部系统,以便外部系统保持数据的一致性。

Header parameters
tracestringRequired

全局链路标志

Example: {{mock_trace}}
companyIdintegerOptional

Company Id,用户所在国家

Example: 0
timestampnumberRequired

请求发起时间戳,精确到毫秒,13位

Example: 0
Body
thirdServerCodestringOptional

第三方系统客户唯一编号

userNamestring · max: 48Required

TradeBoss 用户身份唯一编号

currencystring · max: 16Required

账户货币code,标准ISO 3字元货币单位

bizTypeintegerRequired

业务类型,1-市价开;2-市价平;10-限价预埋单;11-停损预埋单;12-限价开

amountstringRequired

金额,只能为正数

amountDigitsintegerRequired

金额小数位

orderIdinteger · longOptional

订单id

requestUniqueNostring · max: 48Required

请求唯一编号,多次请求需要保持业务幂等

reverseRequestUniqueNostringRequired

这个编号是对应之前“外部系统调额”请求时的requestUniqueNo。外部系统需要检查这个编号是否有处理过,如果正确处理,则需要返还正确的额度给客户;如果接受到请求但没有正确处理需返回code=US_0000001,没有接收到此编号的请求,否则返回code=US_0000002

requestTimeinteger · longRequired

请求发起时间戳,精确到毫秒,13位

ipstringRequired

用户ip

cancelRemarkstring · max: 200Required

取消原因

metadatastring · max: 200Optional

备注信息,json格式

Responses
200Success
application/json
post
/get-user-amount
POST /api/get-user-amount HTTP/1.1
Host: prewppc-3.cmfbl.com
trace: text
timestamp: 1
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "tradeType": 81,
  "accountId": 15,
  "sortType": "desc",
  "sortFieldName": "orderTime",
  "accountCurrency": "USDT"
}
200Success
{
  "msgParams": "veniam sit",
  "msg": "anim nisi consectetur sit sed",
  "trace": "laboris",
  "tm": 62,
  "bizCode": "10",
  "data": {},
  "code": "100",
  "fail": false,
  "ok": true
}

Last updated