# 现货订单

# 下单

POST /v1/spot/order/place

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 提交(SUBMIT) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT
type String 订单类型,可用值:MARKET,LIMIT,STOP_LIMIT,TRIGGER_ORDER_MARKET,TRIGGER_ORDER_LIMIT
direction String 交易方向,可用值:BUY,SELL
amount Decimal 订单交易量(市价买单为订单交易额)
price Decimal 订单价格(对市价单无效)
clientOrderId String 用户自编订单号(最大长度32个字符,须保持唯一性)
stopPrice Decimal 止盈止损/计划委托订单触发价格
operator String 止盈止损/计划委托订单触发价运算符 GTE – greater than and equal (>=), LTE – less than and equal (<=),可用值:GTE,LTE

基于订单 type不同,强制要求某些参数:

类型 强制要求的参数
LIMIT price
STOP_LIMIT price
TRIGGER_ORDER_MARKET stopPrice,operator
TRIGGER_ORDER_LIMIT price,stopPrice,operator

# 响应参数

名称 类型 描述
orderId Long 订单编号
clientOrderId String 用户自编订单号(如有)
errCode String 订单被拒错误码(仅对被拒订单有效)
errMsg String 订单被拒错误信息(仅对被拒订单有效)

# 请求示例

POST /v1/spot/order/place
{
  "direction": "BUY",
  "symbol": "BTC/USDT",
  "amount": "0.001",
  "price": "28660.70",
  "type": "LIMIT",
  "clientOrderId": "cc123456789"
}

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687313243859",
  "data": {
    "orderId": "591569852347887616",
    "clientOrderId": "cc123456789"
  }
}

# 批量下单

POST /v1/spot/order/batchOrders

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 提交(SUBMIT) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
Array 参数数组,一个批量最多10张订单
symbol String 交易对,eg.BTC/USDT
type String 订单类型,可用值:MARKET,LIMIT,STOP_LIMIT,TRIGGER_ORDER_MARKET,TRIGGER_ORDER_LIMIT
direction String 交易方向,可用值:BUY,SELL
amount Decimal 订单交易量(市价买单为订单交易额)
price Decimal 订单价格(对市价单无效)
clientOrderId String 用户自编订单号(最大长度32个字符,须保持唯一性)
stopPrice Decimal 止盈止损/计划委托订单触发价格
operator String 止盈止损/计划委托订单触发价运算符 GTE – greater than and equal (>=), LTE – less than and equal (<=),可用值:GTE,LTE

# 响应参数

名称 类型 描述
orderId Long 订单编号
clientOrderId String 用户自编订单号(如有)
errCode String 订单被拒错误码(仅对被拒订单有效)
errMsg String 订单被拒错误信息(仅对被拒订单有效)

# 请求示例

POST /v1/spot/order/batchOrders
[
  {
    "amount": "0.001",
    "price": "26859.71",
    "clientOrderId": "1687265118846",
    "direction": "BUY",
    "symbol": "BTC/USDT",
    "type": "LIMIT"
  },
  {
    "amount": "10",
    "clientOrderId": "1687265118847",
    "direction": "BUY",
    "symbol": "BTC/USDT",
    "type": "MARKET"
  }
]

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687265172519",
  "data": [
    {
      "clientOrderId": "1687265118846",
      "errCode": "AC3001",
      "errMsg": "ACCOUNT_BALANCE_INSUFFICIENT"
    },
    {
      "orderId": "591368226916577281",
      "clientOrderId": "1687265118847"
    }
  ]
}

# 撤销订单

POST /v1/spot/order/cancel

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 提交(SUBMIT) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT
orderId Long 订单编号
clientOrderId String 用户自编订单号

注意: orderIdclientOrderId 必须至少发送一个,如果两个都有值,以orderId 为准

# 响应参数

名称 类型 描述
orderId Long 订单编号
clientOrderId String 用户自编订单号(如有)
errCode String 订单被拒错误码(仅对撤单失败有效)
errMsg String 订单被拒错误信息(仅对撤单失败有效)

