# Sub-Account Managenent

## Create sub-account

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Create+sub-account>
{% endhint %}

#### Function Name:

```javascript
createSubaccount()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function createSubaccount(exchange, options) {
    try {
        let result = await exchange.createSubaccount(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await createSubaccount(myBingxExchange, {
	subAccountString: "<string>",
	recvWindow: "<long>"
});
```

## Query account uid

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+account+uid>
{% endhint %}

#### Function Name:

```javascript
getAccountUid()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getAccountUid(exchange, options) {
    try {
        let result = await exchange.getAccountUid(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getAccountUid(myBingxExchange);
```

## Get sub-account list

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Get+sub-account+list>
{% endhint %}

#### Function Name:

```javascript
getSubAccountList()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubAccountList(exchange, options) {
    try {
        let result = await exchange.getSubAccountList(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubAccountList(myBingxExchange, {
	page: "<int>",
	limit: "<int>"
});
```

## Query sub-account spot assets

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+sub-account+spot+assets>
{% endhint %}

#### Function Name:

```javascript
getSubaccountSpotAssets()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubaccountSpotAssets(exchange, options) {
    try {
        let result = await exchange.getSubaccountSpotAssets(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubaccountSpotAssets(myBingxExchange, {
	subUid: "<long>"
});
```

## Create an API Key for a sub-account

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Create+an+API+Key+for+a+sub-account>
{% endhint %}

#### Function Name:

```javascript
createSubaccountApikey()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function createSubaccountApikey(exchange, options) {
    try {
        let result = await exchange.createSubaccountApikey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await createSubaccountApikey(myBingxExchange, {
	subUid: "<long>",
	note: "<string>",
	permissions: "<Array>"
});
```

## Query the API Key of a sub-account

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+the+API+Key+of+a+sub-account>
{% endhint %}

#### Function Name:

```javascript
getSubaccountApikey()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubaccountApikey(exchange, options) {
    try {
        let result = await exchange.getSubaccountApikey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubaccountApikey(myBingxExchange, {
	uid: "<long>"
});
```

## Reset the API Key of a sub-account

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Reset+the+API+Key+of+a+sub-account>
{% endhint %}

#### Function Name:

```javascript
resetSubaccountApikey()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function resetSubaccountApikey(exchange, options) {
    try {
        let result = await exchange.resetSubaccountApikey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await resetSubaccountApikey(myBingxExchange, {
	subUid: "<long>",
	apiKey: "<string>",
	note: "<string>",
	permissions: "<Array>"
});
```

## Delete the API Key of sub-accounts

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Delete+the+API+Key+of+sub-accounts>
{% endhint %}

#### Function Name:

```javascript
deleteSubaccountApikey()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function deleteSubaccountApikey(exchange, options) {
    try {
        let result = await exchange.deleteSubaccountApikey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await deleteSubaccountApikey(myBingxExchange, {
	subUid: "<long>",
	apiKey: "<string>"
});
```

## Freeze and unfreeze sub-accounts

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Freeze+and+unfreeze+sub-accounts>
{% endhint %}

#### Function Name:

```javascript
setSubaccountFrozen()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function setSubaccountFrozen(exchange, options) {
    try {
        let result = await exchange.setSubaccountFrozen(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await setSubaccountFrozen(myBingxExchange, {
	subUid: "<long>",
	freeze: "<bool>"
});
```

## Authorize sub-account internal transfers

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Authorize+sub-account+internal+transfers>
{% endhint %}

#### Function Name:

```javascript
authorizeSubaccountInternalTransfers()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function authorizeSubaccountInternalTransfers(exchange, options) {
    try {
        let result = await exchange.authorizeSubaccountInternalTransfers(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await authorizeSubaccountInternalTransfers(myBingxExchange, {
	subUids: "<string>",
	transferable: "<boolean>"
});
```

## Sub-account internal transfer

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Sub-account+internal+transfer>
{% endhint %}

#### Function Name:

```javascript
subaccountInternalTransfer()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function subaccountInternalTransfer(exchange, options) {
    try {
        let result = await exchange.subaccountInternalTransfer(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await subaccountInternalTransfer(myBingxExchange, {
	coin: "<string>",
	userAccountType: "<int>",
	userAccount: "<string>",
	amount: "<float64>",
	walletType: "<int>"
});
```

## Create deposit address for sub-account

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Create+deposit+address+for+sub-account>
{% endhint %}

#### Function Name:

```javascript
createSubaccountDepositAddress()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function createSubaccountDepositAddress(exchange, options) {
    try {
        let result = await exchange.createSubaccountDepositAddress(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await createSubaccountDepositAddress(myBingxExchange);
```

## Get sub-account deposit address

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Get+sub-account+deposit+address>
{% endhint %}

#### Function Name:

```javascript
getSubaccountDepositAddress()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubaccountDepositAddress(exchange, options) {
    try {
        let result = await exchange.getSubaccountDepositAddress(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubaccountDepositAddress(myBingxExchange);
```

## Get sub-account deposit records

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Get+sub-account+deposit+records>
{% endhint %}

#### Function Name:

```javascript
getSubaccountDepositRecords()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubaccountDepositRecords(exchange, options) {
    try {
        let result = await exchange.getSubaccountDepositRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubaccountDepositRecords(myBingxExchange);
```

## Query sub-account internal transfer records

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+sub-account+internal+transfer+records>
{% endhint %}

#### Function Name:

```javascript
getSubaccountInternalTransferRecords()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubaccountInternalTransferRecords(exchange, options) {
    try {
        let result = await exchange.getSubaccountInternalTransferRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubaccountInternalTransferRecords(myBingxExchange, {
	coin: "<string>"
});
```

## Query Sub-Account Transfer History (For Master Account Operations Only)

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+Sub-Account+Transfer+History+(For+Master+Account+Operations+Only)>
{% endhint %}

#### Function Name:

```javascript
getSubaccsferHistory()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubaccsferHistory(exchange, options) {
    try {
        let result = await exchange.getSubaccsferHistory(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubaccsferHistory(myBingxExchange);
```

## Query the transferable amount of funds in the parent-child account (only for parent account operations).

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+the+transferable+amount+of+funds+in+the+parent-child+account+(only+for+parent+account+operations).>
{% endhint %}

#### Function Name:

```javascript
getTransferableParentChildFunds()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getTransferableParentChildFunds(exchange, options) {
    try {
        let result = await exchange.getTransferableParentChildFunds(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getTransferableParentChildFunds(myBingxExchange);
```

## Sub-Account Asset Transfer Interface (For Master Account Operations Only)

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Sub-Account+Asset+Transfer+Interface+(For+Master+Account+Operations+Only)>
{% endhint %}

#### Function Name:

```javascript
subaccountAssetTransfer()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function subaccountAssetTransfer(exchange, options) {
    try {
        let result = await exchange.subaccountAssetTransfer(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await subaccountAssetTransfer(myBingxExchange);
```

## Asset overview

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Asset+overview>
{% endhint %}

#### Function Name:

```javascript
getAssetOverview()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getAssetOverview(exchange, options) {
    try {
        let result = await exchange.getAssetOverview(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getAssetOverview(myBingxExchange);
```

## Batch inquiry of sub account asset overview

{% hint style="info" %}
Please refer to the official BingX API Docs for the Required parameters.

<https://bingx-api.github.io/docs/#/en-us/common/sub-account#Batch+inquiry+of+sub+account+asset+overview>
{% endhint %}

#### Function Name:

```javascript
getSubaccountAssetOverviewBatchInquiry()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getSubaccountAssetOverviewBatchInquiry(exchange, options) {
    try {
        let result = await exchange.getSubaccountAssetOverviewBatchInquiry(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getSubaccountAssetOverviewBatchInquiry(myBingxExchange);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/bingx-functions/sub-account-managenent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
