---
title: "Pages the store's affiliates by discount."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › affiliate

`GET /v1/stores/{store}/affiliates`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `affiliate:read`

## Path parameters

- `store` (`listAffiliates.path.store`; string, required) — The store's id.

## Query parameters

- `filter` (`listAffiliates.query.filter`; object, optional) — `filter[<field>]=<value>` is an equality, `filter[<field>][<op>]=<value>` names the operator; `in` repeats the parameter.
- `sort` (`listAffiliates.query.sort`; string, optional)
  - one of `"updated"`
- `direction` (`listAffiliates.query.direction`; string, optional)
  - one of `"asc"`, `"desc"`
- `limit` (`listAffiliates.query.limit`; integer, optional)
  - min 1; max 100
- `cursor` (`listAffiliates.query.cursor`; string, optional)
  - maxLength 8192
- `count` (`listAffiliates.query.count`; boolean, optional)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/affiliates' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/affiliates';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/affiliates"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Pages the store's affiliates by discount.

#### Example

```json
{
  "items": [
    {
      "earnings": [
        {
          "currency": "string",
          "exponent": 0,
          "earned": 0,
          "unpaid": 0,
          "paid": 0,
          "commissions": 0,
          "unpaid_commissions": 0
        }
      ],
      "discount": {
        "id": "string",
        "code": "string",
        "name": "string",
        "currency": "string",
        "exponent": 0
      },
      "user_id": "string",
      "amount_earned": 0,
      "percent_earned": 0,
      "token_id": "string",
      "changed_token_id": "string",
      "prior_amount_earned": 0,
      "prior_percent_earned": 0,
      "ended_at": "string",
      "updated_at": "string",
      "discount_id": "string",
      "user": {
        "id": "string",
        "name": "string",
        "email": "string",
        "avatar": "string"
      }
    }
  ],
  "cursor": "string",
  "total": 0,
  "facets": {
    "property1": {
      "property1": 0,
      "property2": 0
    },
    "property2": {
      "property1": 0,
      "property2": 0
    }
  }
}
```

- `items` (`listAffiliates.response.200.items`; array<object>, required)
  - `earnings` (`listAffiliates.response.200.items.earnings`; any of, required)
    - any of: `array<object>`, `null`
  - `discount` (`listAffiliates.response.200.items.discount`; any of, required)
    - any of: `object`, `null`
  - `user_id` (`listAffiliates.response.200.items.user_id`; string, required)
  - `amount_earned` (`listAffiliates.response.200.items.amount_earned`; number, required)
  - `percent_earned` (`listAffiliates.response.200.items.percent_earned`; number, required)
  - `token_id` (`listAffiliates.response.200.items.token_id`; any of, required)
    - any of: `string`, `null`
  - `changed_token_id` (`listAffiliates.response.200.items.changed_token_id`; any of, required)
    - any of: `string`, `null`
  - `prior_amount_earned` (`listAffiliates.response.200.items.prior_amount_earned`; any of, required)
    - any of: `number`, `null`
  - `prior_percent_earned` (`listAffiliates.response.200.items.prior_percent_earned`; any of, required)
    - any of: `number`, `null`
  - `ended_at` (`listAffiliates.response.200.items.ended_at`; any of, required)
    - any of: `string`, `null`
  - `updated_at` (`listAffiliates.response.200.items.updated_at`; any of, required)
    - any of: `string`, `null`
  - `discount_id` (`listAffiliates.response.200.items.discount_id`; string, required)
  - `user` (`listAffiliates.response.200.items.user`; any of, required)
    - any of: `object`, `null`
- `cursor` (`listAffiliates.response.200.cursor`; any of, required)
  - any of: `string`, `null`
- `total` (`listAffiliates.response.200.total`; number, optional)
- `facets` (`listAffiliates.response.200.facets`; map<map<number>>, optional)

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`listAffiliates.response.default.type`; string, required)
  - format `uri`
- `title` (`listAffiliates.response.default.title`; string, required)
- `status` (`listAffiliates.response.default.status`; integer, required)
- `detail` (`listAffiliates.response.default.detail`; string, required)
- `code` (`listAffiliates.response.default.code`; string, optional)
- `context` (`listAffiliates.response.default.context`; object, optional)
- `reached_core` (`listAffiliates.response.default.reached_core`; boolean, optional)
- `core_answer` (`listAffiliates.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/list-affiliates/index.md
