Create a Sub Account

POST /sapi/v1/broker/subAccount

Parameters:

Name Type Mandatory Description
tag STRING NO tag length should be less than 32
recvWindow LONG NO
timestamp LONG YES

Caution:

  • This request will generate a sub account under your brokerage master account.
  • You need to enable "trade" option for the api key which requests this endpoint.

Response:

{
  "subaccountId": "1",
  "email": "vai_42038996_47411276_brokersubuser@lac.info",
  "tag":"bob123d"
}

Enable Futures for Sub Account

POST /sapi/v1/broker/subAccount/futures

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
futures ENUM YES only true for now
recvWindow LONG NO
timestamp LONG YES

Response:

{
    "subaccountId": "1",
    "enableFutures": true,
    "updateTime": 1570801523523
}

Create Api Key for Sub Account

POST /sapi/v1/broker/subAccountApi

Weight(IP): 8 Weight(Master Account): 3000

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
canTrade ENUM YES spot trade
marginTrade ENUM NO margin trade
futuresTrade ENUM NO futures trade
recvWindow LONG NO
timestamp LONG YES

Caution:

  • This request will generate a api key for a sub account.
  • You need to enable "trade" option for the api key which requests this endpoint
  • Sub account should be enable margin before its api-key's marginTrade being enabled
  • Sub account should be enable futures before its api-key's futuresTrade being enabled
  • You can only create 1 api key for each sub account per second

Response:

{
    "subaccountId": "1",
    "apiKey":"vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
    "secretKey":"NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0",
    "canTrade": true,
    "marginTrade": false,
    "futuresTrade": false
}

Delete Sub Account Api Key

DELETE /sapi/v1/broker/subAccountApi

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
subAccountApiKey STRING YES
recvWindow LONG NO
timestamp LONG YES

Caution:

  • This request will delete a api key for a sub account
  • You need to enable "trade" option for the api key which requests this endpoint
  • You can only delete 1 api key for each sub account per second

Response:

{}

Query Sub Account Api Key

GET /sapi/v1/broker/subAccountApi

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
subAccountApiKey STRING NO
page LONG NO default 1
size LONG NO default 500, max 500
recvWindow LONG NO
timestamp LONG YES

Caution:

  • You need to enable "trade" option for the api key which requests this endpoint

Response:

{
    "subaccountId": "1", 
    "apikey":"vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
    "canTrade": true,
    "marginTrade": true,
    "futuresTrade": false
}   

Change Sub Account Api Permission

POST /sapi/v1/broker/subAccountApi/permission

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
subAccountApiKey STRING YES
canTrade ENUM YES
marginTrade ENUM YES
futuresTrade ENUM YES
recvWindow LONG NO
timestamp LONG YES

Caution:

  • This request will change the api permission for a sub account.
  • You need to enable "trade" option for the api key which requests this endpoint.
  • Sub account should be enable margin before its api-key's marginTrade being enabled.
  • Sub account should be enable futures before its api-key's futuresTrade being enabled.

Response:

{
    "subaccountId": "1", 
    "apikey":"vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
    "canTrade": true,
    "marginTrade": true,
    "futuresTrade": true
}

Query Sub Account

GET /sapi/v1/broker/subAccount

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
page LONG NO default 1
size LONG NO default 500
recvWindow LONG NO
timestamp LONG YES

Response:

[
        {
            "subaccountId": "1",
            "email": "vai_42038996_47411276_brokersubuser@lac.info",
            "tag":"bob123",
            "makerCommission": 0.001,
            "takerCommission": 0.001,
            "marginMakerCommission": -1,  // if margin disabled, return -1
            "marginTakerCommission": -1,  // if margin disabled, return -1
            "createTime":1544433328000
        },
        {
            "subaccountId": "2",
            "email":"123@abc.com",
            "tag":"bob123",
            "makerCommission":0.001,
            "takerCommission":0.001,
            "marginMakerCommission": 10,
            "marginTakerCommission": 10,
            "createTime":1544433328000
        }
]

Change Sub Account Commission

POST /sapi/v1/broker/subAccountApi/commission

  • This request will change the commission for a sub account.
  • You need to enable "trade" option for the api key which requests this endpoint.

