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

# Get financial summary with trends

> 
        Retrieve financial summary with revenue, expenses, and profit trends.

        **Returns:**
        - Overall summary: Total revenue, expenses, and profit for the entire period
        - Trends: Period-by-period breakdown (monthly, quarterly, or yearly)

        **Granularity options:**
        - `monthly` (default): Show data per month
        - `quarterly`: Show data per quarter (Q1, Q2, Q3, Q4)
        - `yearly`: Show data per year

        All values are in cents. Currency is the business's base currency.
        



## OpenAPI

````yaml GET /v1/platform/businesses/{business_id}/insights/financial-summary/
openapi: 3.0.3
info:
  title: Thredfi Accounting Platform API
  version: 1.0.0
  description: >-
    Comprehensive API for accounting, invoice management, open banking, and
    intelligence services.
servers: []
security: []
paths:
  /v1/platform/businesses/{business_id}/insights/financial-summary/:
    get:
      tags:
        - Insights
      summary: Get financial summary with trends
      description: |2-

                Retrieve financial summary with revenue, expenses, and profit trends.

                **Returns:**
                - Overall summary: Total revenue, expenses, and profit for the entire period
                - Trends: Period-by-period breakdown (monthly, quarterly, or yearly)

                **Granularity options:**
                - `monthly` (default): Show data per month
                - `quarterly`: Show data per quarter (Q1, Q2, Q3, Q4)
                - `yearly`: Show data per year

                All values are in cents. Currency is the business's base currency.
                
      operationId: get_financial_summary
      parameters:
        - in: path
          name: business_id
          schema:
            type: string
            format: uuid
          description: Business UUID
          required: true
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Report period end date (YYYY-MM-DD)
          required: true
        - in: query
          name: granularity
          schema:
            type: string
            enum:
              - monthly
              - quarterly
              - yearly
            default: monthly
          description: 'Period granularity: ''monthly'', ''quarterly'', or ''yearly'''
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Report period start date (YYYY-MM-DD)
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FinancialSummary'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
          description: Validation errors in request data
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication required - missing or invalid API key
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Permission denied - insufficient privileges
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Resource not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict - resource already exists or invalid state transition
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable entity - business logic validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      security:
        - PartnerJWT: []
        - BusinessScopedJWT: []
        - BasicAuth: []
        - BearerUnscoped: []
        - BearerBusinessScoped: []
components:
  schemas:
    FinancialSummary:
      type: object
      description: |-
        Complete financial summary response with trends.

        Includes:
        - Business and period metadata
        - Summary totals for entire period
        - Period-by-period trends (monthly, quarterly, or yearly)
      properties:
        business_id:
          type: string
          format: uuid
          description: Business UUID
        start_date:
          type: string
          format: date
          description: Report period start
        end_date:
          type: string
          format: date
          description: Report period end
        currency:
          type: string
          description: Business base currency (e.g., EUR, GBP, USD)
        granularity:
          enum:
            - monthly
            - quarterly
            - yearly
          type: string
          x-spec-enum-id: 56f5599b29705c7b
          description: |-
            Period granularity: 'monthly', 'quarterly', or 'yearly'

            * `monthly` - monthly
            * `quarterly` - quarterly
            * `yearly` - yearly
        summary:
          allOf:
            - $ref: '#/components/schemas/FinancialSummarySummary'
          description: Overall totals for entire date range
        trends:
          type: array
          items:
            $ref: '#/components/schemas/PeriodTrend'
          description: Period-by-period breakdown
      required:
        - business_id
        - currency
        - end_date
        - granularity
        - start_date
        - summary
        - trends
    ValidationErrorResponse:
      type: object
      description: Validation error response with field-specific errors
      properties:
        error_code:
          type: string
          description: Error code (e.g., 'validation_error')
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Contains field_errors and additional context
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - detail
        - error_code
        - message
    ErrorResponse:
      type: object
      description: Standard error response format
      properties:
        error_code:
          type: string
          description: Error code for programmatic handling
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Additional error details including field_errors and debug info
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - error_code
        - message
    FinancialSummarySummary:
      type: object
      description: >-
        Overall financial summary totals for the entire date range.


        - total_revenue_cents: Sum of all revenue

        - total_expenses_cents: Sum of all expenses (direct_costs +
        operating_expenses + finance_costs + income_tax)

        - net_profit_cents: Revenue - Expenses
      properties:
        total_revenue_cents:
          type: integer
          description: Total revenue for entire period in cents
        total_expenses_cents:
          type: integer
          description: Total expenses for entire period in cents
        net_profit_cents:
          type: integer
          description: Net profit for entire period in cents
      required:
        - net_profit_cents
        - total_expenses_cents
        - total_revenue_cents
    PeriodTrend:
      type: object
      description: >-
        Financial metrics for a single period.


        Used in the trends array to show revenue, expenses, and profit per
        period.
      properties:
        period_start:
          type: string
          format: date
          description: Period start date
        period_end:
          type: string
          format: date
          description: Period end date
        revenue_cents:
          type: integer
          description: Total revenue for this period in cents
        expenses_cents:
          type: integer
          description: Total expenses for this period in cents
        net_profit_cents:
          type: integer
          description: Net profit for this period in cents
      required:
        - expenses_cents
        - net_profit_cents
        - period_end
        - period_start
        - revenue_cents
  securitySchemes:
    PartnerJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner-level JWT token (unscoped). Token payload includes `partner_id`.
        Business access is validated via partner ownership. Format: `Bearer
        <your-jwt-token>`


        **Use this for**: Multi-business operations where the business_id is
        specified in the URL and partner has access to multiple businesses.
    BusinessScopedJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT token. Token payload includes `business_id` to
        automatically scope requests. Format: `Bearer <your-jwt-token>`


        **Use this for**: Business-specific operations where the business
        context is embedded in the token.
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication for OAuth2 token endpoint. Use partner_uuid:api_key
        as username:password. Example: Authorization: Basic
        base64(partner_uuid:api_key)
    BearerUnscoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner (unscoped) JWT Bearer token. Obtain via POST
        /v1/platform/oauth2/token with Basic auth (partner_uuid:api_key). Use
        header: Authorization: Bearer {access_token}
    BearerBusinessScoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT Bearer token. Obtain via POST
        /v1/platform/{business_id}/oauth2/token/ using a partner Bearer token.
        Only valid for endpoints whose URL contains that business_id.

````