# 请求示例

POST /v1/spot/order/cancel
{
  "clientOrderId": "1687265118847",
  "orderId": "591368226916577281",
  "symbol": "BTC/USDT"
}

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687265685625",
  "data": {
    "orderId": "591368226916577281",
    "clientOrderId": "1687265118847"
  }
}

# 批量撤销订单

POST /v1/spot/order/batchCancel

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 提交(SUBMIT) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT
orderIds Array 订单编号,以英文逗号分隔,(orderIds和clientOrderIds必须且只能选一个填写,不超过50张订单),建议通过orderIds来撤单,比clientOrderIds更快更稳定,单次不超过50个订单
clientOrderIds Array 用户自编订单号,以英文逗号分隔,(orderIds和clientOrderIds必须且只能选一个填写,不超过50张订单),建议通过orderIds来撤单,比clientOrderIds更快更稳定,单次不超过50个订单

# 响应参数

名称 类型 描述
orderId Long 订单编号
clientOrderId String 用户自编订单号(如有)
errCode String 订单被拒错误码(仅对撤单失败有效)
errMsg String 订单被拒错误信息(仅对撤单失败有效)

# 请求示例

POST /v1/spot/order/batchCancel
{
  "symbol": "BTC/USDT",
  "orderIds": [
    "591568752689459201",
    "591568786239696896"
  ]
}

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687313014619",
  "data": [
    {
      "orderId": "591568752689459201"
    },
    {
      "orderId": "591568786239696896"
    }
  ]
}

# 查询当前未成交订单

GET /v1/spot/order/openOrders

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 查询(QUERY) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT
direction String 交易方向,可用值:BUY,SELL
limit Int 返回订单的数量,最大值500
types array 查询的订单类型组合,使用英文逗号分割,可选值:LIMIT,STOP_LIMIT,TRIGGER_ORDER_MARKET,TRIGGER_ORDER_LIMIT

# 响应参数

名称 类型 描述
symbol String 交易对
amount Decimal 订单交易量(市价买单为订单交易额)
filledQuoteAmount Decimal 已成交金额
orderId Long 订单编号
clientOrderId String 用户自编订单号
frozenFee Decimal 预先冻结的手续费,手续费类型为金本位,且该交易方向为BUY,字段大于等于0,其他场景为0
feeType String 手续费类型,COIN_STANDARD-币本位(买方手续费为基础币种,卖方手续费为计价币种),GOLD_STANDARD-金本位(买卖双方手续费都为计价币种)
type String 订单类型: LIMIT,STOP_LIMIT,TRIGGER_ORDER_MARKET,TRIGGER_ORDER_LIMIT
filledAmount Decimal 已成交数量
operator String 止盈止损订单触发价运算符 gte – greater than and equal (>=), lte – less than and equal (<=)
stopPrice Decimal 止盈止损订单触发价格
price Decimal 订单价格(对市价单无效)
createdTime Long 订单创建时间
state String 订单状态,包括NOT_ACTIVE-未激活,ACTIVE-已激活
feeRatio Decimal 基础费率
turnover Decimal 委托额
direction String 交易方向,BUY 买入,SELL 卖出
orderType String 委托类型: ORDINARY-普通委托,STOP_LIMIT-止盈止损,TRIGGER_ORDER-计划委托

# 请求示例

GET /v1/spot/order/openOrders?symbol=BTC/USDT

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687313193523",
  "data": [
    {
      "symbol": "BTC/USDT",
      "orderId": "591569852347887616",
      "clientOrderId": "cc123456789",
      "price": "28660.7",
      "amount": "0.001",
      "turnover": "28.6607",
      "createdTime": "1687313244000",
      "type": "LIMIT",
      "direction": "BUY",
      "filledAmount": "0",
      "filledQuoteAmount": "0",
      "state": "ACTIVE",
      "feeType": "GOLD_STANDARD",
      "frozenFee": "0.0859821",
      "feeRatio": "0.003",
      "orderType": "ORDINARY"
    } 
  ]
}

# 查询历史订单