Weight(UID): 4

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
makerCommission FLOAT YES 0.001
takerCommission FLOAT YES 0.002
marginMakerCommission FLOAT NO
marginTakerCommission FLOAT NO
recvWindow LONG NO
timestamp LONG YES
  • If margin disabled, it is not allowed to send marginMakerCommission or marginTakerCommission.
  • If margin enabled, marginMakerCommission or marginTakerCommission has default value as makerCommission or takerCommission.

Response:

{
    "subAccountId": "1",
    "makerCommission": 0.001,
    "takerCommission": 0.002,
    "marginMakerCommission": 0.001,
    "marginTakerCommission": 0.002
}

Change Sub Account USDT-Ⓜ Futures Commission Adjustment

POST /sapi/v1/broker/subAccountApi/commission/futures

  • This request will change the USDT-Ⓜ futures commission for a sub account.
  • You need to enable "trade" option for the api key which requests this endpoint.
  • The sub-account's USDT-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment.

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
symbol STRING YES
makerAdjustment INT YES 100 for 0.01%
takerAdjustment INT YES 100 for 0.01%
recvWindow LONG NO
timestamp LONG YES
  • If futures disabled, it is not allowed to set subaccount's USDT-Ⓜ futures commission adjustment on any symbol.

Response:

{
    "subAccountId": 1,
    "symbol": "BTCUSDT",
    "makerAdjustment": 150,  // USDT-Ⓜ futures commission adjustment for maker
    "takerAdjustment": 150,  // USDT-Ⓜ futures commission adjustment for taker
    "makerCommission": 450,  // USDT-Ⓜ futures commission (after adjusted) for maker
    "takerCommission": 550,  // USDT-Ⓜ futures commission (after adjusted) for taker
}

Query Sub Account USDT-Ⓜ Futures Commission Adjustment

GET /sapi/v1/broker/subAccountApi/commission/futures

  • The sub-account's USDT-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment.

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
symbol STRING NO
recvWindow LONG NO
timestamp LONG YES
  • If symbol not sent, commission adjustment of all symbols will be returned.
  • If futures disabled, it is not allowed to set subaccount's USDT-Ⓜ futures commission adjustment on any symbol.

Response:

[
    {   
        "subAccountId": 1,
        "symbol": "BTCUSDT",
        "makerCommission": 450,  // USDT-Ⓜ futures commission (after adjusted) for maker
        "takerCommission": 550,  // USDT-Ⓜ futures commission (after adjusted) for taker
    },
    {   
        "subAccountId": 1,
        "symbol": "ETHUSDT",
        "makerCommission": 400,
        "takerCommission": 500,
    },
]

Change Sub Account COIN-Ⓜ Futures Commission Adjustment

POST /sapi/v1/broker/subAccountApi/commission/coinFutures

  • This request will change the COIN-Ⓜ futures commission for a sub account.
  • You need to enable "trade" option for the api key which requests this endpoint.
  • The sub-account's COIN-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment.

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
pair STRING YES BTCUSD
makerAdjustment INT YES 100 for 0.01%
takerAdjustment INT YES 100 for 0.01%
recvWindow LONG NO
timestamp LONG YES
  • If futures disabled, it is not allowed to set subaccount's COIN-Ⓜ futures commission adjustment on any symbol.
  • Different symbols have the same commission for the same pair

Response:

{
    "subAccountId": 1,
    "pair": "BTCUSD",
    "makerAdjustment": 150,  // COIN-Ⓜ futures commission adjustment for maker
    "takerAdjustment": 150,  // COIN-Ⓜ futures commission adjustment for taker
    "makerCommission": 450,  // COIN-Ⓜ futures commission (after adjusted) for maker
    "takerCommission": 550,  // COIN-Ⓜ futures commission (after adjusted) for taker
}

Query Sub Account COIN-Ⓜ Futures Commission Adjustment

