# Get the upcoming business hours schedule.

URL: https://docs.dixa.io/openapi/dixa-api/v1/business-hours/getbusiness-hoursschedulesscheduleidupcoming

Get the resolved business hours schedule for the next number of days, applying recurring rules and exceptions. Each entry in `businessHours` describes one upcoming day (see its `nextDate`). An entry with `status: Open` lists the intervals during which the business is open on that day; between and outside those intervals it is closed. An entry with `status: Closed` is a day explicitly configured as closed and has no intervals. Days without any configured business hours are omitted from the response entirely, so `businessHours` can be empty when no day in the requested window has configured hours. In short: the business is open only during the intervals of `status: Open` entries, and closed at all other times.

## GET /v1/business-hours/schedules/{scheduleId}/upcoming

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/business-hours/schedules/{scheduleId}/upcoming?days=7' \
  -H 'Authorization: <API token>'
```

### Response examples

#### 200

Days open with a single interval:

```json
{
  "data": {
    "schedule": {
      "id": "a0d559bf-cdf8-4088-841d-f3807b93272e",
      "name": "Schedule 1",
      "timezone": "Europe/Copenhagen",
      "businessHours": [
        {
          "name": "Monday",
          "dayOfWeek": 1,
          "businessHourType": "Regular",
          "status": "Open",
          "intervals": [
            {
              "startTime": "08:00",
              "endTime": "16:00"
            }
          ],
          "startDate": "2026-01-05",
          "nextDate": "2026-05-25"
        },
        {
          "name": "Tuesday",
          "dayOfWeek": 2,
          "businessHourType": "Regular",
          "status": "Open",
          "intervals": [
            {
              "startTime": "08:00",
              "endTime": "16:00"
            }
          ],
          "startDate": "2026-01-06",
          "nextDate": "2026-05-26"
        }
      ]
    }
  }
}
```

Split hours (closed 12:00-13:00) and an explicitly closed day:

```json
{
  "data": {
    "schedule": {
      "id": "a0d559bf-cdf8-4088-841d-f3807b93272e",
      "name": "Schedule 1",
      "timezone": "Europe/Copenhagen",
      "businessHours": [
        {
          "name": "Monday",
          "dayOfWeek": 1,
          "businessHourType": "Regular",
          "status": "Open",
          "intervals": [
            {
              "startTime": "08:00",
              "endTime": "12:00"
            },
            {
              "startTime": "13:00",
              "endTime": "17:00"
            }
          ],
          "startDate": "2026-01-05",
          "nextDate": "2026-05-25"
        },
        {
          "name": "Sunday",
          "dayOfWeek": 7,
          "businessHourType": "Regular",
          "status": "Closed",
          "intervals": [],
          "startDate": "2026-01-04",
          "nextDate": "2026-05-31"
        }
      ]
    }
  }
}
```

No day in the requested window has configured hours:

```json
{
  "data": {
    "schedule": {
      "id": "a0d559bf-cdf8-4088-841d-f3807b93272e",
      "name": "Schedule 1",
      "timezone": "Europe/Copenhagen",
      "businessHours": []
    }
  }
}
```

#### 400 Invalid value for: path parameter scheduleId, Invalid value for: query parameter days, Invalid value extracted from request context

```json
{
  "message": "Invalid value in request"
}
```

#### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

#### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## OpenAPI definition

The operation and the schemas used, from the full spec at https://docs.dixa.io/openapi-specs/dixa-v1.yaml. Request and response examples are above.

```yaml
openapi: 3.0.3
info:
  title: Dixa API
  version: v1
servers:
  - url: https://dev.dixa.io
security:
  - ApiKeyAuth: []
paths:
  /v1/business-hours/schedules/{scheduleId}/upcoming:
    get:
      tags:
        - Business Hours
      summary: Get the upcoming business hours schedule.
      description: "Get the resolved business hours schedule for the next number of
        days, applying recurring rules and exceptions. Each entry in
        `businessHours` describes one upcoming day (see its `nextDate`). An
        entry with `status: Open` lists the intervals during which the business
        is open on that day; between and outside those intervals it is closed.
        An entry with `status: Closed` is a day explicitly configured as closed
        and has no intervals. Days without any configured business hours are
        omitted from the response entirely, so `businessHours` can be empty when
        no day in the requested window has configured hours. In short: the
        business is open only during the intervals of `status: Open` entries,
        and closed at all other times."
      operationId: getBusiness-hoursSchedulesScheduleidUpcoming
      parameters:
        - name: scheduleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: days
          in: query
          description: Number of upcoming days to include in the response. Must be between
            1 and 90.
          required: false
          schema:
            default: 7
            type: integer
            format: int32
            minimum: 1
            maximum: 90
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetUpcomingBusinessHoursScheduleOutput"
        "400":
          description: "Invalid value for: path parameter scheduleId, Invalid value for:
            query parameter days, Invalid value extracted from request context"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    GetUpcomingBusinessHoursScheduleOutput:
      title: GetUpcomingBusinessHoursScheduleOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/GetUpcomingBusinessHoursScheduleResult"
    GetUpcomingBusinessHoursScheduleResult:
      title: GetUpcomingBusinessHoursScheduleResult
      type: object
      required:
        - schedule
      properties:
        schedule:
          $ref: "#/components/schemas/BusinessHoursUpcomingSchedule"
    BusinessHoursUpcomingSchedule:
      title: BusinessHoursUpcomingSchedule
      type: object
      required:
        - id
        - name
        - timezone
      properties:
        id:
          type: string
        name:
          type: string
        timezone:
          type: string
        businessHours:
          type: array
          items:
            $ref: "#/components/schemas/BusinessHour"
    BusinessHour:
      title: BusinessHour
      type: object
      required:
        - name
        - businessHourType
        - status
        - startDate
      properties:
        name:
          type: string
        dayOfWeek:
          type: integer
          format: int32
        businessHourType:
          $ref: "#/components/schemas/BusinessHourType"
        status:
          $ref: "#/components/schemas/BusinessHourStatus1"
        intervals:
          type: array
          items:
            $ref: "#/components/schemas/TimeInterval1"
        recurring:
          $ref: "#/components/schemas/Recurring1"
        startDate:
          type: string
        nextDate:
          type: string
    BusinessHourType:
      title: BusinessHourType
      oneOf:
        - $ref: "#/components/schemas/Exception1"
        - $ref: "#/components/schemas/Holiday1"
        - $ref: "#/components/schemas/Regular2"
    Exception1:
      title: Exception
      type: object
    Holiday1:
      title: Holiday
      type: object
    Regular2:
      title: Regular
      type: object
    BusinessHourStatus1:
      title: BusinessHourStatus
      oneOf:
        - $ref: "#/components/schemas/Closed1"
        - $ref: "#/components/schemas/Open1"
    Closed1:
      title: Closed
      type: object
    Open1:
      title: Open
      type: object
    TimeInterval1:
      title: TimeInterval
      type: object
      required:
        - startTime
        - endTime
      properties:
        startTime:
          type: string
        endTime:
          type: string
    Recurring1:
      title: Recurring
      type: object
      properties:
        dayOfMonth:
          type: integer
          format: int32
        monthOfYear:
          type: integer
          format: int32
        holiday:
          type: string
    BadRequest:
      title: BadRequest
      type: object
      required:
        - message
      properties:
        message:
          type: string
    NotFound:
      title: NotFound
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ServerError:
      title: ServerError
      type: object
      required:
        - message
      properties:
        message:
          type: string
```
