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

# Get daily summaries for a barber

> Retrieve per-day appointment counts and earnings for the barber across
a requested date range. Only the owning barber or a system
administrator can read these metrics; the range must not exceed 30
days.



## OpenAPI

````yaml /api-reference/Barbers/openapi.yaml get /barbers/{id}/summaries/daily
openapi: 3.0.0
info:
  title: Barbers
  version: 0.1.0
  contact:
    name: Guile Engineering
    url: https://www.guile.app
    email: engineering@guile.app
  license:
    name: MIT
    url: https://opensource.org/license/mit
  description: The Barbers API provides operations for barbers on the Guile platform.
servers:
  - url: https://api.guile.app
    variables: {}
  - url: https://guile.fly.dev
    variables: {}
security: []
tags:
  - name: Barbers
    description: Barber profiles, schedules, and settings
paths:
  /barbers/{id}/summaries/daily:
    get:
      tags:
        - Barbers
      summary: Get daily summaries for a barber
      description: |-
        Retrieve per-day appointment counts and earnings for the barber across
        a requested date range. Only the owning barber or a system
        administrator can read these metrics; the range must not exceed 30
        days.
      operationId: getBarberDailySummaries
      parameters:
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/resourceId'
        - name: dates
          in: query
          required: true
          description: >-
            Filter summaries by date range. The date range must not exceed 30
            days.
          schema:
            $ref: '#/components/schemas/dateRange'
          explode: false
      responses:
        '200':
          description: |-
            Ok.
            The operation succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/barberDailySummaries'
        '400':
          description: >-
            Bad Request.

            The request body, request headers, and/or query parameters are not
            well-formed.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/badRequest](https://docs.guile.app/problems/badRequest)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '401':
          description: >-
            Unauthorized.

            The operation requires authentication but no authentication or
            insufficient authentication was given.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/unauthorized](https://docs.guile.app/problems/unauthorized)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '403':
          description: >-
            Forbidden.

            The authenticated caller is not authorized to perform the requested
            operation.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/forbidden](https://docs.guile.app/problems/forbidden)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '404':
          description: >-
            Not Found.

            There is no such resource at the request URL.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/notFound](https://docs.guile.app/problems/notFound)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '422':
          description: >-
            Unprocessable Entity.

            The request body and/or query parameters were well-formed but
            otherwise invalid.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/unprocessableEntity](https://docs.guile.app/problems/unprocessableEntity)

            *
            [https://docs.guile.app/problems/invalidDateRange](https://docs.guile.app/problems/invalidDateRange)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '429':
          description: >-
            Too Many Requests.

            The client has sent too many requests in a given amount of time.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/tooManyRequests](https://docs.guile.app/problems/tooManyRequests)
          headers:
            Retry-After:
              required: true
              description: The number of seconds to wait before retrying the request.
              schema:
                type: integer
                format: uint32
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
      security:
        - BearerAuth: []
components:
  schemas:
    resourceId:
      type: string
      description: >-
        The unique, opaque system identifier for a resource.

        This case-sensitive ID is also used as path parameters in URLs or in
        other

        properties or parameters that reference a resource by ID rather than
        URL.
    dateRange:
      type: string
      maxLength: 24
      pattern: >-
        ^(\d{4}-\d{2}-\d{2}|[\[(](\d{4}-\d{2}-\d{2},(\d{4}-\d{2}-\d{2})?|,\d{4}-\d{2}-\d{2})[)\]])$
      description: >-
        A date range, supporting inclusive or exclusive endpoints.

        Dates ranges use dates expressed in `YYYY-MM-DD` [RFC
        3339](https://tools.ietf.org/html/rfc3339)

        `date` format.

        The value may have the following forms:

        - `YYYY-MM-DD` match the date exactly; equivalent to matching dates in
        the range `[YYYY-MM-DD,YYYY-MM-DD]`

        - `[YYYY-MM-DD,YYYY-MM-DD]` between two dates, inclusive of the
        endpoints

        - `(YYYY-MM-DD,YYYY-MM-DD)` between two dates, exclusive of the
        endpoints

        - `[YYYY-MM-DD,]` on or after the date

        - `(YYYY-MM-DD,)` after the date

        - `[,YYYY-MM-DD]` before or on the date

        - `(,YYYY-MM-DD)` before the date


        Examples:

        - '2022-05-19'

        - '[2022-05-01,2022-05-31]'

        - '[2022-05-01,2022-06-01)'

        - '[2022-05-19,]'

        - '(2022-05-19,)'

        - '[,2022-05-19]'

        - '(,2022-05-19)'.
    barberDailySummaries:
      type: object
      required:
        - items
        - count
        - appointments
        - earnings
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/barberDailySummary'
          description: List of daily summaries.
        count:
          type: integer
          format: int32
          minimum: 0
          description: The total number of days in the summary.
        appointments:
          allOf:
            - $ref: '#/components/schemas/barberDailyAppointmentSummary'
          description: Appointment counts for the day or requested date range.
        earnings:
          allOf:
            - $ref: '#/components/schemas/barberDailyEarningsSummary'
          description: Earnings totals for the day or requested date range.
      description: Collection of daily summaries for a barber.
    apiProblem:
      type: object
      required:
        - type
        - title
        - occurredAt
        - id
        - status
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/uri'
          description: A URI reference that identifies the problem type.
        title:
          type: string
          maxLength: 120
          description: >-
            A short, human-readable summary of the problem type. The title is
            usually the same for all

            problems with the same `type`.
        occurredAt:
          type: string
          format: date-time
          description: >-
            The date-time when this problem occurred, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date-time `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived
            and immutable.
        detail:
          type: string
          maxLength: 256
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: >-
            The unique identifier for this problem. This is an immutable opaque
            string.
        status:
          allOf:
            - $ref: '#/components/schemas/statusCode'
          description: >-
            The [HTTP status
            code](https://datatracker.ietf.org/doc/html/rfc7231#section-6)for
            this

            occurrence of the problem.
        instance:
          allOf:
            - $ref: '#/components/schemas/uri'
          maxLength: 2048
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem. This is the URI of an

            API resource that the problem is related to, with a unique error
            correlation ID URI fragment.
        attributes:
          type: object
          additionalProperties: {}
          description: >-
            Additional optional attributes related to the problem. This data
            conforms to the schema

            associated with the error type.
        recovery:
          allOf:
            - $ref: '#/components/schemas/clientFailureRecovery'
          description: The recovery contract for this problem occurrence.
        problems:
          type: array
          items:
            $ref: '#/components/schemas/problem'
          maxItems: 128
          description: |-
            Optional root-causes if there are multiple problems in the request
            or API call processing.
      description: >-
        API problem or error response, as per

        [RFC 9457
        application/problem+json](https://tools.ietf.org/html/rfc9457).
    barberDailySummary:
      type: object
      required:
        - date
        - appointments
        - earnings
      properties:
        date:
          type: string
          format: date
          description: The date for this summary.
        appointments:
          allOf:
            - $ref: '#/components/schemas/barberDailyAppointmentSummary'
          description: Appointment counts for the day or requested date range.
        earnings:
          allOf:
            - $ref: '#/components/schemas/barberDailyEarningsSummary'
          description: Earnings totals for the day or requested date range.
      description: Daily summary metrics for a barber.
    barberDailyAppointmentSummary:
      type: object
      required:
        - total
        - confirmed
        - pending
        - completed
        - cancellations
        - noShows
        - unpaid
        - failedPayment
        - totalDuration
      properties:
        total:
          type: integer
          format: int16
          minimum: 0
          description: The total number of appointments.
        confirmed:
          type: integer
          format: int16
          minimum: 0
          description: Number of confirmed appointments.
        pending:
          type: integer
          format: int16
          minimum: 0
          description: Number of pending appointments.
        pendingRequests:
          type: integer
          format: int16
          minimum: 0
          description: >-
            Number of appointments awaiting the barber's booking decision. This
            is

            separate from appointments pending card confirmation. Absent when an

            older server has not classified pending appointments.
        pendingRequestValue:
          allOf:
            - $ref: '#/components/schemas/money'
          description: >-
            Sum of `bookingRequest.value.total` for approval-pending booking

            requests. This includes preserved service value, off-hours fees, and

            tip intent, but excludes taxes and platform fees. Absent when an
            older

            server has not classified pending appointments.
        rejectedRequests:
          type: integer
          format: int16
          minimum: 0
          description: Number of booking requests rejected by the barber.
        expiredRequests:
          type: integer
          format: int16
          minimum: 0
          description: >-
            Number of booking requests expired by the server-owned approval
            deadline.
        completed:
          type: integer
          format: int16
          minimum: 0
          description: Number of completed appointments.
        cancellations:
          type: integer
          format: int16
          minimum: 0
          description: Number of cancelled appointments.
        noShows:
          type: integer
          format: int16
          minimum: 0
          description: Number of no-show appointments.
        unpaid:
          type: integer
          format: int16
          minimum: 0
          description: Number of completed appointments that are unpaid.
        failedPayment:
          type: integer
          format: int16
          minimum: 0
          description: Number of appointments with a failed payment.
        totalDuration:
          type: integer
          format: int32
          minimum: 0
          description: Total duration across all completed appointments in minutes.
      description: Appointment counts for a barber daily summary.
    barberDailyEarningsSummary:
      type: object
      required:
        - total
        - tips
        - cash
        - card
      properties:
        total:
          allOf:
            - $ref: '#/components/schemas/money'
          description: Total earnings from completed appointments, excluding tips.
        tips:
          allOf:
            - $ref: '#/components/schemas/money'
          description: Total tips received from completed appointments.
        productSales:
          type: string
          allOf:
            - $ref: '#/components/schemas/money'
          nullable: true
          description: Total product sales. Null when product sales are not yet computed.
        fees:
          type: string
          allOf:
            - $ref: '#/components/schemas/money'
          nullable: true
          description: >-
            Total fees applied to completed appointments. Null when fees are not
            yet computed.
        cash:
          allOf:
            - $ref: '#/components/schemas/money'
          description: Earnings collected in cash from completed appointments.
        card:
          allOf:
            - $ref: '#/components/schemas/money'
          description: >-
            Earnings collected by card from completed appointments. Captured
            card payments only, excluding uncaptured holds.
      description: Earnings totals for a barber daily summary.
    uri:
      type: string
      maxLength: 1024
      format: uri
      description: A URI reference to an internal or external resource.
    statusCode:
      type: integer
      format: uint16
      minimum: 100
      maximum: 599
      description: The HTTP status code for a response.
    clientFailureRecovery:
      type: object
      required:
        - outcome
        - retry
      properties:
        outcome:
          allOf:
            - $ref: '#/components/schemas/clientFailureOutcome'
          description: The known outcome of the request.
        retry:
          allOf:
            - $ref: '#/components/schemas/clientRetryDirective'
          description: The safe retry action for the request.
        sessionAction:
          allOf:
            - $ref: '#/components/schemas/clientSessionAction'
          description: The session action required before the request can continue.
        rateLimit:
          allOf:
            - $ref: '#/components/schemas/rateLimit'
          description: The rate limit state that prevented the request.
      description: The recovery contract for a failed client request.
    problem:
      type: object
      required:
        - type
        - title
        - occurredAt
        - id
        - status
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/uri'
          description: A URI reference that identifies the problem type.
        title:
          type: string
          maxLength: 120
          description: >-
            A short, human-readable summary of the problem type. The title is
            usually the same for all

            problems with the same `type`.
        occurredAt:
          type: string
          format: date-time
          description: >-
            The date-time when this problem occurred, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date-time `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived
            and immutable.
        detail:
          type: string
          maxLength: 256
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: >-
            The unique identifier for this problem. This is an immutable opaque
            string.
        status:
          allOf:
            - $ref: '#/components/schemas/statusCode'
          description: >-
            The [HTTP status
            code](https://datatracker.ietf.org/doc/html/rfc7231#section-6)for
            this

            occurrence of the problem.
        instance:
          allOf:
            - $ref: '#/components/schemas/uri'
          maxLength: 2048
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem. This is the URI of an

            API resource that the problem is related to, with a unique error
            correlation ID URI fragment.
        attributes:
          type: object
          additionalProperties: {}
          description: >-
            Additional optional attributes related to the problem. This data
            conforms to the schema

            associated with the error type.
      description: >-
        Standard problem or error response, as per

        [RFC 9457
        application/problem+json](https://tools.ietf.org/html/rfc9457).
    money:
      type: string
      pattern: ^-?(0|[1-9][0-9]*)\.[0-9][0-9]$
      format: decimal
      description: >-
        A monetary amount in the lowest denomination for the given currency.

        The numeric value is represented as a string so that it can be exact
        with no

        loss of precision. Values may be positive or negative.
      example: '456.78'
    clientFailureOutcome:
      type: string
      enum:
        - notApplied
        - unknown
      description: The known outcome of a failed client request.
    clientRetryDirective:
      type: string
      enum:
        - doNotRetry
        - retrySameRequest
        - retrySameRequestAfterDelay
      description: The safe retry action for a failed client request.
    clientSessionAction:
      type: string
      enum:
        - refresh
        - signIn
      description: The session action required before a failed request can continue.
    rateLimit:
      type: object
      required:
        - limit
        - remaining
        - resetsAt
      properties:
        limit:
          type: integer
          format: uint64
          description: The maximum number of requests allowed in the active window.
        remaining:
          type: integer
          format: uint64
          description: The number of requests remaining in the active window.
        resetsAt:
          type: string
          format: date-time
          description: >-
            The date-time when the active window resets, in [RFC
            3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC.
      description: The rate limit state for the request.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````