GET /sapi/v1/broker/subAccountApi/commission/coinFutures

  • The sub-account's COIN-Ⓜ futures commission of a symbol equals to the base commission of the symbol on the sub-account's fee tier plus the commission adjustment.

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
pair STRING NO BTCUSD
recvWindow LONG NO
timestamp LONG YES
  • If symbol not sent, commission adjustment of all symbols will be returned.
  • If futures disabled, it is not allowed to set subaccount's COIN-Ⓜ futures commission adjustment on any symbol.
  • Different symbols have the same commission for the same pair

Response:

[
    {   
        "subAccountId": 1,
        "pair": "BTCUSD",
        "makerCommission": 450,  // COIN-Ⓜ futures commission (after adjusted) for maker
        "takerCommission": 550,  // COIN-Ⓜ futures commission (after adjusted) for taker
    },
    {   
        "subAccountId": 1,
        "pair": "ETHUSD",
        "makerCommission": 400,
        "takerCommission": 500,
    },
]

Broker Account Information

Get /sapi/v1/broker/info

Parameters:

Name Type Mandatory Description
recvWindow LONG NO
timestamp LONG YES

Response:

{
    "maxMakerCommission":0.002,
    "minMakerCommission":0.001,
    "maxTakerCommission":0.002,
    "minTakerCommission":0.001,
    "subAccountQty":400,
    "maxSubAccountQty":1000
}

Sub Account Transfer(SPOT)

POST /sapi/v1/broker/transfer

Parameters:

Name Type Mandatory Description
fromId STRING NO
toId STRING NO
clientTranId STRING NO client transfer id, must be unique. The max length is 32 characters
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Caution:

  • You need to enable "internal transfer" option for the api key which requests this endpoint.
  • Transfer from master account if fromId not sent.
  • Transfer to master account if toId not sent.

Response:

{
    "txnId":"2966662589",
    "clientTranId":"abc"
}

Query Sub Account Transfer History(SPOT)

GET /sapi/v1/broker/transfer

Parameters:

Name Type Mandatory Description
fromId STRING NO
toId STRING NO
clientTranId STRING NO client transfer id
showAllStatus ENUM NO true or false, default: false
startTime LONG NO
endTime LONG NO
page INT NO
limit INT NO default 500, max 500
recvWindow LONG NO
timestamp LONG YES

Caution:

  • If showAllStatus is true, the status in response will show four types: INIT,PROCESS,SUCCESS,FAILURE.
  • If showAllStatus is false, the status in response will show three types: INIT,PROCESS,SUCCESS.
  • Either fromId or toId must be sent. Return fromId equal master account by default.

Query scope is limited to 100 days:

  • Both startTime and endTime are provided: If it exceeds, the endTime will be re-calculated 100 days after the startTime.
  • Neither startTime nor endTime are provided: Calculate 100 days before today.
  • endTime is not provided: Calculate 100 days after startTime.
  • startTime is not provided: Calculate 100 days before endTime.

Response:

[
        {
            "fromId":"1",
            "toId":"2",
            "asset":"BTC",
            "qty":"1",
            "time":1544433328000,
            "txnId":"2966662589",
            "clientTranId":"abc",
            "status": "SUCCESS"  // Status Type:INIT,PROCESS,SUCCESS
        },
        {
            "fromId":"1",
            "toId":"2",
            "asset":"ETH",
            "qty":"2",
            "time":1544433328000,
            "txnId":"296666999",
            "clientTranId":"",
            "status": "SUCCESS"
        }
]

Sub Account Transfer(FUTURES)

POST /sapi/v1/broker/transfer/futures

Parameters:

Name Type Mandatory Description
fromId STRING NO
toId STRING NO
futuresType LONG YES 1:USDT Futures,2: COIN Futures
asset STRING YES
amount DECIMAL YES
clientTranId STRING NO The max length is 32 characters
recvWindow LONG NO
timestamp LONG YES

Caution:

  • You need to enable "internal transfer" option for the api key which requests this endpoint.
  • Transfer from master account if fromId not sent.
  • Transfer to master account if toId not sent.
  • Each master account could transfer 5000 times/min

Response:

{
    "success":true,
    "txnId":"2966662589",
    "clientTranId":"a123"
}

Query Sub Account Transfer History(FUTURES)

