订单接口

下单

限速规则:10次/1s

HTTP请求 下单接口

  • POST /api/spot/v1/trade/orders

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

side

String

交易方向

orderType

String

交易类型 limit/market

force

String

订单类型

price

String

限价价格

quantity

String

委托数量

clientOrderId

String

自定义id

返回数据

{
    "code":"00000",
    "msg":"success",
    "data":{
        "orderId":"1001",
        "clientOrderId":"hgXjh89AsxleMSw"
    }
}

返回值说明

返回字段
字段说明

orderId

订单id

clientOrderId

自定义id

批量下单

限速规则 5次/1s

HTTP请求

批量下单

  • POST /api/spot/v1/trade/batch-orders

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

orderList

List

下单集合

  • orderList参数

参数名
参数类型
是否必须
描述

side

String

交易方向

orderType

String

交易类型 limit/market

force

String

订单类型

price

String

限价价格

quantity

String

委托数量

clientOrderId

String

自定义id

返回参数

{
    "code":"00000",
    "msg":"success",
    "data":{
        "resultList":[
            {
                "clientOrderId":"hgXjh89AsxleMSw",
                "orderId":"1001"
            }
        ]
    }
}

撤单

限速规则 10次/1s

HTTP请求

撤单操作

  • POST /api/spot/v1/trade/cancel-order

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

orderId

String

订单id

返回参数

{

  "code":"00000",
   "message":"success",
   "data":"1001"

}

批量撤单(单对)

限速规则 10次/1s

HTTP请求

批量撤单请求

  • POST /api/spot/v1/trade/cancel-batch-orders

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

orderIds

String[]

订单id数组

返回参数

{

  "code":"00000",
   "message":"success",
    "data":[
    "1001",
    "1002"
    ]

}   

获取订单详情

限速规则 20次/1s

HTTP请求

根据订单id或者自定义id获取订单

  • POST /api/spot/v1/trade/orderInfo

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

orderId

String

订单id

clientOrderId

String

自定义id

返回参数

{
  "code":"00000",
  "message":"success",
"data":[{
  "accountId":"10012",
  "symbol":"btcusdt_spbl",
  "orderId":"2222222",
  "clientOrderId":"xxxxxxx",
  "price":"34245.12",
  "quantity":"1",  
  "orderType":"limit",
  "side":"buy",
  "status":"new",
  "fillPrice":"0",
  "fillQuantity":"0",
  "fillTotalAmount":"0",
  "cTime":"1622697148"
}]
}

返回值说明

返回字段
字段说明

accountId

账户id

symbol

币对名称

orderId

订单id

clientOrderId

自定义id

price

委托价格

quantity

委托数量(市价 买,表示金额)

orderType

委托类型

side

委托方向

status

订状态

fillPrice

成交价格

fillQuantity

成交数量

fillTotalAmount

成交总额

cTime

创建时间 (时间戳秒)

获取未成交列表

限速规则 20次/1s

HTTP请求

获取未成交和部分成交未撤单的订单

  • POST /api/spot/v1/trade/open-orders

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

返回参数

{
  "code":"00000",
  "message":"success",
"data":[{
  "accountId":"10012",
  "symbol":"btcusdt_spbl",
  "orderId":"2222222",
  "clientOrderId":"xxxxxxx",
  "price":"34829.12",
  "quantity":"1",  
  "orderType":"limit",
  "side":"buy",
  "status":"new",
  "fillPrice":"0",
  "fillQuantity":"0",
  "fillTotalAmount":"0",
  "cTime":"1622697148"
}]
}

返回值说明

返回字段
字段说明

accountId

账户id

symbol

币对名称

orderId

订单id

clientOrderId

自定义id

price

委托价格

quantity

委托数量(市价 买,表示金额)

orderType

委托类型

side

委托方向

status

订状态

fillPrice

成交价格

fillQuantity

成交数量

fillTotalAmount

成交总额

cTime

创建时间 (时间戳秒)

获取历史委托列表

限速规则 20次/1s

HTTP请求

获取全部成交和已撤销的订单

  • POST /api/spot/v1/trade/history

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

after

String

传入 orderId, 在这 orderId 之前的数据 desc

before

String

传入 orderId 在这 orderId 之后的数据 asc

limit

Integer

返回结果的数量,默认100,最大 500

返回参数

{
  "code":"00000",
  "message":"success",
"data":[{
  "accountId":"10012",
  "symbol":"btcusdt_spbl",
  "orderId":"2222222",
  "clientOrderId":"xxxxxxx",
  "price":"34982.12",
  "quantity":"1",  
  "orderType":"limit",
  "side":"buy",
  "status":"new",
  "fillPrice":"34982.12",
  "fillQuantity":"1",
  "fillTotalAmount":"34982.12",
  "cTime":"1622697148"
}]
}

返回值说明

返回字段
字段说明

accountId

账户id

symbol

币对名称

orderId

订单id

clientOrderId

自定义id

price

委托价格

quantity

委托数量(市价 买,表示金额)

orderType

委托类型

side

委托方向

status

订状态

fillPrice

成交价格

fillQuantity

成交数量

fillTotalAmount

成交总额

cTime

创建时间(时间戳秒)

获取成交明细

限速规则 20次/1s

HTTP请求

获取成交的历史明细

  • POST /api/spot/v1/trade/fills

请求参数

参数名
参数类型
是否必须
描述

symbol

String

币对,具体见:/products

orderId

String

订单id

after

String

传入 orderId, 在这 orderId 之前的数据 desc

before

String

传入 orderId 在这 orderId 之后的数据 asc

limit

Integer

返回结果的数量,默认100,最大 500

返回参数

{
  "code":"",
  "message":"",
  "data":[{
  "accountId":"1001",
  "symbol":"btcusdt_spbl",
  "orderId":"100021",
  "fillId":"102211",
  "orderType":"limit",
  "side":"buy",
  "fillPrice":"38293.12",
  "fillQuantity":"1",
  "fillTotalAmount":"38293.12",
  "cTime":"1622697148",
  "feeCcy":"btc",
  "fees":"0.0001"
}]
}

返回值说明

返回字段
字段说明

accountId

账户id

symbol

币对名称

orderId

订单id

fillId

成交id

orderType

委托类型

side

委托方向

fillPrice

成交价格

fillQuantity

成交数量

fillTotalAmount

成交总额

cTime

创建时间(时间戳秒)

feeCcy

手续费币种

fees

手续费

Last updated