账户接口
账户信息 (USER_DATA)
GET /api/v3/account
权重: 20
参数:
| 名称 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| omitZeroBalances | BOOLEAN | NO | 如果true,将隐藏所有零余额。 默认值: false |
| recvWindow | DECIMAL | NO | 最大值为 60000 毫秒。 支持最多三位小数的精度(例如 6000.346),以便可以指定微秒。 |
| timestamp | LONG | YES |
数据源: 缓存 => 数据库
响应:
{
"makerCommission": 15,
"takerCommission": 15,
"buyerCommission": 0,
"sellerCommission": 0,
"commissionRates": {
"maker": "0.00150000",
"taker": "0.00150000",
"buyer": "0.00000000",
"seller": "0.00000000"
},
"canTrade": true,
"canWithdraw": true,
"canDeposit": true,
"brokered": false,
"requireSelfTradePrevention": false,
"preventSor": false,
"updateTime": 123456789,
"accountType": "SPOT",
"balances": [
{
"asset": "BTC",
"free": "4723846.89208129",
"locked": "0.00000000"
},
{
"asset": "LTC",
"free": "4763368.68006011",
"locked": "0.00000000"
}
],
"permissions": [
"SPOT"
],
"uid": 354937868
}
查询订单 (USER_DATA)
GET /api/v3/order
查询订单状态
权重: 4
参数:
| 名称 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| recvWindow | DECIMAL | NO | 最大值为 60000 毫秒。 支持最多三位小数的精度(例如 6000.346),以便可以指定微秒。 |
| timestamp | LONG | YES |
注意:
- 至少需要发送
orderId与origClientOrderId中的一个。 - 当同时提供
orderId和origClientOrderId两个参数时,系统首先将会使用orderId来搜索订单。然后, 查找结果中的origClientOrderId的值将会被用来验证订单。如果两个条件都不满足,则请求将被拒绝。 - 某些订单中
cummulativeQuoteQty<0,是由于这些订单是cummulativeQuoteQty功能上线之前的订单。
数据源: 缓存 => 数据库
响应:
{
"symbol": "LTCBTC", // 交易对
"orderId": 1, // 系统的订单ID
"orderListId": -1, // 除非此单是订单列表的一部分, 否则此值为 -1
"clientOrderId": "myOrder1", // 客户自己设置的ID
"price": "0.1", // 订单价格
"origQty": "1.0", // 用户设置的原始订单数量
"executedQty": "0.0", // 交易的订单数量
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.0", // 累计交易的金额
"status": "NEW", // 订单状态
"timeInForce": "GTC", // 订单的时效方式
"type": "LIMIT", // 订单类型, 比如市价单,现价单等
"side": "BUY", // 订单方向,买还是卖
"stopPrice": "0.0", // 止损价格
"icebergQty": "0.0", // 冰山数量
"time": 1499827319559, // 订单时间
"updateTime": 1499827319559, // 最后更新时间
"isWorking": true, // 订单是否出现在orderbook中
"workingTime":1499827319559, // 订单添加到 order book 的时间
"origQuoteOrderQty": "0.000000", // 原始的交易金额
"selfTradePreventionMode": "NONE" // 如何处理自我交易模式
}
注意: 上面的 payload 没有显示所有可以出现的字段,更多请看 订单响应中的特定条件时才会出现的字段 部分。
查看账户当前挂单 (USER_DATA)
GET /api/v3/openOrders
请小心使用不带symbol参数的调用
权重: 带symbol: 6 不带: 80
参数:
| 名称 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
| symbol | STRING | NO | |
| recvWindow | DECIMAL | NO | 最大值为 60000 毫秒。 支持最多三位小数的精度(例如 6000.346),以便可以指定微秒。 |
| timestamp | LONG | YES |
- 不带symbol参数,会返回所有交易对的挂单
数据源: 缓存 => 数据库
响应:
[
{
"symbol": "LTCBTC",
"orderId": 1,
"orderListId": -1, // 除非此单是订单列表的一部分, 否则此值为 -1
"clientOrderId": "myOrder1",
"price": "0.1",
"origQty": "1.0",
"executedQty": "0.0",
"origQuoteOrderQty": "0.000000",
"cummulativeQuoteQty": "0.0",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0.0",
"icebergQty": "0.0",
"time": 1499827319559,
"updateTime": 1499827319559,
"isWorking": true,
"origQuoteOrderQty": "0.000000",
"workingTime": 1499827319559,
"selfTradePreventionMode": "NONE"
}
]
注意: 上面的 payload 没有显示所有可以出现的字段,更多请看 订单响应中的特定条件时才会出现的字段 部分。