GET /sapi/v1/broker/transfer/futures

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
futuresType LONG YES 1:USDT Futures,2: COIN Futures
clientTranId STRING NO
startTime LONG NO default 30 days records
endTime LONG NO default 30 days records
page INT NO default 1
limit INT NO default 50, max 500
recvWindow LONG NO
timestamp LONG YES
  • Only get the latest history of past 30 days.

Response:

{
    "success": true,
    "futuresType": 2,
    "transfers":[
        {
            "from":"",  // master account
            "to":"2",
            "asset":"BTC",
            "qty":"1",
            "tranId": "12137888538",
            "clientTranId":"a123",
            "time":1544433328000
        },
        {
            "fromId":"1",
            "toId":"2",
            "asset":"ETH",
            "qty":"2",
            "tranId": "12137888538",
            "clientTranId":"",
            "time":1544433328000,

        }
     ]
}

Query Broker Commission Rebate Recent Record(Spot)

GET /sapi/v1/broker/rebate/recentRecord

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
startTime LONG NO Default: 7 days from current timestamp
endTime LONG NO Default: present timestamp
page LONG NO default 1
size LONG NO default 500,max500
recvWindow LONG NO
timestamp LONG YES
  • The query time period must be less than 7 days (default as the recent 7 days).

Response:

[
        {
            "subaccountId":"1",
            "income": "0.02063898",
            "asset":"BTC",
            "symbol": "ETHBTC",
            "tradeId": 123456,
            "time":1544433328000,
            "status": 1
        },
        {
            "subaccountId":"2",
            "income": "1.2063898",
            "asset":"USDT",
            "symbol": "BTCUSDT",
            "tradeId": 223456,
            "time":1581580800000,
            "status": 1
        }

]
  • Status: 0: Pending, 1: Successful, 2: Failed

Enable Or Disable BNB Burn for Sub Account SPOT and MARGIN

POST /sapi/v1/broker/subAccount/bnbBurn/spot

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
spotBNBBurn ENUM YES "true" or "false", spot and margin whether use BNB to pay for transaction fees or not
recvWindow LONG NO
timestamp LONG YES

Response:

{
    "subAccountId":1,
    "spotBNBBurn":true
}

Enable Or Disable BNB Burn for Sub Account Margin Interest

POST /sapi/v1/broker/subAccount/bnbBurn/marginInterest

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
interestBNBBurn ENUM YES "true" or "false", margin loan whether uses BNB to pay for margin interest or not
recvWindow LONG NO
timestamp LONG YES
  • Subaccount must be enabled margin before using this switch

Response:

{
    "subAccountId":1,
    "interestBNBBurn":true
}

Get BNB Burn Status for Sub Account

GET /sapi/v1/broker/subAccount/bnbBurn/status

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
recvWindow LONG NO
timestamp LONG YES

Response:

{
    "subAccountId": 1,
    "spotBNBBurn": true,
    "interestBNBBurn": true
}

Get Sub Account Deposit History

GET /sapi/v1/broker/subAccount/depositHist

weight(Master Account):10

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
coin STRING NO
status INT NO 0(0:pending,6: credited but cannot withdraw, 1:success)
startTime LONG NO Default: 7 days from current timestamp
endTime LONG NO Default: present timestamp
limit INT NO Default:500
offset INT NO Default:0
recvWindow LONG NO
timestamp LONG YES
  • The query time period must be less than 7 days( default as the recent 7 days).

Response:

[
  {
    "depositId": 1234567890123,
    "subAccountId": "1",
    "address": "0xddc66e4313fd6c737b6cae67cad90bb4e0ac7092",
    "addressTag": "",
    "amount": "139.04370000",
    "coin": "USDT",
    "insertTime": 1566791463000,
    "transferType": 0, //0: Blockchain transfers, 1: off-chain transfers
    "network": "ETH",
    "status": 1,
    "txId": "0x5759dfe9983a4c7619bce9bc736bb6c26f804091753bf66fa91e7cd5cfeebafd",     
    "sourceAddress":"xxxxxxxxxxxxxx",
    "confirmTimes":"12/12",
    "selfReturnStatus": 0
  },
  {
    "depositId": 1234567890123,
    "subAccountId": "2",
    "address": "0xddc66e4313fd6c737b6cae67kld90bb4e0ac7092",
    "addressTag": "",
    "amount": "1589.12345678",
    "coin": "BTC",
    "insertTime": 1566791463000,
    "transferType": 1,
    "network": "BNB",
    "status": 1,
    "txId": "Off-chain transfer dbea58fa48ef4cc59393da4552ae77d7",
    "sourceAddress":"xxxxxxxxxxxxxx",
    "confirmTimes":"12/12",
    "selfReturnStatus": 0
    }
]

