# Sub-Account

## Create a Sub-account(For Master Account)

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#create-a-sub-account-for-master-account>
{% endhint %}

#### Function Name:

```javascript
createSubAccountSpot()
```

#### Usage:

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

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

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

let result = await createSubAccountSpot(myMexcExchanges,
     {
         subAccount: "mikwdn443ksnsadasd",
         note: "1"
     });
```

## Query Sub-account List (For Master Account)

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#query-sub-account-list-for-master-account>
{% endhint %}

#### Function Name:

```javascript
getSubaccountListSpot()
```

#### Usage:

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

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

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

let result = await getSubaccountListSpot(myMexcExchanges);
```

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

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#create-an-apikey-for-a-sub-account-for-master-account>
{% endhint %}

#### Function Name:

```javascript
createSubaccountApiKeySpot()
```

#### Usage:

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

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

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

let result = await createSubaccountApiKeySpot(myMexcExchanges,
         {
             subAccount: "mikwdn443ksnsadasd",
             note: "meat",
             permissions: "SPOT_ACCOUNT_READ"
         });
```

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

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#query-the-apikey-of-a-sub-account-for-master-account>
{% endhint %}

#### Function Name:

```javascript
getSubaccountApiKeySpot()
```

#### Usage:

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

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

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


let result = await getSubaccountApiKeySpot(myMexcExchanges,
         {
             subAccount: "yourSubAccountName"
         });
```

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

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#delete-the-apikey-of-a-sub-account-for-master-account>
{% endhint %}

#### Function Name:

```javascript
deleteSubaccountApiKeySpot()
```

#### Usage:

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

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

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

let result = await deleteSubaccountApiKeySpot(myMexcExchanges,
         {
             subAccount: "22nj5499sn2nv",
             apiKey: "nfl4nfl34nrt3lku4nrl3in4"
         });
```

## Universal Transfer (For Master Account)

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#universal-transfer-for-master-account>
{% endhint %}

#### Function Name:

```javascript
universalTransferSpot()
```

#### Usage:

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

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

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

let result = await universalTransferSpot(myMexcExchanges,
         {
             toAccount: "ddddw3g",
             fromAccountType: "SPOT",
             toAccountType: "SPOT",
             asset: "USDT",
             amount: "10"
         });
```

## Query Universal Transfer History (For Master Account)

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#query-universal-transfer-history-for-master-account>
{% endhint %}

#### Function Name:

```javascript
getUniversalTransferHistorySpot()
```

#### Usage:

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

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

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

let result = await getUniversalTransferHistorySpot(myMexcExchanges,
         {
             toAccount: "22df3tg4yh45y",
             fromAccountType: "SPOT",
             toAccountType: "SPOT"
         });
```


---

# 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/mexc-functions/sub-account.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.
