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

# Availability

> Check bookable slots using the calendar view or date-specific endpoint.

Seyaha provides two availability endpoints for resellers — use the calendar for date
picking UIs and the date-specific endpoint to load actual bookable slots.

## Calendar view (month)

```
GET /api/v1/resellers/activities/{id}/variations/{varId}/availability/calendar
```

Returns a lightweight month view showing which dates have bookable slots. Does **not**
return individual slot records — use this to build a date picker and only load slots
for the date the user selects.

<Note>
  Defaults to the current month when `year` and `month` are omitted.
</Note>

### Parameters

| Parameter | Type    | Description                                                            |
| --------- | ------- | ---------------------------------------------------------------------- |
| `year`    | integer | Calendar year (e.g. `2026`)                                            |
| `month`   | integer | Month 1–12                                                             |
| `guests`  | integer | When set, only dates with slots that fit this many guests are included |

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.seyaha.net/api/v1/resellers/activities/$ACTIVITY_ID/variations/$VAR_ID/availability/calendar?year=2026&month=7&guests=2" \
    -H "x-api-token: $RESELLER_TOKEN"
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({ year: '2026', month: '7', guests: '2' });
  const res = await fetch(
    `https://api.seyaha.net/api/v1/resellers/activities/${activityId}/variations/${varId}/availability/calendar?${params}`,
    { headers: { 'x-api-token': process.env.RESELLER_TOKEN } }
  );
  const { data } = await res.json();
  // data.dates → array of { date, status, slot_count }
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "success": 1,
  "data": {
    "year": 2026,
    "month": 7,
    "dates": [
      { "date": "2026-07-10", "status": "AVAILABLE", "slot_count": 3 },
      { "date": "2026-07-15", "status": "LIMITED", "slot_count": 1 },
      { "date": "2026-07-20", "status": "SOLD_OUT", "slot_count": 0 }
    ]
  }
}
```

### Calendar across all variations

To get a unified calendar for an activity (without specifying a variation):

```
GET /api/v1/resellers/activities/{id}/availability/calendar
```

This endpoint also accepts `currency` and returns `min_price` and `variation_ids` per date.

***

## Slots for a specific date

```
GET /api/v1/resellers/activities/{id}/variations/{varId}/availability
```

Returns all bookable time slots for the variation on a given date. Call this after the
user selects a date from the calendar.

### Parameters

| Parameter  | Required | Description                                       |
| ---------- | -------- | ------------------------------------------------- |
| `date`     | Yes      | `YYYY-MM-DD` format                               |
| `currency` | No       | Defaults to SAR                                   |
| `guests`   | No       | Filter to slots with at least this many vacancies |

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.seyaha.net/api/v1/resellers/activities/$ACTIVITY_ID/variations/$VAR_ID/availability?date=2026-07-15&currency=USD&guests=2" \
    -H "x-api-token: $RESELLER_TOKEN"
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({ date: '2026-07-15', currency: 'USD', guests: '2' });
  const res = await fetch(
    `https://api.seyaha.net/api/v1/resellers/activities/${activityId}/variations/${varId}/availability?${params}`,
    { headers: { 'x-api-token': process.env.RESELLER_TOKEN } }
  );
  const { data } = await res.json();
  // data.slots → array of bookable slots
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "success": 1,
  "data": {
    "date": "2026-07-15",
    "variation_id": "6751ad2d7533f379c9a1711b",
    "slots": [
      {
        "slot_id": "slot_001",
        "time": "10:00",
        "status": "AVAILABLE",
        "vacancies": 14,
        "capacity": 20,
        "max_booking": 10,
        "pricing": [
          { "type": "ADULT", "label": "Adult", "price": 120 },
          { "type": "CHILD", "label": "Child", "price": 75 }
        ]
      },
      {
        "slot_id": "slot_002",
        "time": "14:00",
        "status": "LIMITED",
        "vacancies": 2,
        "capacity": 20,
        "max_booking": 10,
        "group_price": 450,
        "pricing": []
      }
    ]
  }
}
```

When `group_price` is non-null, the slot uses flat group pricing. Show `group_price`
rather than per-person `pricing` units in your UI.

## Slot status reference

| Status      | Meaning                              |
| ----------- | ------------------------------------ |
| `AVAILABLE` | Bookable, plenty of capacity         |
| `FREESALE`  | Unlimited capacity — always bookable |
| `LIMITED`   | Bookable but low vacancies           |
| `SOLD_OUT`  | No vacancies left                    |
| `CLOSED`    | Not available for booking            |
