> ## 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.

# List trips

> Returns a paginated list of trips for the specified business. Trips can be filtered by date range, purpose, vehicle, and search query.



## OpenAPI

````yaml get /v1/businesses/{businessId}/mileage/trips
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/mileage/trips:
    get:
      tags: []
      summary: List trips
      description: >-
        Returns a paginated list of trips for the specified business. Trips can
        be filtered by date range, purpose, vehicle, and search query.
      operationId: business.mileage.trips.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 response.
          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
        - name: q
          in: query
          description: >-
            Search query to filter trips by description, start address, end
            address, or vehicle make/model.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Paginated list of trips.
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ApiTrip'
                  meta:
                    $ref: '#/components/schemas/RequestMetadata'
                required:
                  - data
        '404':
          description: Business not found or invalid vehicle_ids.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    ApiTrip:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be `com.layerfi.routers.ApiTrip`.
          example: com.layerfi.routers.ApiTrip
        id:
          type: string
          format: uuid
          description: The unique identifier of the trip.
        vehicle:
          $ref: '#/components/schemas/ApiVehicle'
          description: The vehicle used for this trip.
        external_id:
          type: string
          nullable: true
          description: An optional external identifier for the trip, used for idempotency.
        distance:
          type: string
          description: The distance traveled in miles, as a decimal string.
        distance_source:
          $ref: '#/components/schemas/TripDistanceSource'
          description: How the trip distance was determined.
        trip_date:
          type: string
          format: date
          description: The date of the trip (YYYY-MM-DD).
        purpose:
          $ref: '#/components/schemas/TripPurpose'
          description: The purpose classification of the trip.
        start_address:
          type: string
          nullable: true
          description: The starting address of the trip.
        end_address:
          type: string
          nullable: true
          description: The ending address of the trip.
        google_start_place_id:
          type: string
          nullable: true
          description: >-
            Google Maps place ID of the trip start address, from the address
            suggestion endpoints.
        google_end_place_id:
          type: string
          nullable: true
          description: >-
            Google Maps place ID of the trip end address, from the address
            suggestion endpoints.
        start_latitude:
          type: string
          nullable: true
          description: Latitude of the start address, as a decimal string.
        start_longitude:
          type: string
          nullable: true
          description: Longitude of the start address, as a decimal string.
        end_latitude:
          type: string
          nullable: true
          description: Latitude of the end address, as a decimal string.
        end_longitude:
          type: string
          nullable: true
          description: Longitude of the end address, as a decimal string.
        description:
          type: string
          nullable: true
          description: An optional description or notes about the trip.
        mileage_deduction_rate:
          type: string
          description: >-
            The IRS standard mileage rate in cents per mile applicable for the
            trip date.
        estimated_deduction:
          type: integer
          format: int64
          description: >-
            The estimated tax deduction in cents. Only calculated for BUSINESS
            trips; returns 0 for PERSONAL and UNREVIEWED trips.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the trip was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the trip was last updated.
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the trip was deleted, or null if not deleted.
      required:
        - id
        - vehicle
        - distance
        - distance_source
        - trip_date
        - purpose
        - mileage_deduction_rate
        - estimated_deduction
        - created_at
        - updated_at
    RequestMetadata:
      type: object
      description: Request metadata. Present on paginated list responses.
      properties:
        type:
          type: string
          description: Metadata type discriminator. Value will be `request_metadata`.
          example: request_metadata
        pagination:
          $ref: '#/components/schemas/PaginationMetadata'
    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
    ApiVehicle:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be `com.layerfi.routers.ApiVehicle`.
          example: com.layerfi.routers.ApiVehicle
        id:
          type: string
          format: uuid
          description: The unique identifier of the vehicle.
        business_id:
          type: string
          format: uuid
          description: The UUID of the business this vehicle belongs to.
        external_id:
          type: string
          nullable: true
          description: >-
            An optional external identifier for the vehicle, used for
            idempotency.
        make_and_model:
          type: string
          description: The make and model of the vehicle (e.g., 'Toyota Camry').
        year:
          type: integer
          description: The model year of the vehicle.
        license_plate:
          type: string
          nullable: true
          description: The license plate number of the vehicle.
        vin:
          type: string
          nullable: true
          description: The Vehicle Identification Number (VIN).
        description:
          type: string
          nullable: true
          description: An optional description or notes about the vehicle.
        is_primary:
          type: boolean
          description: >-
            Whether this is the primary vehicle for the business. Only one
            vehicle can be primary at a time.
        is_eligible_for_deletion:
          type: boolean
          description: >-
            Whether the vehicle can be deleted. A vehicle cannot be deleted if
            it has trips or is archived.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the vehicle was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the vehicle was last updated.
        archived_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the vehicle was archived, or null if not archived.
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the vehicle was deleted, or null if not deleted.
      required:
        - id
        - business_id
        - make_and_model
        - year
        - is_primary
        - is_eligible_for_deletion
        - created_at
        - updated_at
    TripDistanceSource:
      type: string
      enum:
        - MANUAL
        - COMPUTED
      description: >-
        How the trip distance was determined. `MANUAL` means the distance was
        provided explicitly; `COMPUTED` means it was calculated as driving
        distance between `google_start_place_id` and `google_end_place_id`.
    TripPurpose:
      type: string
      enum:
        - UNREVIEWED
        - BUSINESS
        - PERSONAL
      description: >-
        The purpose classification of a trip. UNREVIEWED indicates the trip has
        not been categorized yet, BUSINESS indicates a business-related trip
        eligible for mileage deduction, and PERSONAL indicates a personal trip
        not eligible for deduction.
    PaginationMetadata:
      type: object
      description: >-
        Cursor-based pagination metadata returned alongside paginated list
        responses.
      properties:
        sort_by:
          type: string
          nullable: true
          description: Field the result set is sorted by.
        sort_order:
          type: string
          enum:
            - ASC
            - DESC
          description: Sort direction applied to the result set.
        cursor:
          type: string
          nullable: true
          description: >-
            Opaque cursor to pass as `pagination_cursor` to fetch the next page.
            Null when there are no further pages.
        has_more:
          type: boolean
          description: Whether additional pages are available after the current one.
        total_count:
          type: integer
          format: int64
          nullable: true
          description: Total number of records across all pages, when available.
      required:
        - sort_by
        - sort_order
        - cursor
        - has_more
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````