Query Sub Account Spot Asset info

GET /sapi/v1/broker/subAccount/spotSummary

Weight(UID): 3000

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
page LONG NO default 1
size LONG NO default 10, max 20
recvWindow LONG NO
timestamp LONG YES
  • If subaccountId is not sent, the size must be sent
  • Requests per UID are limited to 60 requests per minute

Response:

{

  data:[

       {
           "subAccountId": "367537027503425913", 
            "totalBalanceOfBtc": "0.0355852154360000" //spot asset
        },
        { 
            "subAccountId": "367537027503421232", 
            "totalBalanceOfBtc": "0.0233852154360000"
        }  

      ],
  "timestamp": 1583432900000

}

Query Subaccount Margin Asset info

GET /sapi/v1/broker/subAccount/marginSummary

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
page LONG NO default 1
size LONG NO default 10, max 20
recvWindow LONG NO
timestamp LONG YES
  • If subaccountId is not sent, the size must be sent

Response:

{

  data:[

       {
           "marginEnable": true, //if enable margin
           "subAccountId": "367537027503425913",
            "totalAssetOfBtc": "0.03558520",  // margin asset 
            "totalLiabilityOfBtc": "0.34585210", //liability 
            "totalNetAssetOfBtc" :"0.23334213", // net asset
            "marginLevel": "0.009" // margin level
        },
        { 
            "marginEnable": false,
            "subAccountId": "367537027503435242"
        }

      ],
  "timestamp": 1583127900000

}

Query Subaccount Futures Asset info

GET /sapi/v1/broker/subAccount/futuresSummary

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
page LONG NO default 1
size LONG NO default 10, max 20
recvWindow LONG NO
timestamp LONG YES
  • If subaccountId is not sent, the size must be sent

Response:

{

  data:[

       {
           "futuresEnable": true, // if enable futures
           "subAccountId": "367537027503425913",
            "totalInitialMarginOfUsdt": "0.03558521",  //  initial margin
            "totalMaintenanceMarginOfUsdt": "0.02695000", // maintenance margin 
            "totalWalletBalanceOfUsdt": "8.23222312", //  wallet balance
            "totalUnrealizedProfitOfUsdt": "-0.78628370", //  unrealized profit
            "totalMarginBalanceOfUsdt": "8.23432343",  // margin balance 
            "totalPositionInitialMarginOfUsdt": "0.33683000", // position initial margin 
            "totalOpenOrderInitialMarginOfUsdt": "0.00000000" // open order initial margin

        },
        { 
            "futuresEnable": false,
            "subAccountId": "36753702750323432"
        }

      ],
  "timestamp": 1583127900000

}

Query Subaccount Futures Asset info (V2)

GET /sapi/v2/broker/subAccount/futuresSummary

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
futuresType INT YES 1:USDT Margined Futures, 2:COIN Margined Futures
page LONG NO default 1
size LONG NO default 10, max 20
recvWindow LONG NO
timestamp LONG YES

Response:

USDT Margined Futures:

{

  data:[

       {
           "futuresEnable": true, // if enable futures
           "subAccountId": "367537027503425913",
            "totalInitialMarginOfUsdt": "0.03558521",  //  initial margin
            "totalMaintenanceMarginOfUsdt": "0.02695000", // maintenance margin 
            "totalWalletBalanceOfUsdt": "8.23222312", //  wallet balance
            "totalUnrealizedProfitOfUsdt": "-0.78628370", //  unrealized profit
            "totalMarginBalanceOfUsdt": "8.23432343",  // margin balance 
            "totalPositionInitialMarginOfUsdt": "0.33683000", // position initial margin 
            "totalOpenOrderInitialMarginOfUsdt": "0.00000000" // open order initial margin

        },
        { 
            "futuresEnable": false,
            "subAccountId": "36753702750323432"
        }

      ],
  "timestamp": 1583127900000

}

