# Rebate

## Get Rebate History Records

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#get-rebate-history-records>
{% endhint %}

#### Function Name:

```javascript
getRebateHistoryRecords()
```

#### Usage:

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

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

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

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

## Get Rebate Records Detail

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#get-rebate-records-detail>
{% endhint %}

#### Function Name:

```javascript
getRebateRecordsDetail()
```

#### Usage:

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

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

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

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

## Get Self Rebate Records Detail

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#get-self-rebate-records-detail>
{% endhint %}

#### Function Name:

```javascript
getSelfRebateRecordsDetail()
```

#### Usage:

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

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

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

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

## Query ReferCode

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#query-refercode>
{% endhint %}

#### Function Name:

```javascript
getReferCode()
```

#### Usage:

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

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

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

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


---

# 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/rebate.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.
