Class SubAccount
java.lang.Object
com.binance.connector.client.impl.spot.SubAccount
Sub-Account Endpoints
All endpoints under the Sub-Account Endpoint section of the API documentation will be implemented in this class.Response will be returned in String format.
-
Constructor Summary
ConstructorDescriptionSubAccount(String baseUrl, String apiKey, String secretKey, boolean showLimitUsage)
-
Method Summary
Modifier and TypeMethodDescriptionaccountStatus(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/statusaddIpList(LinkedHashMap<String,Object> parameters)
You need to make sure you have used this endpointPOST /sapi/v1/sub-account/subAccountApi/ipRestrictionenabled IP restriction, then you can add IP list by POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList.assets(LinkedHashMap<String,Object> parameters)
Fetch sub-account assets.createVirtualSubAccount(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/virtualSubAccountdeleteIpList(LinkedHashMap<String,Object> parameters)
DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipListdepositAddress(LinkedHashMap<String,Object> parameters)
Fetch sub-account deposit address.depositHistory(LinkedHashMap<String,Object> parameters)
Fetch sub-account deposit history.enableFutures(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/futures/enableenableIpRestriction(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/subAccountApi/ipRestrictionenableLeverageToken(LinkedHashMap<String,Object> parameters)
GET /sapi/v2/sub-account/futures/positionRiskenableMargin(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/margin/enablefuturesAccount(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/futures/accountfuturesAccountSummary(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/futures/accountSummaryfuturesAccountSummaryV2(LinkedHashMap<String,Object> parameters)
GET /sapi/v2/sub-account/futures/accountSummaryfuturesAccountV2(LinkedHashMap<String,Object> parameters)
GET /sapi/v2/sub-account/futures/accountfuturesInternalTransfer(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/futures/internalTransferfuturesPositionRisk(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/futures/positionRiskfuturesPositionRiskV2(LinkedHashMap<String,Object> parameters)
GET /sapi/v2/sub-account/futures/positionRiskfuturesTransfer(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/futures/transfergetFuturesInternalTransfer(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/futures/internalTransfergetIpRestriction(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/subAccountApi/ipRestrictionmanagedSubDeposit(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/managed-subaccount/depositmanagedSubDetails(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/managed-subaccount/assetmanagedSubWithdraw(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/managed-subaccount/withdrawmarginAccount(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/margin/accountmarginAccountSummary(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/margin/accountSummarymarginTransfer(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/margin/transferqueryUniversalTransfer(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/universalTransferspotAccountSummary(LinkedHashMap<String,Object> parameters)
Get BTC valued asset summary of subaccounts.spotTransferHistory(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/sub/transfer/historysubAccountList(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/listsubAccountToMaster(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/transfer/subToMastersubAccountToSubAccount(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/transfer/subToSubtransferHistory(LinkedHashMap<String,Object> parameters)
GET /sapi/v1/sub-account/transfer/subUserHistoryuniversalTransfer(LinkedHashMap<String,Object> parameters)
POST /sapi/v1/sub-account/universalTransfer
-
Constructor Details
-
SubAccount
-
-
Method Details
-
createVirtualSubAccount
POST /sapi/v1/sub-account/virtualSubAccount- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
subAccountString -- mandatory/string -- Please input a string. We will create a virtual email using that string for you to register
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#create-a-virtual-sub-account-for-master-account
-
subAccountList
GET /sapi/v1/sub-account/list- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- optional/string
isFreeze -- optional/string -- true or false
page -- optional/int -- Default value: 1
limit -- optional/int -- Default value: 1, Max value: 200
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-list-for-master-account
-
spotTransferHistory
GET /sapi/v1/sub-account/sub/transfer/history- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
fromEmail -- optional/string
toEmail -- optional/string -- true or false
startTime -- optional/long
endTime -- optional/long
page -- optional/int -- Default value: 1
limit -- optional/int -- Default value: 1, Max value: 200
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-spot-asset-transfer-history-for-master-account
-
getFuturesInternalTransfer
GET /sapi/v1/sub-account/futures/internalTransfer- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string
futuresType -- mandatory/long -- 1:USDT-margined Futures,2: Coin-margined Futures
startTime -- optional/long
endTime -- optional/long
page -- optional/int -- Default value: 1
limit -- optional/int -- Default value: 1, Max value: 200
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-futures-asset-transfer-history-for-master-account
-
futuresInternalTransfer
POST /sapi/v1/sub-account/futures/internalTransfer- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
fromEmail -- mandatory/string -- Sender email
toEmail -- mandatory/string -- Recipient email
futuresType -- mandatory/long -- 1:USDT-margined Futures,2: Coin-margined Futures
asset -- mandatory/string
amount -- mandatory/decimal
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#sub-account-futures-asset-transfer-for-master-account
-
assets
Fetch sub-account assets.
GET /sapi/v3/sub-account/assets- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub account email
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#sub-account-futures-asset-transfer-for-master-account
-
spotAccountSummary
Get BTC valued asset summary of subaccounts.
GET /sapi/v1/sub-account/spotSummary- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- optional/string -- Sub account email
page -- optional/long -- default 1
size -- optional/long -- default 10, max 20
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-spot-assets-summary-for-master-account
-
depositAddress
Fetch sub-account deposit address.
GET /sapi/v1/capital/deposit/subAddress- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub account email
coin -- mandatory/string
network -- optional/string
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-deposit-address-for-master-account
-
depositHistory
Fetch sub-account deposit history.
GET /sapi/v1/capital/deposit/subHisrec- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub account email
coin -- optional/string
status -- optional/int -- 0(0:pending,6: credited but cannot withdraw, 1:success)
startTime -- optional/long
endTime -- optional/long
limit -- optional/int
offset -- optional/int -- default:0
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-deposit-history-for-master-account
-
accountStatus
GET /sapi/v1/sub-account/status- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- optional/string -- Sub account email
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-39-s-status-on-margin-futures-for-master-account
-
enableMargin
POST /sapi/v1/sub-account/margin/enable- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub account email
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#enable-margin-for-sub-account-for-master-account
-
marginAccount
GET /sapi/v1/sub-account/margin/account- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub account email
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-margin-account-for-master-account
-
marginAccountSummary
GET /sapi/v1/sub-account/margin/accountSummary- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-margin-account-for-master-account
-
enableFutures
POST /sapi/v1/sub-account/futures/enable- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#enable-futures-for-sub-account-for-master-account
-
futuresAccount
GET /sapi/v1/sub-account/futures/account- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-futures-account-for-master-account
-
futuresAccountSummary
GET /sapi/v1/sub-account/futures/accountSummary- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-futures-account-for-master-account
-
futuresPositionRisk
GET /sapi/v1/sub-account/futures/positionRisk- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-Account email
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-futures-position-risk-of-sub-account-for-master-account
-
futuresTransfer
POST /sapi/v1/sub-account/futures/transfer- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-Account email
asset -- mandatory/string -- The asset being transferred, e.g., USDT
amount -- mandatory/deciaml -- The amount to be transferred
type -- mandatory/int -- 1: transfer from subaccount's spot account to its USDT-margined futures account 2: transfer from subaccount's USDT-margined futures account to its spot account 3: transfer from subaccount's spot account to its COIN-margined futures account 4:transfer from subaccount's COIN-margined futures account to its spot account- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#futures-transfer-for-sub-account-for-master-account
-
marginTransfer
POST /sapi/v1/sub-account/margin/transfer- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-Account email
asset -- mandatory/string -- The asset being transferred, e.g., USDT
amount -- mandatory/deciaml -- The amount to be transferred
type -- mandatory/int -- 1: transfer from subaccount's spot account to margin account 2: transfer from subaccount's margin account to its spot account- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#margin-transfer-for-sub-account-for-master-account
-
subAccountToSubAccount
POST /sapi/v1/sub-account/transfer/subToSub- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
toEmail -- mandatory/string -- Sub-Account email
asset -- mandatory/string -- The asset being transferred, e.g., USDT
amount -- mandatory/deciaml -- The amount to be transferred
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#transfer-to-sub-account-of-same-master-for-sub-account
-
subAccountToMaster
POST /sapi/v1/sub-account/transfer/subToMaster- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
asset -- mandatory/string -- The asset being transferred, e.g., USDT
amount -- mandatory/deciaml -- The amount to be transferred
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account
-
transferHistory
GET /sapi/v1/sub-account/transfer/subUserHistory- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
asset -- optional/string -- If not sent, result of all assets will be returned
type -- optional/int -- 1: transfer in, 2: transfer out
startTime -- optional/long
endTime -- optional/long
limit -- optional/int -- Default 500
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#sub-account-transfer-history-for-sub-account
-
universalTransfer
POST /sapi/v1/sub-account/universalTransfer- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
fromEmail -- optional/string
toEmail -- optional/string
fromAccountType -- mandatory/string -- "SPOT","USDT_FUTURE","COIN_FUTURE"
toAccountType -- mandatory/string -- "SPOT","USDT_FUTURE","COIN_FUTURE"
asset -- mandatory/string
amount -- mandatory/decimal
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#universal-transfer-for-master-account
-
queryUniversalTransfer
GET /sapi/v1/sub-account/universalTransfer- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
fromEmail -- optional/string
toEmail -- optional/string
startTime -- optional/long
endTime -- optional/long
page -- optional/int -- Default 1
limit -- optional/int -- Default 500, Max 500
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#query-universal-transfer-history-for-master-account
-
futuresAccountV2
GET /sapi/v2/sub-account/futures/account- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
futuresType -- mandatory/int -- 1:USDT Margined Futures, 2:COIN Margined Futures
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-futures-account-v2-for-master-account
-
futuresAccountSummaryV2
GET /sapi/v2/sub-account/futures/accountSummary- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
futuresType -- mandatory/int -- 1:USDT Margined Futures, 2:COIN Margined Futures
page -- optional/int -- default:1
limit -- optional/int -- default:10, max:20
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-futures-account-v2-for-master-account
-
futuresPositionRiskV2
GET /sapi/v2/sub-account/futures/positionRisk- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
futuresType -- mandatory/int -- 1:USDT Margined Futures, 2:COIN Margined Futures
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-futures-position-risk-of-sub-account-v2-for-master-account
-
enableLeverageToken
GET /sapi/v2/sub-account/futures/positionRisk- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
enableBlvt -- mandatory/boolean -- Only true for now
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#enable-leverage-token-for-sub-account-for-master-account
-
enableIpRestriction
POST /sapi/v1/sub-account/subAccountApi/ipRestriction- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
subAccountApiKey -- mandatory/string
ipRestrict -- mandatory/boolean -- true or false
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#enable-or-disable-ip-restriction-for-a-sub-account-api-key-for-master-account
-
getIpRestriction
GET /sapi/v1/sub-account/subAccountApi/ipRestriction- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
subAccountApiKey -- mandatory/string
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#get-ip-restriction-for-a-sub-account-api-key-for-master-account
-
addIpList
You need to make sure you have used this endpointPOST /sapi/v1/sub-account/subAccountApi/ipRestrictionenabled IP restriction, then you can add IP list by POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList.
POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
subAccountApiKey -- mandatory/string
ipAddress -- mandatory/string -- Can be added in batches, separated by commas
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#add-ip-list-for-a-sub-account-api-key-for-master-account
-
deleteIpList
DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string -- Sub-account email
subAccountApiKey -- mandatory/string
ipAddress -- mandatory/string -- Can be added in batches, separated by commas
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#delete-ip-list-for-a-sub-account-api-key-for-master-account
-
managedSubDeposit
POST /sapi/v1/managed-subaccount/deposit- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
toEmail -- mandatory/string
asset -- mandatory/string
amount -- mandatory/decimal
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#deposit-assets-into-the-managed-sub-account-for-investor-master-account
-
managedSubDetails
GET /sapi/v1/managed-subaccount/asset- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
email -- mandatory/string
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#query-managed-sub-account-asset-details-for-investor-master-account
-
managedSubWithdraw
POST /sapi/v1/managed-subaccount/withdraw- Parameters:
parameters
- LinkedHashedMap of String,Object pair where String is the name of the parameter and Object is the value of the parameter
fromEmail -- mandatory/string
asset -- mandatory/string
amount -- mandatory/decimal
transferDate -- optional/decimal -- Withdrawals is automatically occur on the transfer date(UTC0). If a date is not selected, the withdrawal occurs right now
recvWindow -- optional/long- Returns:
- String
- See Also:
- https://binance-docs.github.io/apidocs/spot/en/#withdrawl-assets-from-the-managed-sub-account-for-investor-master-account
-