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

# Services & Availability

> Public endpoints for the service catalogue, single service lookup, and slot availability.

# Services & Availability

These endpoints expose the public service catalogue and the booking-slot
schedule. All three are **Public** — none of them call `requireSession` or
`requireRole`, so no session cookie is needed.

<Info>
  **Base URL:** `https://theroyalglow.in` · **Auth:** Public (no session). Money
  is an integer in **paise** (`pricePaise: 250000` = ₹2,500.00). Durations are
  whole minutes. All responses use the standard envelope
  `{ "success": true, "data": ... }`.
</Info>

## GET /api/services

Returns the full catalogue: every active service category (ordered by
`displayOrder`) with its active services nested under `services`.

**Minimum role:** Public

```http theme={null}
GET /api/services
```

This endpoint takes no path or query parameters.

### Response

`data.categories` is an array of category objects. Each category carries its own
columns plus a `services` array of the active services that belong to it.

```json theme={null}
{
  "success": true,
  "data": {
    "categories": [
      {
        "id": "cat_haircare01",
        "name": "Hair Care",
        "slug": "hair-care",
        "description": "Cuts, colour, and treatments",
        "serviceType": "salon",
        "displayOrder": 0,
        "isActive": true,
        "createdAt": "2026-05-01T04:30:00.000Z",
        "updatedAt": "2026-05-01T04:30:00.000Z",
        "services": [
          {
            "id": "svc_haircut001",
            "categoryId": "cat_haircare01",
            "name": "Signature Haircut",
            "slug": "signature-haircut",
            "description": "Consultation, wash, cut, and style",
            "durationMinutes": 45,
            "bufferMinutes": 0,
            "pricePaise": 80000,
            "isActive": true,
            "imageUrl": "https://cdn.theroyalglow.in/services/haircut.webp",
            "displayOrder": 0,
            "gemsRedeemable": false,
            "gemsRequired": null,
            "gemsCatalogueOrder": null,
            "createdAt": "2026-05-01T04:30:00.000Z",
            "updatedAt": "2026-05-01T04:30:00.000Z"
          }
        ]
      }
    ]
  }
}
```

### Errors

<AccordionGroup>
  <Accordion title="INTERNAL_ERROR — 500">
    Unexpected/transient failure (e.g. database unreachable). `retryable: true`.
  </Accordion>
</AccordionGroup>

***

## GET /api/services/\[slug]

Returns a single service matched by its unique `slug`.

**Minimum role:** Public

```http theme={null}
GET /api/services/signature-haircut
```

### Path parameters

| Name   | Type     | Required | Description                                               |
| ------ | -------- | -------- | --------------------------------------------------------- |
| `slug` | `string` | Yes      | Path. The service's unique slug (e.g. signature-haircut). |

### Response

```json theme={null}
{
  "success": true,
  "data": {
    "service": {
      "id": "svc_haircut001",
      "categoryId": "cat_haircare01",
      "name": "Signature Haircut",
      "slug": "signature-haircut",
      "description": "Consultation, wash, cut, and style",
      "durationMinutes": 45,
      "bufferMinutes": 0,
      "pricePaise": 80000,
      "isActive": true,
      "imageUrl": "https://cdn.theroyalglow.in/services/haircut.webp",
      "displayOrder": 0,
      "gemsRedeemable": false,
      "gemsRequired": null,
      "gemsCatalogueOrder": null,
      "createdAt": "2026-05-01T04:30:00.000Z",
      "updatedAt": "2026-05-01T04:30:00.000Z"
    }
  }
}
```

### Errors

<AccordionGroup>
  <Accordion title="NOT_FOUND — 404">
    No service exists for the given `slug`.
  </Accordion>

  <Accordion title="INTERNAL_ERROR — 500">
    Unexpected/transient failure. `retryable: true`.
  </Accordion>
</AccordionGroup>

***

## GET /api/availability

Returns the bookable time slots for a single date. Slots are a fixed
30-minute schedule from **10:00 to 21:00** (first slot starts `10:00`, last slot
starts `20:30` and ends `21:00`). Every slot is currently reported as
`available: true`.

**Minimum role:** Public

```http theme={null}
GET /api/availability?date=2026-06-15&branchId=br_rayasandra01
```

### Query parameters

| Name       | Type     | Required | Description                                                                                                            |
| ---------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `date`     | `string` | Yes      | Query. Calendar date in YYYY-MM-DD format. Must be a real date and not earlier than today (compared in IST, UTC+5:30). |
| `branchId` | `string` | Yes      | Query. Non-empty branch id whose configured weekday business hours are used to flag slots.                             |

### Response

```json theme={null}
{
  "success": true,
  "data": {
    "slots": [
      { "startTime": "10:00", "endTime": "10:30", "available": true },
      { "startTime": "10:30", "endTime": "11:00", "available": true },
      { "startTime": "20:30", "endTime": "21:00", "available": true }
    ]
  }
}
```

### Errors

<AccordionGroup>
  <Accordion title="VALIDATION_ERROR — 400">
    `date` is missing, not `YYYY-MM-DD`, not a real calendar date, or in the past;
    or `branchId` is missing/empty.
  </Accordion>

  <Accordion title="INTERNAL_ERROR — 500">
    Unexpected/transient failure. `retryable: true`.
  </Accordion>
</AccordionGroup>


## Related topics

- [API Reference](/content/docs/api-reference.md)
- [SEO & AI Visibility](/content/docs/seo.md)
- [Pages & Routes](/content/docs/pages-and-routes.md)
- [High-Level Design](/content/docs/system-design/high-level-design.md)