COIN Margined Futures:

{

  data:[

       {
           "futuresEnable": true, // if enable futures
           "subAccountId": "444016824578949121",
            "totalWalletBalanceOfUsdt": "0.03558521", 
            "totalUnrealizedProfitOfUsdt": "0.02695000", 
            "totalMarginBalanceOfUsdt": "8.23222312"

        },
        { 
            "futuresEnable": false,
            "subAccountId": "36753702750323432"
        }

      ],
  "timestamp": 1583127900000

}

Query Subaccount Futures Asset info (V3)

GET /sapi/v3/broker/subAccount/futuresSummary

Parameters:

Name Type Mandatory Description
subAccountId STRING NO
futuresType INT YES 1:USD Margined Futures, 2:COIN Margined Futures
page LONG NO default 1
size LONG NO default 10, max 20
recvWindow LONG NO
timestamp LONG YES

Response:

USDT Margined Futures:

{

  data:[

       {
            "subAccountId":"1”,
            "totalInitialMargin":"0.0000000000”,  //  initial margin
            "totalMaintenanceMargin":"0.0000000000”,  // maintenance margin 
            "totalWalletBalance":"577.6799732808”,  //  wallet balance
            "totalUnrealizedProfit":"0.0000000000”,  //  unrealized profit
            "totalMarginBalance":"577.6799732808”,  // margin balance
            "totalPositionInitialMargin":"0.0000000000”,  // position initial margin 
            "totalOpenOrderInitialMargin":"0.0000000000”,  // open order initial margin
            "futuresEnable":true,  // if enable futures
            "asset":”USD"
        },
        { 
            "futuresEnable": false,
            "subAccountId": "2"
        }

      ],
  "timestamp": 1583127900000

}

COIN Margined Futures:

{

  data:[

       {
            "subAccountId":"1”,
            "totalWalletBalanceOfUsdt":"6.73252085685700”,
            "totalUnrealizedProfitOfUsdt":"0.00000000000000”,
            "totalMarginBalanceOfUsdt":"6.73252085685700”,
            "futuresEnable”:true
        },
        { 
            "futuresEnable": false,
            "subAccountId": "2"
        }

      ],
  "timestamp": 1583127900000

}

Query Broker Futures Commission Rebate Record

GET /sapi/v1/broker/rebate/futures/recentRecord

Parameters:

Name Type Mandatory Description
futuresType LONG YES 1:USDT Futures, 2: Coin Futures
startTime LONG YES
endTime LONG YES
page LONG NO default 1
size LONG NO default 10, max 100
recvWindow LONG NO
timestamp LONG YES

Response:

[
   {
      "subaccountId": "1",
      "income": "0.02063898",
      "asset": "USDT",
      "symbol": "ETHUSDT",
      "tradeId": 123456,
      "time": 1544433328000,  
      "status": 1
    },
    {
      "subaccountId": "2",
      "income": "0.02060008",
      "asset": "USDT",
      "symbol": "BTCUSDT",
      "tradeId": 223456,
      "time": 1544433328000,
      "status": 1
    }
]
  • Status: 0: Pending, 1: Successful, 2: Failed

Get IP Restriction for Sub Account Api Key

GET /sapi/v1/broker/subAccountApi/ipRestriction

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
subAccountApiKey STRING YES
recvWindow LONG NO
timestamp LONG YES

Response:

  {
      "subaccountId": "1",
      "ipRestrict": true,  
      "apikey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
      "ipList": [
      "54.128.193.23",
      "542.234.192.290"
     ],
      "updateTime": 1544433328000  
  }

Delete IP Restriction for Sub Account Api Key

DELETE /sapi/v1/broker/subAccountApi/ipRestriction/ipList

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
subAccountApiKey STRING YES
ipAddress STRING NO
recvWindow LONG NO
timestamp LONG YES

