# Availability

Ask for the available slots when the customer has chosen a service, and again each time they
move to another week. A slot is a time the customer can book. This is step 2 of the
[booking flow](https://developers.cliento.com/docs/widget-api/booking-flow.md).

## Fetch slots

```
GET /resources/slots?srvIds={serviceIds}&resIds={resourceIds}&fromDate={date}&toDate={date}
```

Returns the available slots for the given services, resources and date range.

**Request**

| Parameter | Required | Format | Description |
| --- | --- | --- | --- |
| `srvIds` | Yes | Comma separated service ids | The selected service, plus any addon services |
| `resIds` | No | Comma separated resource ids | Limit the search to specific resources. Omit to search all resources that can perform the service |
| `fromDate` | Yes | `YYYY-MM-DD` | First date to search |
| `toDate` | Yes | `YYYY-MM-DD` | Last date to search |

The date range can be at most 31 days. Search one calendar week at a time,
like the booking widget does.

```bash
curl "{baseUrl}/resources/slots?srvIds=68811&resIds=12816&fromDate=2026-10-26&toDate=2026-11-01"
```

**Response 200**

```json
{
  "resourceSlots": [
    {
      "hashId": "Q45V5W",
      "slots": [
        {
          "key": "MzE3MToxMjgxNjo2ODgxMToxNzkzMzQ3MjAwMDAwOjQ1OmZhbHNlOjU5NS4wMDpOVUxMOg",
          "date": "2026-10-30",
          "time": "09:00:00",
          "length": 45,
          "resource": "",
          "resourceId": 12816,
          "serviceIds": [68811],
          "price": 595.0,
          "priceFrom": false,
          "notAvailable": false,
          "maxSlots": 1,
          "bookedSlots": 0,
          "resourceHashId": "Q45V5W"
        }
      ]
    }
  ],
  "nextAvailable": null
}
```

The example is shortened to one slot.

Slots are grouped per resource in `resourceSlots`. Times are local to the
account's time zone (see `timeZone` in [settings](https://developers.cliento.com/docs/widget-api/reference-data.md#fetch-settings)).
When you search several resources, the same start time can appear once per
resource. Deduplicate by `date` and `time` if your UI does not show who
performs the service.

| Field | Description |
| --- | --- |
| `key` | Opaque identifier for the slot. Pass it unchanged to [reserve](https://developers.cliento.com/docs/widget-api/booking.md#reserve-a-slot) |
| `date`, `time`, `length` | Start date, start time and length in minutes |
| `price`, `priceFrom` | Price for the selected services with this resource. `priceFrom` means the price is a starting price |
| `notAvailable` | The time is shown but cannot be booked. Skip these slots |
| `maxSlots`, `bookedSlots` | Capacity information, used for class bookings with more than one seat |
| `resourceId`, `resourceHashId` | The resource this slot belongs to |

When the range has no available slots, `nextAvailable` is the next date
that has one. Use it to jump your calendar forward instead of searching week by
week.

Slot availability changes constantly, so do not cache slot responses. A slot is
only guaranteed once it is [reserved](https://developers.cliento.com/docs/widget-api/booking.md#reserve-a-slot).
