# Obtaining lists of partner exchanges

### **Available API methods** <a href="#yu87m9grb583" id="yu87m9grb583"></a>

**Base URL**:

```
https://your-domain.com
```

Each endpoint looks like this:

```
https://your-domain.com/api/v1/{endpoint}
```

* All endpoints return **time in Unix-time format**.
* Responses comply with the **JSON:API**.<br>

#### **List of available methods** <a href="#id-9efzos8673te" id="id-9efzos8673te"></a>

* **Retrieving the list of partner exchanges** (referral exchanges):<br>

### **Method: “Get list of partner exchanges”** <a href="#o609rj4qbc74" id="o609rj4qbc74"></a>

#### **Description:** <a href="#id-2vbqtme4pb0o" id="id-2vbqtme4pb0o"></a>

Returns a list of referral exchanges associated with your partner account.

#### **HTTP method used:** <a href="#id-7bu0d3ahu4ap" id="id-7bu0d3ahu4ap"></a>

GET /api/v1/partner/referral-exchanges

**Headers**

| Name      | Value            |
| --------- | ---------------- |
| X-API-Key | `<your_api_key>` |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "data": [
    {
      "type": "referral_exchange",
      "id": 1611085,
      "attributes": {
        "is_completed": true,
        "completed_at": 1691234567,
        "created_at": 1691230000,
        "exchange_currency_in": "USDTTRC20",
        "exchange_currency_out": "BTC",
        "exchange_amount": "0.05000000",
        "referral_reward": "12.50000000",
        "referral_reward_base_currency": "USDT",
        "transition_query_params": {
          "utm_source": "telegram",
          "utm_medium": "referral",
          "utm_campaign": "crypto_exchange_promo",
          "utm_content": "banner_usdt_to_btc",
          "utm_term": "usdt_btc_swap",
          "pid": "1101231"
        }
      }
    }
  ],
  "links": {
    "next_page": "https://your-domain.com/api/v1/partner/referral-exchanges?page=2",
    "previous_page": null
  },
  "counts": {
    "total": 2,
    "last_page": 2
  }
}
```

{% endtab %}

{% tab title="401" %}

```json
{
   "errors":[
      {
         "message":"Invalid API key.",
         "code":"4004"
      }
   ]
}
```

{% endtab %}

{% tab title="422" %}

```json
{
   "errors":[
      {
         "message":"The per page field value must not exceed 200.",
         "code":"0001",
         "field":"perPage"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

#### **Field explanations:** <a href="#id-1q0lu792ubsg" id="id-1q0lu792ubsg"></a>

* is\_completed: whether the exchange has completed (boolean)
* completed\_at: completion time (Unix timestamp)
* created\_at: creation time (Unix timestamp)
* exchange\_currency\_in: currency the customer gives
* exchange\_currency\_out: currency the customer receives
* exchange\_amount: exchange amount
* referral\_reward: referral reward
* referral\_reward\_base\_currency: referral reward base currency
* transition\_query\_params: contains the query parameters passed when a user visits the website through your referral link.\
  You can include your own custom parameters (for example, **UTM tags**) in the referral link - they will be stored in this field.\
  This allows you to track the source, campaign, medium, and other marketing attributes of the referral traffic.
  * **Example:**
    * Base referral link:

      ```
      https://example.com?rid=123
      ```
    * With optional UTM tags:

      ```
      https://example.com?rid=123&utm_source=telegram&utm_medium=referral&utm_campaign=crypto_promo
      ```
