# Affiliate

## GET Affiliate Info

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

<https://docs.blofin.com/index.html#get-affiliate-info>
{% endhint %}

#### Function Name:

```javascript
getAffiliateInfo()
```

#### Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getAffiliateInfo(myBlofinExchange, 
});
```

## GET Referral Code

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

<https://docs.blofin.com/index.html#get-referral-code>
{% endhint %}

#### Function Name:

```javascript
getReferralCode()
```

#### Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getReferralCode(myBlofinExchange, 
});
```

## GET Direct Invitees

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

<https://docs.blofin.com/index.html#get-direct-invitees>
{% endhint %}

#### Function Name:

```javascript
getDirectInvites()
```

#### Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getDirectInvites(myBlofinExchange, 
});
```

## GET Sub Invitees

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

<https://docs.blofin.com/index.html#get-sub-invitees>
{% endhint %}

#### Function Name:

```javascript
getSubInvitees()
```

#### Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getSubInvitees(myBlofinExchange, 
});
```

## GET Sub Affiliates

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

<https://docs.blofin.com/index.html#get-sub-affiliates>
{% endhint %}

#### Function Name:

```javascript
getSubAffiliates()
```

#### Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getSubAffiliates(myBlofinExchange, 
});
```


---

# 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/blofin-functions/affiliate.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.
