母子账户接口
创建子账户
获取您的母账户生成一个虚拟子账户
请求示例
POST /api/v3/sub-account/virtualSubAccount?subAccount=subAccount1¬e=1×tamp={{timestamp}}&signature={{signature}}
返回示例
{
"subAccount":"subAccount1",
"note":"1"
}
HTTP请求
- POST
/api/v3/sub-account/virtualSubAccount
接口权限要求: 账户读 / SPOT_ACCOUNT_R
权重(IP): 1
请求参数
参数名 | 数据类型 | 是否必需 | 说明 |
---|---|---|---|
subAccount | string | 是 | 子账户名称(8-32个字母加数字)如:subAccount1 |
note | string | 是 | 备注 如:1 |
recvWindow | long | 否 | |
timestamp | long | 是 |
返回参数
参数名 | 数据类型 | 说明 |
---|---|---|
subAccount | string | 子账户名称(8-32个字母加数字)如:subAccount1 |
note | string | 备注 如:1 |
查看子账户列表
获取您的母账户下所有子账户信息
请求示例
GET /api/v3/sub-account/list?timestamp={{timestamp}}&signature={{signature}}
返回示例
{
"subAccounts":[
{
"subAccount":"subAccount1",
"isFreeze":false,//是否冻结
"createTime":1544433328000,
"uid": "49910511"
},
{
"subAccount":"subAccount2",
"isFreeze":false,
"createTime":1544433328000,
"uid": "91921059"
}
]
}
HTTP请求
- GET
/api/v3/sub-account/list
接口权限要求: 账户读 / SPOT_ACCOUNT_R
权重(IP): 1
请求参数
名称 | 类型 | 是否必需 | 说明 |
---|---|---|---|
subAccount | string | 否 | 子账户名称 如:subAccount1 |
isFreeze | string | 否 | true or false |
page | int | 否 | 默认: 1 |
limit | int | 否 | 默认: 10, 最大: 200 |
timestamp | long | 是 | |
recvWindow | long | 否 |
返回参数
参数名 | 数据类型 | 说明 |
---|---|---|
subAccount | string | 子账户名称 |
isFreeze | string | 是否冻结 |
createTime | long | 创建时间 |
uid | string | 子账户uid |
创建子账户的APIkey
为子账户创建APIkey
请求示例
POST /api/v3/sub-account/apiKey
body
[
{
"subAccount":"subAccount1",
"permissions":"SPOT_ACCOUNT_READ",
"ip":"135.181.193",
"note":"1"
}
]
返回示例
{
"subAccount": "subAccount1",
"note": "1",
"apiKey": "arg13sdfgs",
"secretKey": "nkjwn21973ihi",
"permissions": "SPOT_ACCOUNT_READ",
"ip": "135.181.193",
"creatTime": 1597026383085
}
HTTP请求
- POST
/api/v3/sub-account/apiKey
接口权限要求: 账户读 / SPOT_ACCOUNT_R
权重(IP): 1
请求参数
参数名 | 类型 | 是否必须 | 说明 |
---|---|---|---|
subAccount | string | 是 | 子账户名称 如:subAccount1 |
note | string | 是 | APIKey的备注 |
permissions | string | 是 | APIKey权限: 账户读/SPOT_ACCOUNT_READ, 账户写/SPOT_ACCOUNT_WRITE, 现货交易信息读/SPOT_DEAL_READ, 现货交易信息写/SPOT_DEAL_WRITE, 合约账户信息读/CONTRACT_ACCOUNT_READ, 合约账户信息写/CONTRACT_ACCOUNT_WRITE, 合约交易信息读/CONTRACT_DEAL_READ, 合约交易信息写/CONTRACT_DEAL_WRITE, 资金划转读/SPOT_TRANSFER_READ, 资金划转写/SPOT_TRANSFER_WRITE |
ip | string | 否 | 绑定ip地址,多个ip用半角逗号隔开,最多支持20个ip。 如:135.181.193 |
recvWindow | long | 否 | |
timestamp | long | 是 |
返回参数
参数名 | 类型 | 说明 |
---|---|---|
subAccount | string | 子账户名称 |
note | string | APIKey的备注 |
apiKey | string | API公钥 |
secretKey | string | API的私钥 |
permissions | string | APIKey权限 |
ip | string | APIKey绑定的ip地址 |
creatTime | long | 创建时间 |
查询子账户的APIKey
获取指定子账户的APIkey信息
请求示例
GET/api/v3/sub-account/apiKey?subAccount=subAccount1×tamp=1597026383085
返回示例
{
"subAccount":[
{
"note":"v5",
"apiKey":"arg13sdfgs",
"permissions":"SPOT_ACCOUNT_READ,SPOT_ACCOUNT_WRITE",
"ip":"135.181.193",
"creatTime":1597026383085
},
{
"note":"v5.1",
"apiKey":"arg13sdfgs",
"permissions":"read_only",
"ip":"135.181.193",
"creatTime":1597026383085
}
]
}
HTTP请求
- GET
/api/v3/sub-account/apiKey
接口权限要求: 账户读 / SPOT_ACCOUNT_R
权重(IP): 1
请求参数
参数名 | 类型 | 是否必须 | 说明 |
---|---|---|---|
subAccount | string | 是 | 子账户名称 如:subAccount1 |
recvWindow | long | 否 | |
timestamp | long | 是 |
返回参数
参数名 | 类型 | 说明 |
---|---|---|
note | string | APIKey的备注 |
apiKey | string | API公钥 |
permissions | string | APIKey权限 |
ip | string | APIKey绑定的ip地址 |
creatTime | long | 创建时间 |
删除子账户的APIKey
请求示例
DELETE /api/v3/sub-account/apiKey
body
[
{
"subAccount":"subAccount1",
"apiKey":"ghytfugy2168hjksaj"
}
]
返回示例
{
"subAccount":"subAccount1"
}
HTTP请求
- DELETE
/api/v3/sub-account/apiKey
接口权限要求: 账户读 / SPOT_ACCOUNT_R
权重(IP): 1
请求参数
参数名 | 类型 | 是否必须 | 说明 |
---|---|---|---|
subAccount | string | 是 | 子账户名称 如:subAccount1 |
apiKey | string | 是 | API的公钥 如:ghytfugy2168hjksaj |
recvWindow | long | 否 | |
timestamp | long | 是 |
返回参数
参数名 | 类型 | 说明 |
---|---|---|
subAccount | string | 子账户名称 |
母子用户万向划转
请求示例
post /api/v3/capital/sub-account/universalTransfer
返回示例
[
{
"tranId":11945860693
}
]
HTTP请求
- POST
/api/v3/capital/sub-account/universalTransfer
接口权限要求: 资金划转写 / SPOT_TRANSFER_W
权重(IP): 1
请求参数
参数名 | 数据类型 | 是否必须 | 说明 |
---|---|---|---|
fromAccount | string | 否 | 母子账户,可填subAccout账户名,不填默认母账户 |
toAccount | string | 否 | 母子账户,可填subAccout账户名,不填默认母账户 |
fromAccountType | string | 是 | 划出账户类型,现货/合约,枚举值:"SPOT","FUTURES",划转规则见上描述 |
toAccountType | string | 是 | 划出账户类型,现货/合约,枚举值:"SPOT","FUTURES",划转规则见上描述 |
asset | string | 是 | 资产,eg:USDT |
amount | string | 是 | 数量,eg:1.82938475 |
timestamp | string | 是 | 时间戳 |
signature | string | 是 | 签名 |
返回参数
参数名 | 类型 | 说明 |
---|---|---|
tranId | string | 划转ID |
查询母子万向划转历史
请求示例
get /api/v3/capital/sub-account/universalTransfer
返回示例
[
{
"tranId":"11945860693",
"fromAccount":"master@test.com",
"toAccount":"subaccount1@test.com",
"clientTranId":"test",
"asset":"BTC",
"amount":"0.1",
"fromAccountType":"SPOT",
"toAccountType":"FUTURE",
"fromSymbol":"SPOT",
"toSymbol":"FUTURE",
"status":"SUCCESS",
"timestamp":1544433325000
}
]
HTTP请求
- GET
/api/v3/capital/sub-account/universalTransfer
接口权限要求: 资金划转读 / SPOT_TRANSFER_R
权重(IP): 1
请求参数
参数名 | 数据类型 | 是否必须 | 说明 |
---|---|---|---|
fromAccount | string | 否 | 母子账户,可填subAccout账户名,不填默认母账户 |
toAccount | string | 否 | 母子账户,可填subAccout账户名,不填默认母账户 |
fromAccountType | string | 是 | 划出账户类型,现货/合约,枚举值:"SPOT","FUTURES",划转规则见上描述 |
toAccountType | string | 是 | 划出账户类型,现货/合约,枚举值:"SPOT","FUTURES",划转规则见上描述 |
startTime | string | 否 | 起始时间 |
endTime | string | 否 | 截止时间 |
page | string | 否 | 默认 1 |
limit | string | 否 | 默认 500, 最大 500 |
timestamp | string | 是 | 时间戳 |
signature | string | 是 | 签名 |
返回参数
参数名 | 类型 | 说明 |
---|---|---|
tranId | string | 划转ID |
fromAccount | string | 划出账户 |
toAccount | string | 划入账户 |
clientTranId | string | 客户自定义划转ID |
asset | string | 币种 |
amount | string | 划转数量 |
fromAccountType | string | 转出业务账户 |
toAccountType | string | 划入业务账户 |
fromSymbol | string | 杠杆转入交易对 |
toSymbol | string | 杠杆转出交易对 |
status | string | 划转状态:成功,失败,划转中,中断 |
timestamp | number | 划转时间 |
查询子账户资产
请求示例
get /api/v3/sub-account/asset?subAccount=account1&accountType=SPOT×tamp={{timestamp}}&signature={{signature}}
返回示例
{
"balances": [
{
"asset": "MX",
"free": "3",
"locked": "0"
},
{
"asset": "BTC",
"free": "0.0003",
"locked": "0"
}
]
}
HTTP请求
- GET
/api/v3/sub-account/asset
接口权限要求: 资金划转读 / SPOT_TRANSFER_R
权重(IP): 1
请求参数
参数名 | 数据类型 | 是否必须 | 说明 |
---|---|---|---|
subAccount | string | 是 | 子账户名称,仅支持单个子账户查询 |
accountType | string | 是 | 账户类型,现货/合约,枚举值:"SPOT","FUTURES",当前仅支持SPOT |
timestamp | string | 是 | 时间戳 |
signature | string | 是 | 签名 |
返回参数
参数名 | 类型 | 说明 |
---|---|---|
balances | string | 余额 |
asset | string | 币种 |
free | string | 可用数量 |
locked | string | 冻结数量 |