Response:

  {
      "subaccountId": "1",
      "apikey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
      "ipList": [
      "54.128.193.28"
      ],
      "updateTime": 1544433328000  
  }

Universal Transfer

POST /sapi/v1/broker/universalTransfer

Parameters:

Name Type Mandatory Description
fromId STRING NO
toId STRING NO
fromAccountType STRING YES SPOT,USDT_FUTURE,COIN_FUTURE
toAccountType STRING YES SPOT,USDT_FUTURE,COIN_FUTURE
clientTranId STRING NO Client transfer id, must be unique. The max length is 32 characters
asset STRING YES
amount DECIMAL YES
recvWindow LONG NO
timestamp LONG YES

Caution:

  • You need to enable "internal transfer" option for the api key which requests this endpoint.
  • Transfer from master account if fromId not sent.
  • Transfer to master account if toId not sent.
  • Transfer between futures acount is not supported.

Response:

{
    "txnId":12831061179,
    "clientTranId":"abc"
}

Query Universal Transfer History

GET /sapi/v1/broker/universalTransfer

Parameters:

Name Type Mandatory Description
fromId STRING NO
toId STRING NO
clientTranId STRING NO client transfer id
startTime LONG NO
endTime LONG NO
page INT NO default 1
limit INT NO default 500, max 500
showAllStatus Boolean NO TRUE or FALSE
recvWindow LONG NO
timestamp LONG YES

Caution:

  • Either fromId or toId must be sent.
  • If either fromId or toId is the master account itself, it will not return in response.
  • If showAllStatus is true, the status in response will show four types: INIT,PROCESS,SUCCESS,FAILURE.

Query scope is limited to 100 days:

  • Both startTime and endTime are provided: If it exceeds, the endTime will be re-calculated 100 days after the startTime.
  • Neither startTime nor endTime are provided: Calculate 30 days before today.
  • endTime is not provided: Calculate as Current time.
  • startTime is not provided: Calculate 30 days before endTime.

Response:

[
        {
            "toId":"444016824578949121",
            "asset":"BTC",
            "qty":"0.1",
            "time":1544433328000,
            "status":"SUCCESS",
            "txnId":"12831078279",
            "clientTranId":"abc",
            "fromAccountType": "SPOT",
            "toAccountType": "USDT_FUTURE"
        },
        {
            "toId":"444016824578949121",
            "asset":"USDT",
            "qty":"2",
            "time":1544433328000,
            "status":"SUCCESS",
            "txnId":"296666999",
            "clientTranId":"",
            "fromAccountType": "SPOT",
            "toAccountType": "USDT_FUTURE"
        }
]

Enable Universal Transfer Permission For Sub Account Api Key

POST /sapi/v1/broker/subAccountApi/permission/universalTransfer

Parameters:

Name Type Mandatory Description
subAccountId LONG YES
subAccountApiKey STRING YES
canUniversalTransfer ENUM YES true or false
recvWindow LONG NO
timestamp LONG YES

Caution:

  • This request will enable the api permission for a sub account to use POST /sapi/v1/asset/transferendpoint.
  • You need to enable "trade" option for the api key which requests this endpoint.

Response:

  {
      "subaccountId": "1",
      "apikey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
      "canUniversalTransfer":true      
  }

Update IP Restriction for Sub-Account API key (For Master Account)

POST /sapi/v2/broker/subAccountApi/ipRestriction (HMAC SHA256)

Weight(UID):3000

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
subAccountApiKey STRING YES
status STRING YES IP Restriction status. 1 = IP Unrestricted. 2 = Restrict access to trusted IPs only.
ipAddress STRING NO Insert static IP in batch, separated by commas.
recvWindow LONG NO
timestamp LONG YES

Response:

{
    "status": "2", 
    "ipList": [
        "69.210.67.14",
        "8.34.21.10"  //only return if you open IP restriction and input IP address.
    ],
    "updateTime": 1636371437000,
    "apiKey": "k5V49ldtn4tszj6W3hystegdfvmGbqDzjmkCtpTvC0G74WhK7yd4rfCTo4lShf"
}