GET /v1/spot/order/orderHistory

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 查询(QUERY) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT
direction String 交易方向,可用值:BUY,SELL
limit Int 返回订单的数量,最大值500
states Array 订单状态组合,使用英文逗号分割,可用值:ENTRUSTED,ENTRUST_FAILED,COMPLETED,REVOKED
types Array 查询的订单类型组合,使用英文逗号分割,可用值:MARKET,LIMIT,STOP_LIMIT,TRIGGER_ORDER_MARKET,TRIGGER_ORDER_LIMIT

# 响应参数

名称 类型 描述
symbol String 交易对
amount Decimal 订单交易量(市价买单为订单交易额)
filledQuoteAmount Decimal 已成交金额
orderId Long 订单编号
clientOrderId String 用户自编订单号
frozenFee Decimal 预先冻结的手续费,手续费类型为金本位,且该交易方向为BUY,字段大于等于0,其他场景为0
feeType String 手续费类型,COIN_STANDARD-币本位(买方手续费为基础币种,卖方手续费为计价币种),GOLD_STANDARD-金本位(买卖双方手续费都为计价币种)
type String 订单类型
filledAmount Decimal 已成交数量
operator String 止盈止损订单触发价运算符 gte – greater than and equal (>=), lte – less than and equal (<=)
stopPrice Decimal 止盈止损订单触发价格
price Decimal 订单价格(对市价单无效)
createdTime Long 订单创建时间
state String 订单状态,包括ENTRUSTED-已委托,ENTRUST_FAILED-委托失败,COMPLETED-已成交,REVOKED-已撤销
feeRatio Decimal 基础费率
turnover Decimal 委托额
direction String 交易方向,BUY 买入,SELL 卖出
orderType String 委托类型: ORDINARY-普通委托,STOP_LIMIT-止盈止损,TRIGGER_ORDER-计划委托
canceledTime Long 撤销订单发起时间
finishedTime Long 订单变为终结态的时间,不是成交时间,包含“已撤单”状态

# 请求示例

GET /v1/spot/order/orderHistory?direction=BUY&limit=2&states=COMPLETED&symbol=BTC/USDT&types=LIMIT

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687266305060",
  "data": [
    {
      "symbol": "BTC/USDT",
      "orderId": "591366500541050881",
      "price": "26872.1",
      "amount": "0.001",
      "turnover": "26.8721",
      "createdTime": "1687264761000",
      "type": "LIMIT",
      "direction": "BUY",
      "filledAmount": "0.001",
      "filledQuoteAmount": "26.86922",
      "state": "COMPLETED",
      "feeType": "GOLD_STANDARD",
      "frozenFee": "0.0806163",
      "feeRatio": "0.003",
      "orderType": "ORDINARY",
      "finishedTime": "1687265451000"
    },
    {
      "symbol": "BTC/USDT",
      "orderId": "585775314987450368",
      "price": "27144.82",
      "amount": "0.001",
      "turnover": "27.14482",
      "createdTime": "1685931718000",
      "type": "LIMIT",
      "direction": "BUY",
      "filledAmount": "0.001",
      "filledQuoteAmount": "27.14482",
      "state": "COMPLETED",
      "feeType": "GOLD_STANDARD",
      "frozenFee": "0.08143446",
      "feeRatio": "0.003",
      "orderType": "ORDINARY",
      "finishedTime": "1685931719000"
    }
  ]
}

# 当前和历史成交

GET /v1/spot/order/tradeHistory

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 查询(QUERY) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT
direction String 交易方向,可用值:BUY,SELL
limit Int 返回订单的数量,最大值500
startTime Long 查询开始时间, 时间格式UTC time in millisecond。 以订单成交时间进行查询,如:1687312920000
endTime Long 查询结束时间, 时间格式UTC time in millisecond。 以订单成交时间进行查询,如:1687312922000

# 响应参数

