Puzzle Metrics API

The Metrics API from Puzzle — 5 operation(s) for metrics.

OpenAPI Specification

puzzle-metrics-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Puzzle Api Accounts Metrics API
  description: Puzzle Api
  version: '0'
servers:
- url: https://staging.southparkdata.com/rest/v0
tags:
- name: Metrics
paths:
  /company/{id}/metrics/expenses:
    get:
      operationId: expenseMetrics
      summary: Get Expense Metrics
      description: 'Retrieves a summary of a company''s expenses for a given time span, broken into chunks as specified in the ''interval'' param


        Currently only the ''month'' interval is supported, but will soon support ''quarter'' and ''year''.


        The array of metrics will be returned in ascending order from earliest time interval to latest.


        Required scope: read:company'
      tags:
      - Metrics
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
      - name: startDate
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: endDateExclusive
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: interval
        in: query
        required: false
        schema:
          type: string
          enum:
          - month
          description: The value is normalized before matching, so any casing that maps onto a listed value is accepted.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      properties:
                        totalExpenses:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        totalOperatingExpenses:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        timePeriod:
                          type: object
                          properties:
                            startDate:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                            endDateExclusive:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                          required:
                          - startDate
                          - endDateExclusive
                      required:
                      - totalExpenses
                      - totalOperatingExpenses
                      - timePeriod
                required:
                - metrics
  /company/{id}/metrics/categorization:
    get:
      operationId: categorizationMetrics
      summary: Get Categorization Metrics
      description: 'Retrieves categorization metrics for the company.


        Required scope: read:company'
      tags:
      - Metrics
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
      - name: startDate
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: endDateExclusive
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: interval
        in: query
        required: false
        schema:
          type: string
          enum:
          - month
          description: The value is normalized before matching, so any casing that maps onto a listed value is accepted.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      properties:
                        timePeriod:
                          type: object
                          properties:
                            startDate:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                            endDateExclusive:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                          required:
                          - startDate
                          - endDateExclusive
                        dataCompletenessLevel:
                          type: string
                          enum:
                          - Complete
                          - High
                          - Medium
                          - Low
                        percentDollarVolumeCategorized:
                          type: number
                      required:
                      - timePeriod
                      - dataCompletenessLevel
                      - percentDollarVolumeCategorized
                required:
                - metrics
  /company/{id}/metrics/revenue:
    get:
      operationId: revenueMetrics
      summary: Get Revenue Metrics
      description: 'Retrieves a summary of a company''s revenue for a given time span, broken into chunks as specified in the ''interval'' param. We will soon support additional revenue metrics such as ARR and accrual-based ARR.


        Currently only the ''month'' interval is supported, but will soon support ''quarter'' and ''year''.


        The array of metrics will be returned in ascending order from earliest time interval to latest.


        Required scope: read:company'
      tags:
      - Metrics
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
      - name: startDate
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: endDateExclusive
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: interval
        in: query
        required: false
        schema:
          type: string
          enum:
          - month
          description: The value is normalized before matching, so any casing that maps onto a listed value is accepted.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      properties:
                        timePeriod:
                          type: object
                          properties:
                            startDate:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                            endDateExclusive:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                          required:
                          - startDate
                          - endDateExclusive
                        annualizedRevenue:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        totalRevenue:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        totalCostOfRevenue:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        totalGrossProfit:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                      required:
                      - timePeriod
                      - annualizedRevenue
                      - totalRevenue
                      - totalCostOfRevenue
                      - totalGrossProfit
                required:
                - metrics
  /company/{id}/metrics/employee:
    get:
      operationId: employeeMetrics
      summary: Get Employee Metrics
      description: 'Retrieves a summary of a company''s employees for a given time span, broken into chunks as specified in the ''interval'' param. The metrics are currently across all departments. We will support filtering by department in the near future.


        Currently only the ''month'' interval is supported, but will soon support ''quarter'' and ''year''.


        The array of metrics will be returned in ascending order from earliest time interval to latest.


        Required scope: read:company'
      tags:
      - Metrics
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
      - name: startDate
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: endDateExclusive
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: interval
        in: query
        required: false
        schema:
          type: string
          enum:
          - month
          description: The value is normalized before matching, so any casing that maps onto a listed value is accepted.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      properties:
                        averageFullyLoadedSalaryCostPerEmployee:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        averageSalaryCostPerEmployee:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        totalSalaryExpense:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        totalFullyLoadedSalaryExpense:
                          type: object
                          properties:
                            amount:
                              type: string
                              minLength: 1
                              description: Arbitrary-precision decimal, serialized as a string
                            currency:
                              type: string
                              minLength: 3
                              maxLength: 3
                              description: ISO 4217 currency code
                          required:
                          - amount
                          - currency
                          description: A monetary amount with its currency
                        timePeriod:
                          type: object
                          properties:
                            startDate:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                            endDateExclusive:
                              type: string
                              minLength: 1
                              description: Calendar date, YYYY-MM-DD
                          required:
                          - startDate
                          - endDateExclusive
                      required:
                      - averageFullyLoadedSalaryCostPerEmployee
                      - averageSalaryCostPerEmployee
                      - totalSalaryExpense
                      - totalFullyLoadedSalaryExpense
                      - timePeriod
                required:
                - metrics
  /company/{id}/metrics/spending:
    get:
      operationId: spendingMetrics
      summary: Get Spending Metrics
      description: 'Retrieves payroll and non-payroll spending metrics for the given period range. Provide startPeriod and endPeriod in YYYY-MM format.


        Required scope: read:company'
      tags:
      - Metrics
      parameters:
      - name: id
        in: path
        required: true
        description: The company ID
        schema:
          type: string
          minLength: 1
      - name: startDate
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: endDateExclusive
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          description: Calendar date, YYYY-MM-DD
      - name: interval
        in: query
        required: false
        schema:
          type: string
          enum:
          - month
          description: The value is normalized before matching, so any casing that maps onto a listed value is accepted.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  startPeriod:
                    type: string
                  endPeriod:
                    type: string
                  payrollMetrics:
                    type: array
                    items:
                      type: object
                      properties:
                        period:
                          type: string
                        payrollSpending:
                          type: object
                          properties:
                            departments:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  amount:
                                    type: object
                                    properties:
                                      amount:
                                        type: string
                                        minLength: 1
                                        description: Arbitrary-precision decimal, serialized as a string
                                      currency:
                                        type: string
                                        minLength: 3
                                        maxLength: 3
                                        description: ISO 4217 currency code
                                    required:
                                    - amount
                                    - currency
                                    description: A monetary amount with its currency
                                  headCount:
                                    type: integer
                                required:
                                - name
                                - amount
                                - headCount
                            numericSummary:
                              type: object
                              properties:
                                netPay:
                                  type: object
                                  properties:
                                    amount:
                                      type: string
                                      minLength: 1
                                      description: Arbitrary-precision decimal, serialized as a string
                                    currency:
                                      type: string
                                      minLength: 3
                                      maxLength: 3
                                      description: ISO 4217 currency code
                                  required:
                                  - amount
                                  - currency
                                  description: A monetary amount with its currency
                                employerTaxes:
                                  type: object
                                  properties:
                                    amount:
                                      type: string
                                      minLength: 1
                                      description: Arbitrary-precision decimal, serialized as a string
                                    currency:
                                      type: string
                                      minLength: 3
                                      maxLength: 3
                                      description: ISO 4217 currency code
                                  required:
                                  - amount
                                  - currency
                                  description: A monetary amount with its currency
                                employeeTaxes:
                                  type: object
                                  properties:
                                    amount:
                                      type: string
                                      minLength: 1
                                      description: Arbitrary-precision decimal, serialized as a string
                                    currency:
                                      type: string
                                      minLength: 3
                                      maxLength: 3
                                      description: ISO 4217 currency code
                                  required:
                                  - amount
                                  - currency
                                  description: A monetary amount with its currency
                                benefits:
                                  type: object
                                  properties:
                                    amount:
                                      type: string
                                      minLength: 1
                                      description: Arbitrary-precision decimal, serialized as a string
                                    currency:
                                      type: string
                                      minLength: 3
                                      maxLength: 3
                                      description: ISO 4217 currency code
                                  required:
                                  - amount
                                  - currency
                                  description: A monetary amount with its currency
                                employeeBenefitsDeductions:
                                  type: object
                                  properties:
                                    amount:
                                      type: string
                                      minLength: 1
                                      description: Arbitrary-precision decimal, serialized as a string
                                    currency:
                                      type: string
                                      minLength: 3
                                      maxLength: 3
                                      description: ISO 4217 currency code
                                  required:
                                  - amount
                                  - currency
                                  description: A monetary amount with its currency
                                contractorNetPay:
                                  type: object
                                  properties:
                                    amount:
                                      type: string
                                      minLength: 1
                                      description: Arbitrary-precision decimal, serialized as a string
                                    currency:
                                      type: string
                                      minLength: 3
                                      maxLength: 3
                                      description: ISO 4217 currency code
                                  required:
                                  - amount
                                  - currency
                                  description: A monetary amount with its currency
                              required:
                              - netPay
                              - employerTaxes
                              - employeeTaxes
                              - benefits
                              - employeeBenefitsDeductions
                              - contractorNetPay
                              nullable: true
                          required:
                          - departments
                          - numericSummary
                      required:
                      - period
                      - payrollSpending
                  nonPayrollMetrics:
                    type: array
                    items:
                      type: object
                      properties:
                        period:
                          type: string
                        nonPayrollSpending:
                          type: object
                          properties:
                            topVendors:
                              type: array
                              items:
                                type: object
                                properties:
                                  vendor:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                        minLength: 1
                                        description: Partner-facing external identifier
                                      name:
                                        type: string
                                      is1099Vendor:
                                        type: string
                                        enum:
                                        - 'Yes'
                                        - 'No'
                                        - Unknown
                                    required:
                                    - id
                                    - name
                                    - is1099Vendor
                                    nullable: true
                                  amount:
                                    type: object
                                    properties:
                                      amount:
                                        type: string
                                        minLength: 1
                                        description: Arbitrary-precision decimal, serialized as a string
                                      currency:
                                        type: string
                                        minLength: 3
                                        maxLength: 3
                                        description: ISO 4217 currency code
                                    required:
                                    - amount
                                    - currency
                                    description: A monetary amount with its currency
                                  count:
                                    type: integer
                                required:
                                - vendor
                                - amount
                                - count
                            topCategories:
                              type: array
                              items:
                                type: object
                                properties:
                                  ledgerCoaKey:
                                    type: string
                                  amount:
                                    type: object
                                    properties:
                                      amount:
                                        type: string
                                        minLength: 1
                                        description: Arbitrary-precision decimal, serialized as a string
                                      currency:
                                        type: string
                                        minLength: 3
                                        maxLength: 3
                                        description: ISO 4217 currency code
                                    required:
                                    - amount
                                    - currency
                                    description: A monetary amount with its currency
                                  count:
                                    type: integer
                                required:
                                - ledgerCoaKey
                                - amount
                                - count
                            allOtherVendors:
                              type: object
                              properties:
                                amount:
                                  type: string
                                  minLength: 1
                                  description: Arbitrary-precision decimal, serialized as a string
                                currency:
                                  type: string
                                  minLength: 3
                                  maxLength: 3
                                  description: ISO 4217 currency code
                              required:
                              - amount
                              - currency
                              description: A monetary amount with its currency
                            allOtherCategories:
                              type: object
                              properties:
                                amount:
                                  type: string
                         

# --- truncated at 32 KB (33 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/puzzle/refs/heads/main/openapi/puzzle-metrics-api-openapi.yml