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

# Get mileage summary

> Returns a summary of mileage statistics grouped by year and month, including total miles, business miles, personal miles, uncategorized miles, trip counts, and estimated deductions.



## OpenAPI

````yaml get /v1/businesses/{businessId}/mileage/summary
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/mileage/summary:
    get:
      tags: []
      summary: Get mileage summary
      description: >-
        Returns a summary of mileage statistics grouped by year and month,
        including total miles, business miles, personal miles, uncategorized
        miles, trip counts, and estimated deductions.
      operationId: business.mileage.summary.get
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business.
          required: true
          schema:
            type: string
            format: uuid
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json.
          schema:
            type: string
        - name: include_deleted
          in: query
          description: Include deleted trips in the summary.
          required: false
          schema:
            type: boolean
            default: false
        - name: purpose
          in: query
          description: >-
            Filter by trip purpose. Can be specified multiple times for multiple
            purposes.
          required: false
          schema:
            type: string
            enum:
              - UNREVIEWED
              - BUSINESS
              - PERSONAL
        - name: vehicle_ids
          in: query
          description: Comma-separated list of vehicle UUIDs to filter by.
          required: false
          schema:
            type: string
        - name: start_date
          in: query
          description: Filter trips on or after this date (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          description: Filter trips on or before this date (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
        - name: year
          in: query
          description: Filter trips by year.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: Mileage summary statistics.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiMileageSummary'
        '404':
          description: Business not found or invalid vehicle_ids.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    ApiMileageSummary:
      type: object
      properties:
        years:
          type: array
          items:
            $ref: '#/components/schemas/ApiMileageYear'
          description: Yearly breakdown of mileage statistics, sorted by year descending.
      required:
        - years
    ApiError:
      type: object
      description: An error object returned in API error responses.
      properties:
        type:
          $ref: '#/components/schemas/ApiErrorType'
          description: >-
            A fixed category for the error, helpful for categorizing and
            processing errors.
        description:
          type: string
          description: A human-readable error description.
        error_enum:
          $ref: '#/components/schemas/ApiEnumErrorType'
          description: >-
            A stable, machine-readable identifier for programmatically handling
            specific error conditions. Only present for 4xx client errors—not
            included for 5xx server errors. Use this instead of parsing the
            description field, as enum values remain stable across API versions.
          nullable: true
        meta:
          type: object
          description: Optional additional information about the error.
          nullable: true
      required:
        - type
        - description
    ApiMileageYear:
      type: object
      properties:
        year:
          type: integer
          description: The year.
        miles:
          type: string
          description: Total miles traveled in this year, as a decimal string.
        business_miles:
          type: string
          description: Total business miles traveled in this year, as a decimal string.
        personal_miles:
          type: string
          description: Total personal miles traveled in this year, as a decimal string.
        uncategorized_miles:
          type: string
          description: >-
            Total uncategorized/unreviewed miles traveled in this year, as a
            decimal string.
        estimated_deduction:
          type: integer
          format: int64
          description: Estimated tax deduction for business miles in this year, in cents.
        trips:
          type: integer
          description: Total number of trips in this year.
        business_trips:
          type: integer
          description: Number of business trips in this year.
        personal_trips:
          type: integer
          description: Number of personal trips in this year.
        uncategorized_trips:
          type: integer
          description: Number of uncategorized/unreviewed trips in this year.
        months:
          type: array
          items:
            $ref: '#/components/schemas/ApiMileageMonth'
          description: Monthly breakdown of mileage statistics for this year.
      required:
        - year
        - miles
        - business_miles
        - personal_miles
        - uncategorized_miles
        - estimated_deduction
        - trips
        - business_trips
        - personal_trips
        - uncategorized_trips
        - months
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementParserError
        - BillStateError
        - BulkCategorizeFailure
        - BulkMatchFailure
        - BusinessTaskAlreadyCompleted
        - BusinessTaskDeleted
        - CalendlyOAuthError
        - CallBookingError
        - CantUpdateTransactionInCustomerPayout
        - CantUpdateTransactionInVendorPayout
        - CheckPayrollConfigNotFound
        - CheckPayrollServiceNotFound
        - ClerkUserAlreadyExists
        - ConflictingQueryParams
        - CustomAccountAlreadyExists
        - CustomTransactionCsvParsingError
        - CustomTransactionUploadFailure
        - CustomerPayoutInputFormatError
        - DoesNotMatchExistingEntity
        - EmptyBatchRequest
        - ExpenseParserError
        - ExternalAccountBalanceReconciliationError
        - ExternalIdConflict
        - InvalidCategory
        - InvalidEffectiveDate
        - InvalidLedgerOperation
        - InvalidMonthlyAverageRange
        - InvalidMultiPartRequest
        - InvalidPaginationCursor
        - InvalidPayload
        - InvoiceDeleted
        - InvoiceNotFound
        - InvoiceReferenceMismatch
        - InvoiceStateError
        - ManualRateLimit
        - MultipleTagKeyFiltersUnsupported
        - NoCognitoUserFound
        - NoOpeningBalanceFound
        - NotYetReconciled
        - OnePasswordApiError
        - OnePasswordItemNotFound
        - OnePasswordVaultNotFound
        - OpenAICategorizationError
        - PaymentLinkInvalid
        - PayrollStateError
        - PeriodIsClosed
        - PeriodNotClosed
        - PhoneNumberAlreadyRegistered
        - PlaidApiError
        - PlaidConnectionBroken
        - PlaidCreateLinkTokenError
        - PlaidCredentialsNotConfigured
        - PlaidExchangePublicTokenError
        - PlaidGetInstitutionByIdError
        - PlaidGetItemError
        - PlaidInvalidEnvironment
        - PlaidItemAlreadyExists
        - PlaidItemNotFound
        - PlaidProcessorApiError
        - PlaidUnlinkItemError
        - QueryParamFormat
        - QueryParamMissing
        - QuickbooksBrokenConnection
        - QuickbooksConnectionAlreadyExists
        - QuickbooksConnectionAlreadySyncing
        - QuickbooksConnectionMissing
        - QuickbooksConnectionNotActivated
        - QuickbooksInvalidRequest
        - QuickbooksInvalidState
        - QuickbooksNoMatchingAccount
        - QuickbooksNonPostingAccountType
        - QuickbooksNotConfigured
        - QuickbooksOAuthCallbackInvalid
        - QuickbooksOAuthError
        - QuickbooksTokenExpired
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
    ApiMileageMonth:
      type: object
      properties:
        month:
          type: integer
          minimum: 1
          maximum: 12
          description: The month number (1-12).
        miles:
          type: string
          description: Total miles traveled in this month, as a decimal string.
        business_miles:
          type: string
          description: Total business miles traveled in this month, as a decimal string.
        personal_miles:
          type: string
          description: Total personal miles traveled in this month, as a decimal string.
        uncategorized_miles:
          type: string
          description: >-
            Total uncategorized/unreviewed miles traveled in this month, as a
            decimal string.
        estimated_deduction:
          type: integer
          format: int64
          description: Estimated tax deduction for business miles in this month, in cents.
        trips:
          type: integer
          description: Total number of trips in this month.
        business_trips:
          type: integer
          description: Number of business trips in this month.
        personal_trips:
          type: integer
          description: Number of personal trips in this month.
        uncategorized_trips:
          type: integer
          description: Number of uncategorized/unreviewed trips in this month.
        deduction_rate:
          type: integer
          format: int64
          description: The IRS standard mileage rate in cents per mile for this month.
      required:
        - month
        - miles
        - business_miles
        - personal_miles
        - uncategorized_miles
        - estimated_deduction
        - trips
        - business_trips
        - personal_trips
        - uncategorized_trips
        - deduction_rate
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````