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

# Get Hris Expense Analytics

> Expense analytics for the Expenses page: spend by month, category, person and country in one currency, with the previous period's spend and the average time to approve.

Required scope: `expenses:read`

## OpenAPI

````yaml api-reference/openapi.json GET /hris/get-hris-expense-analytics
openapi: 3.1.0
info:
  title: Toku API
  version: 1.0.0
servers:
  - url: https://api.toku.com
security:
  - bearerAuth: []
paths:
  /hris/get-hris-expense-analytics:
    get:
      operationId: getHrisExpenseAnalytics
      summary: Get Hris Expense Analytics
      x-toku-required-scope: expenses:read
      description: >-
        Expense analytics for the Expenses page: spend by month, category,
        person and country in one currency, with the previous period's spend and
        the average time to approve.


        Required scope: `expenses:read`
      parameters:
        - name: period
          in: query
          required: false
          schema:
            type: string
            enum:
              - LAST_3_MONTHS
              - LAST_12_MONTHS
              - YEAR_TO_DATE
              - LAST_YEAR
        - name: currencyCode
          in: query
          required: false
          description: >-
            NOTE(ck): a .transform() rule is not mirrored here; TGA still
            enforces it
          schema:
            type: string
            minLength: 1
            maxLength: 10
            pattern: ^[A-Za-z0-9]+$
            description: >-
              NOTE(ck): a .transform() rule is not mirrored here; TGA still
              enforces it
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetHrisExpenseAnalyticsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict
        '429':
          description: Response 429
components:
  schemas:
    GetHrisExpenseAnalyticsResponse:
      type: object
      properties:
        period:
          type: string
          enum:
            - LAST_3_MONTHS
            - LAST_12_MONTHS
            - YEAR_TO_DATE
            - LAST_YEAR
        from:
          type: string
        to:
          type: string
        currencies:
          type: array
          items:
            type: object
            properties:
              currencyCode:
                type: string
              amount:
                type: string
              count:
                type: number
            required:
              - currencyCode
              - amount
              - count
        currencyCode:
          type:
            - string
            - 'null'
        totals:
          type: object
          properties:
            spend:
              type: string
            previousSpend:
              type: string
            pending:
              type: string
            approved:
              type: string
            reimbursed:
              type: string
            count:
              type: number
            people:
              type: number
          required:
            - spend
            - previousSpend
            - pending
            - approved
            - reimbursed
            - count
            - people
        months:
          type: array
          items:
            type: object
            properties:
              month:
                type: string
              amount:
                type: string
            required:
              - month
              - amount
        categories:
          type: array
          items:
            type: object
            properties:
              hrisExpenseCategoryID:
                type:
                  - string
                  - 'null'
              name:
                type: string
              amount:
                type: string
              count:
                type: number
            required:
              - hrisExpenseCategoryID
              - name
              - amount
              - count
        people:
          type: array
          items:
            type: object
            properties:
              roleInOrgID:
                type: string
              name:
                type: string
              amount:
                type: string
              count:
                type: number
            required:
              - roleInOrgID
              - name
              - amount
              - count
        countries:
          type: array
          items:
            type: object
            properties:
              countryCode:
                type:
                  - string
                  - 'null'
              amount:
                type: string
              count:
                type: number
            required:
              - countryCode
              - amount
              - count
        approval:
          type: object
          properties:
            averageHours:
              type:
                - number
                - 'null'
            count:
              type: number
          required:
            - averageHours
            - count
      required:
        - period
        - from
        - to
        - currencies
        - currencyCode
        - totals
        - months
        - categories
        - people
        - countries
        - approval
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
````
