Subaccounts
These endpoints are functional for users who participate in subaccounts feature.
Subaccount Information
- GET
https://api.poloniex.com/subaccounts
Get a list of all the accounts within an Account Group for a user.
Response Field | Data Type | Description |
---|---|---|
accountId | String | external account ID |
accountName | String | name of the account |
accountState | String | account's state |
isPrimary | String | true if account is primary; false if a subaccount |
Example output:
[
{
"accountId": "32b323201-e832-2270-78t4-e25ak408945",
"accountName": "primary Acct",
"accountState": "ACTIVE",
"isPrimary": "true"
},
{
"accountId": "23422vdd1-e832-2270-78t4-2342cl2292",
"accountName": "sub1",
"accountState": "ACTIVE",
"isPrimary": "false"
},
{
"accountId": "56322vdd1-e832-2270-jh45-2342cl6789",
"accountName": "sub2",
"accountState": "ACTIVE",
"isPrimary": "false"
}
]
Subaccount Balances
- GET
https://api.poloniex.com/subaccounts/balances
- GET
https://api.poloniex.com/subaccounts/{id}/balances
/subaccounts/balances
: Get balances information by currency and account type (SPOT and FUTURES) for each account in the account group. This is only functional for a primary user. A subaccount user can call /accounts/balances for SPOT account type and the futures API overview for its FUTURES balances.
Response Field | Data Type | Description |
---|---|---|
accountId | String | external account ID |
accountName | String | name of the account |
accountType | String | currently SPOT or FUTURES |
isPrimary | String | true if account is primary; false if a subaccount |
balances | Json | account's assets |
Response Field | Data Type | Description |
---|---|---|
currency | String | currency name |
available | String | available amount for the currency. can be negative due to margin |
hold | String | frozen amount for the currency |
maxAvailable | String | amount of currency that can be transferred |
Response Field | Data Type | Description |
---|---|---|
currency | String | currency name |
accountEquity | String | equal to margin Balance + unrealised PNL |
unrealisedPNL | String | unrealised profit and loss |
marginBalance | String | equal to positionMargin + orderMargin + frozenFunds + availableBalance |
positionMargin | String | position margin |
orderMargin | String | order margin |
frozenFunds | String | frozen funds |
availableBalance | String | available balance |
pnl | String | realised profit and loss |
Example output:
[
{
"accountId": "32b323201-e832-2270-78t4-e25ak408945",
"accountName": "primary Acct",
"accountType": "SPOT",
"isPrimary": "true",
"balances": [
{
"currency": "USDT",
"available": "100000233",
"hold": "0",
"maxAvailable": "100000233"
},
{
"currency": "LTC",
"available": "999899455.8625",
"hold": "0",
"maxAvailable": "999899455.8625"
}
]
},
{
"accountId": "23422vdd1-e832-2270-78t4-2342cl2292",
"accountName": "sub1",
"accountType": "SPOT",
"isPrimary": "false",
"balances": [
{
"currency": "USDT",
"available": "500",
"hold": "0",
"maxAvailable": "500"
},
{
"currency": "TRX",
"available": "9991.234",
"hold": "0",
"maxAvailable": "9991.234"
}
]
},
{
"accountId": "56322vdd1-e832-2270-jh45-2342cl6789",
"accountName": "sub2",
"accountType": "SPOT",
"isPrimary": "false",
"balances": [
{
"currency": "BTC",
"available": "20000.234",
"hold": "0",
"maxAvailable": "20000.234"
},
{
"currency": "TRX",
"available": "12991.234",
"hold": "0",
"maxAvailable": "129991.234"
}
]
},
{
"accountId": "32b323201-e832-2270-78t4-e25ak408945",
"accountName": "string",
"accountType": "FUTURES",
"isPrimary": "true",
"balances": [
{
"currency": "USDT",
"accountEquity": "200017",
"unrealisedPNL": "0",
"marginBalance": "200017",
"positionMargin": "0",
"orderMargin": "0",
"frozenFunds": "0",
"availableBalance": "200017",
"pnl": "0.0"
}
]
},
{
"accountId": "23422vdd1-e832-2270-78t4-2342cl2292",
"accountName": "sub1",
"accountType": "FUTURES",
"isPrimary": "false",
"balances": [
{
"currency": "USDT",
"accountEquity": "100",
"unrealisedPNL": "0",
"marginBalance": "100",
"positionMargin": "0",
"orderMargin": "0",
"frozenFunds": "0",
"availableBalance": "100",
"pnl": "0.0"
}
]
}
]
/subaccounts/{id}/balances
: Get balances information by currency and account type (SPOT and FUTURES) for a given external accountId in the account group.
Request Parameter | Data Type | Required | Description |
---|---|---|---|
id | String | true | external account ID |
Response fields and balances fields are the same as those of /subaccounts/balances
.
Subaccount Transfer
- POST
https://api.poloniex.com/subaccounts/transfer
Transfer amount of currency from an account and account type to another account and account type among the accounts in the account group. Primary account can transfer to and from any subaccounts as well as transfer between 2 subaccounts across account types. Subaccount can only transfer to the primary account across account types.
Request Parameter | Data Type | Required | Description |
---|---|---|---|
currency | String | true | The currency to transfer, like USDT |
amount | String | true | The amount to transfer |
fromAccountId | String | true | external UID of the from account |
fromAccountType | String | true | from account type (SPOT or FUTURES) |
toAccountId | String | true | external UID of the to account |
toAccountType | String | true | to account type (SPOT or FUTURES) |
Example request:
{
"currency": "USDT",
"amount": "10",
"fromAccountId": "32b323201-e832-2270-78t4-e25ak408945",
"fromAccountType": "SPOT",
"toAccountId": "23422vdd1-e832-2270-78t4-2342cl2292",
"toAccountType": "SPOT"
}
Response Field | Data Type | Description |
---|---|---|
transferId | String | transfer ID |
Example output:
{
"transferId": "228535117"
}
Example output (if transfer not allowed):
{
"code": 250020,
"message": "No permission"
}
Subaccount Transfer Records
- GET
https://api.poloniex.com/subaccounts/transfer
- GET
https://api.poloniex.com/subaccounts/transfer/{id}
Get a list of transfer records of a user. Max interval for start and end time is 6 months. If no start/end time params are specified then records for last 7 days will be returned.
Request Parameter | Data Type | Required | Description |
---|---|---|---|
limit | Integer | false | The max number of records could be returned. Default is 100 and max is 1000 records. |
from | Long | false | it is 'transferId'. The query begin at ‘from', and the default is 0. |
direction | String | false | PRE, NEXT, default is NEXT |
currency | String | false | The transferred currency, like USDT. Default is for all currencies, if not specified. |
fromAccountId | String | false | external UID of the from account |
fromAccountType | String | false | from account type (SPOT or FUTURES) |
toAccountId | String | false | external UID of the to account |
toAccountType | String | false | to account type (SPOT or FUTURES) |
startTime | Long | false | (milliseconds since UNIX epoch) transfers before start time will not be retrieved. |
endTime | Long | false | (milliseconds since UNIX epoch) transfers after end time will not be retrieved. |
Response Field | Data Type | Description |
---|---|---|
id | String | transfer ID |
fromAccountId | String | external UID of the from account |
fromAccountName | String | name of the from account |
fromAccountType | String | from account type (SPOT or FUTURES) |
toAccountId | String | external UID of the to account |
toAccountType | String | to account type (SPOT or FUTURES) |
toAccountName | String | name of the from account |
currency | String | the transferred currency |
amount | String | the transferred amount |
state | String | the state of transfer operation e.g. SUCCESS, PROCESSSING, FAILED |
createTime | Long | the datetime of transfer operation |
Example output:
[
{
"id": "228535117",
"fromAccountId": "32b323201-e832-2270-78t4-e25ak408945",
"fromAccountName": "primary Acct",
"fromAccountType": "SPOT",
"toAccountId": "23422vdd1-e832-2270-78t4-2342cl2292",
"toAccountName": "sub1",
"toAccountType": "SPOT",
"currency": "USDT",
"amount": "111",
"state": "SUCCESS"
"createTime": 1670980921113
},
{
"id": "1328535117",
"fromAccountId": "32b323201-e832-2270-78t4-e25ak408945",
"fromAccountName": "primary Acct",
"fromAccountType": "SPOT",
"toAccountId": "23422vdd1-e832-2270-78t4-2342cl2292",
"toAccountName": "sub2",
"toAccountType": "FUTURES",
"currency": "USDT",
"amount": "111",
"state": "SUCCESS"
"createTime": 1670980921113
}
]
/subaccounts/transfer/{id}
: Get a single transfer record corresponding to the transferId
Request Parameter | Data Type | Required | Description |
---|---|---|---|
id | String | true | transfer ID |
Response fields are the same as those of /subaccounts/transfer
.