Skip to main content

Sub-Account Endpoints

Create a Sub-account(For Master Account)

Create a sub-account from the master account.

Response

{
"subAccount":"mexc1",
"note":"1"
}
  • POST / api/v3/sub-account/virtualSubAccount

Permission: SPOT_ACCOUNT_READ

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
subAccountSTRINGYESSub-account Name
noteSTRINGYESSub-account notes
recvWindowLONGNO
timestampLONGYES

Query Sub-account List (For Master Account)

Get details of the sub-account list

Response

{
"subAccounts":[
{
"subAccount":"mexc666",
"isFreeze":false,
"createTime":1544433328000,
"uid": "49910511"
},
{
"subAccount":"mexc888",
"isFreeze":false,
"createTime":1544433328000,
"uid": "91921059"
}
]
}
  • GET / api/v3/sub-account/list

Permission: SPOT_ACCOUNT_READ

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
subAccountSTRINGNOSub-account Name
isFreezeSTRINGNOtrue or false
pageINTNODefault value: 1
limitINTNODefault value: 10, Max value: 200
timestampLONGYES
recvWindowLONGNO

Response:

NameDescription
subAccountsubAccount name
isFreezeisFreeze
createTimecreateTime
uidsubaccount uid

Create an APIKey for a sub-account (For Master Account)

Response

    {
"subAccount": "mexc1",
"note": "1",
"apiKey": "arg13sdfgs",
"secretKey": "nkjwn21973ihi",
"permissions": "SPOT_ACCOUNT_READ",
"ip": "135.181.193",
"creatTime": 1597026383085
}
  • POST /api/v3/sub-account/apiKey

Permission: SPOT_ACCOUNT_READ

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
subAccountSTRINGYESSub-account Name
noteSTRINGYESAPIKey note
permissionsSTRINGYESPermission of APIKey:
SPOT_ACCOUNT_READ,
SPOT_ACCOUNT_WRITE,
SPOT_DEAL_READ,
SPOT_DEAL_WRITE,
CONTRACT_ACCOUNT_READ,
CONTRACT_ACCOUNT_WRITE,
CONTRACT_DEAL_READ,
CONTRACT_DEAL_WRITE,
SPOT_TRANSFER_READ,
SPOT_TRANSFER_WRITE
ipSTRINGNOLink IP addresses, separate with commas if more than one. Support up to 20 addresses.
recvWindowLONGNO
timestampLONGYES

Query the APIKey of a sub-account (For Master Account)

Applies to master accounts only

Response

   {
"subAccount":[
{
"note":"v5",
"apiKey":"arg13sdfgs",
"permissions":"SPOT_ACCOUNT_READ,SPOT_ACCOUNT_WRITE",
"ip":"1.1.1.1,2.2.2.2",
"creatTime":1597026383085
},
{
"note":"v5.1",
"apiKey":"arg13sdfgs12",
"permissions":"SPOT_ACCOUNT_READ,SPOT_ACCOUNT_WRITE",
"ip":"1.1.1.1,2.2.2.2",
"creatTime":1597026383085
}
]
}
  • GET/api/v3/sub-account/apiKey

Permission: SPOT_ACCOUNT_READ

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
subAccountSTRINGYESSub-account Name
recvWindowLONGNO
timestampLONGYES

Delete the APIKey of a sub-account (For Master Account)

Response

  {
"subAccount":"mexc1"
}
  • DELETE /api/v3/sub-account/apiKey

Permission: SPOT_ACCOUNT_READ

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
subAccountSTRINGYESSub-account Name
apiKeySTRINGYESAPI public key
recvWindowLONGNO
timestampLONGYES

Universal Transfer (For Master Account)

Request

post /api/v3/capital/sub-account/universalTransfer

Response

 {
"tranId":11945860693
}
  • POST /api/v3/capital/sub-account/universalTransfer

Permission: SPOT_TRANSFER_WRITE

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
fromAccountstringNOTransfer from master account by default if fromAccount is not sent
toAccountstringNOTransfer to master account by default if toAccount is not sent
fromAccountTypestringYESfromAccountType:"SPOT","FUTURES"
toAccountTypestringYEStoAccountType:"SPOT","FUTURES"
assetstringYESasset,eg:USDT
amountstringYESamount,eg:1.82938475
timestampstringYEStimestamp
signaturestringYESsign

Response:

NameTypeDescription
tranIdstringtransfer ID

Query Universal Transfer History (For Master Account)

Request

get /api/v3/capital/sub-account/universalTransfer

Response

  {
"tranId":"11945860693",
"fromAccount":"master@test.com",
"toAccount":"subaccount1@test.com",
"clientTranId":"test",
"asset":"BTC",
"amount":"0.1",
"fromAccountType":"SPOT",
"toAccountType":"FUTURE",
"fromSymbol":"SPOT",
"toSymbol":"FUTURE",
"status":"SUCCESS",
"timestamp":1544433325000
}
  • GET /api/v3/capital/sub-account/universalTransfer

Permission: SPOT_TRANSFER_READ

Weight(IP): 1

Parameters:

NameTypeMandatoryDescription
fromAccountstringNOTransfer from master account by default if fromAccount is not sent
toAccountstringNOTransfer to master account by default if toAccount is not sent
fromAccountTypestringYESfromAccountType:"SPOT","FUTURES"
toAccountTypestringYEStoAccountType:"SPOT","FUTURES"
startTimestringNOstartTime
endTimestringNOendTime
pagestringNOdefault 1
limitstringNOdefault 500, max 500
timestampstringYEStimestamp
signaturestringYESsign

Response:

NameTypeDescription
tranIdstringtransfer ID
fromAccountstringfromAccount
toAccountstringtoAccount
clientTranIdstringclientTranId
assetstringasset
amountstringtransfer amount
fromAccountTypestringfromAccountType
toAccountTypestringtoAccountType
fromSymbolstringfromSymbol
toSymbolstringtoSymbol
statusstringstatus
timestampnumbertimestamp

Query Sub-account Asset

request

get /api/v3/sub-account/asset?subAccount=account1&accountType=SPOT&timestamp={{timestamp}}&signature={{signature}}

response

{
"balances": [
{
"asset": "MX",
"free": "3",
"locked": "0"
},
{
"asset": "BTC",
"free": "0.0003",
"locked": "0"
}
]
}
  • GET /api/v3/sub-account/asset

Permission: SPOT_TRANSFER_READ

Weight(IP): 1

request

NameTypeMandatoryDescription
subAccountstringYessubAccount name,only support query for single subaccount
accountTypestringYesaccount type:"SPOT","FUTURES",only support SPOT currently
timestampstringYestimestamp
signaturestringYessignature

response

NameTypeDescription
balancesstringbalance
assetstringasset
freestringfree
lockedstringlocked