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

# Activities

> Browse and search the activity catalog as an affiliate.

Affiliates access the same activity catalog as resellers but through JWT-authenticated
endpoints. Pricing is converted to the requested currency with affiliate commission applied.

## List activities

```
GET /api/v1/affiliates/users/activities
```

<Note>
  This endpoint is rate-limited. Avoid polling — fetch once per user session and cache locally.
</Note>

### Parameters

| Parameter  | Type    | Default | Description                                   |
| ---------- | ------- | ------- | --------------------------------------------- |
| `currency` | string  | USD     | ISO currency code for pricing                 |
| `search`   | string  | —       | Full-text search across title and description |
| `page`     | integer | 1       | Page number                                   |
| `pageSize` | integer | 10      | Results per page                              |

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.seyaha.net/api/v1/affiliates/users/activities?currency=SAR&search=desert&page=1&pageSize=10" \
    -H "Authorization: Bearer $AFFILIATE_JWT"
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({
    currency: 'SAR',
    search: 'desert',
    page: '1',
    pageSize: '10',
  });
  const res = await fetch(
    `https://api.seyaha.net/api/v1/affiliates/users/activities?${params}`,
    { headers: { 'Authorization': `Bearer ${process.env.AFFILIATE_JWT}` } }
  );
  const { data, pagination } = await res.json();
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "success": 1,
  "data": [
    {
      "_id": "6744810075becd2ef8c140f7",
      "activity_title": "Desert Safari Adventure",
      "main_promo_title": "Experience dune bashing at sunset",
      "categories": ["Adventure", "Outdoor"],
      "currency": "SAR",
      "admin_discount_percentage": 10,
      "variations": [
        {
          "price": {
            "prices": { "adult": 250, "child": 150, "infant": 80 },
            "discount_percentage": 0
          }
        }
      ]
    }
  ],
  "pagination": { "page": 1, "pageSize": 10, "totalCount": 42 }
}
```

***

## Get activity by ID

```
GET /api/v1/affiliates/users/activities/{id}
```

Returns the full activity with variation schedules, itinerary, inclusions, and pickup details.

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.seyaha.net/api/v1/affiliates/users/activities/6744810075becd2ef8c140f7?currency=SAR" \
    -H "Authorization: Bearer $AFFILIATE_JWT"
  ```

  ```javascript Node.js theme={null}
  const res = await fetch(
    `https://api.seyaha.net/api/v1/affiliates/users/activities/${activityId}?currency=SAR`,
    { headers: { 'Authorization': `Bearer ${process.env.AFFILIATE_JWT}` } }
  );
  const { data } = await res.json();
  const activity = data[0];
  ```
</CodeGroup>

The detail response includes `variation.frequency.weekdays` — a map of weekday → time
slots → dates → capacity. Use this to render an availability calendar without an
extra API call.

***

## Translations

If an activity has been translated, the `translation` field contains a map of language
codes to translated fields:

```json theme={null}
"translation": {
  "ar": {
    "activity_title": "رحلة السفاري الصحراوية",
    "description": "..."
  }
}
```

Use the user's locale to pick the right translation at render time.
