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 Margin for Sub Account

POST /sapi/v1/broker/subAccount/margin

Parameters:

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

Response:

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

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

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.

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

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", 
    "apiey":"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": 10,
            "takerCommission": 10,
            "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":10,
            "takerCommission":10,
            "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.

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": 15,
    "takerCommission": 15,
    "marginMakerCommission": 15,
    "marginTakerCommission": 15
}

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",
        "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
    },
    {   
        "subAccountId": 1,
        "symbol": "ETHUSDT",
        "makerAdjustment": 100,
        "takerAdjustment": 100,
        "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",
        "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
    },
    {   
        "subAccountId": 1,
        "pair": "ETHUSD",
        "makerAdjustment": 100,
        "takerAdjustment": 100,
        "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":20,
    "minMakerCommission":5,
    "maxTakerCommission":20,
    "minTakerCommission":5,
    "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
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.

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
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,
    "transfer":[
        {
            "fromId":"",  // master account
            "toId":"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 YES
startTime LONG YES
endTime LONG YES
page LONG NO default 1
size LONG NO default 500,max500
recvWindow LONG NO
timestamp LONG YES
  • Only get the latest history of past 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: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
offest INT NO Default:0
recvWindow LONG NO
timestamp LONG YES
  • Please notice the default startTime and endTime to make sure that time interval is within 0-7 days.

  • If both startTime and endTime are sent, time between startTime and endTime must be less than 7 days.

Response:

[

  {

    "subaccountId": "1",
    "address": "0xddc66e4313fd6c737b6cae67cad90bb4e0ac7092",
    "addressTag": "",
    "amount": "139.04370000",
    "coin": "USDT",
    "insertTime": 1566791463000,
    "network": "ETH",
    "status": 1,
    "txId": "0x5759dfe9983a4c7619bce9bc736bb6c26f804091753bf66fa91e7cd5cfeebafd",     
    "sourceAddress":"xxxxxxxxxxxxxx"
    "confirmTimes":"12/12"

  },

  {

    "subaccountId": "2",
    "address": "0xddc66e4313fd6c737b6cae67kld90bb4e0ac7092",
    "addressTag": "",
    "amount": "1589.12345678",
    "coin": "BTC",
    "insertTime": 1566791463000,
    "network": "BNB",
    "status": 1,
    "txId": "0x5759dfe9983a4c7619bsdltixngbb6c26f804091753bf66fa91e7cd5cfeebafd",
    "sourceAddress":"xxxxxxxxxxxxxx"
    "confirmTimes":"12/12"
    }

],

Query Sub Account Spot Asset info

GET /sapi/v1/broker/subAccount/spotSummary

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:[

       {
           "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

}

Enable Leverage Token for Sub Account

POST /sapi/v1/broker/subAccount/blvt

Parameters:

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

Response:

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

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

Enable or Disable IP Restriction for Sub Account Api Key

POST /sapi/v1/broker/subAccountApi/ipRestriction

Parameters:

Name Type Mandatory Description
subAccountId STRING YES
subAccountApiKey STRING YES
ipRestrict BOOLEAN YES True or False
recvWindow LONG NO
timestamp LONG YES

Response:

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

Add IP Restriction for Sub Account Api Key

POST /sapi/v1/broker/subAccountApi/ipRestriction/ipList

Parameters:

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

Response:

  {
      "subaccountId": "1",
      "apikey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
      "ip":"54.128.193.23",
      "updateTime": 1544433328000  
  }

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 YES
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
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. Return fromId equal master account by default.
  • Only get the latest history of past 30 days.
  • If showAllStatus is true, the status in response will show four types: INIT,PROCESS,SUCCESS,FAILURE.

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      
  }

Enable Vanilla Options Permission For Sub Account Api Key

POST /sapi/v1/broker/subAccountApi/permission/vanillaOptions

Parameters:

Name Type Mandatory Description
subAccountId LONG YES
subAccountApiKey STRING YES
canVanillaOptions ENUM YES true or false
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",
      "canVanillaOptions": true     
  }