> For the complete documentation index, see [llms.txt](https://docs.compendium.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.compendium.finance/pendax/using-pendax-sdk/blofin-functions/affiliate.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/blofin-functions/affiliate.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