名称 类型 描述
symbol String 交易对
amount Decimal 成交量(基础币种)
matchedTime Long 成交时间
orderId Long 订单编号
tradeRole String 成交角色: TAKER,MAKER
officialReceiptsFeeRatio Decimal 实际手续费收取费率
feeType String 手续费类型,COIN_STANDARD-币本位(买方手续费为基础币种,卖方手续费为计价币种),GOLD_STANDARD-金本位(买卖双方手续费都为计价币种)
feeCoin String 手续费币种
price Decimal 成交价
officialReceiptsFee Decimal 实际收费的手续费,包含返佣金额
tradeId Long 成交订单编号
turnover Decimal 成交额(计价币种)
direction String 交易方向,BUY 买入,SELL 卖出
type String 订单类型: MARKET,LIMIT,STOP_LIMIT,TRIGGER_ORDER_MARKET,TRIGGER_ORDER_LIMIT

# 请求示例

GET /v1/spot/order/tradeHistory?symbol=BTC/USDT

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687315211978",
  "data": [
    {
      "symbol": "BTC/USDT",
      "orderId": "591568467350958081",
      "tradeId": "591568499638710273",
      "matchedTime": "1687312921000",
      "price": "28796.78",
      "amount": "0.001",
      "turnover": "28.79678",
      "tradeRole": "MAKER",
      "direction": "BUY",
      "officialReceiptsFeeRatio": "0.29997",
      "officialReceiptsFee": "8.63817009",
      "feeCoin": "USDT",
      "feeType": "GOLD_STANDARD",
      "type": "LIMIT"
    }
  ]
}

# 成交明细

GET /v1/spot/order/myTrades

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 查询(QUERY) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT
orderId Long 订单编号

# 响应参数

名称 类型 描述
symbol String 交易对
amount Decimal 成交量(基础币种)
matchedTime Long 成交时间
orderId Long 订单编号
tradeRole String 成交角色: TAKER,MAKER
officialReceiptsFeeRatio Decimal 实际手续费收取费率
feeType String 手续费类型,COIN_STANDARD-币本位(买方手续费为基础币种,卖方手续费为计价币种),GOLD_STANDARD-金本位(买卖双方手续费都为计价币种)
feeCoin String 手续费币种
price Decimal 成交价
officialReceiptsFee Decimal 实际收费的手续费,包含返佣金额
tradeId Long 成交订单编号
turnover Decimal 成交额(计价币种)
direction String 交易方向,BUY 买入,SELL 卖出
type String 订单类型: MARKET,LIMIT,STOP_LIMIT,TRIGGER_ORDER_MARKET,TRIGGER_ORDER_LIMIT

# 请求示例

GET /v1/spot/order/myTrades?orderId=591568467350958081&symbol=BTC/USDT

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687315331893",
  "data": [
    {
      "symbol": "BTC/USDT",
      "orderId": "591568467350958081",
      "tradeId": "591568499638710273",
      "matchedTime": "1687312921000",
      "price": "28796.78",
      "amount": "0.001",
      "turnover": "28.79678",
      "tradeRole": "MAKER",
      "direction": "BUY",
      "officialReceiptsFeeRatio": "0.29997",
      "officialReceiptsFee": "8.63817009",
      "feeCoin": "USDT",
      "feeType": "GOLD_STANDARD",
      "type": "LIMIT"
    }
  ]
}

# 获取用户当前手续费费率

GET /v1/spot/order/transactFeeRate

所属模块 所属类型 资源隔离类型 速率限制
现货订单(SPOT_ORDER) 查询(QUERY) 币对(SYMBOL) 5

# 参数

名称 类型 必填 描述
symbol String 交易对,eg.BTC/USDT

# 响应参数

名称 类型 描述
symbol String 交易对
makerRatio Decimal 当前用户maker手续费费率
takerRatio Decimal 当前用户taker手续费费率

# 请求示例

GET /v1/spot/order/transactFeeRate?symbol=BTC/USDT

# 响应示例

{
  "code": "200",
  "message": "OK",
  "timestamp": "1687309754397",
  "data": {
    "symbol": "BTC/USDT",
    "makerRatio": "0.29997",
    "takerRatio": "0.00294"
  }
}