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

# Details

> Get detailed financials for a project



## OpenAPI

````yaml get /financials/details/{project_id}
openapi: 3.0.0
info:
  title: Terraspect API
  version: 0.0.2
servers:
  - url: https://api.terraspect.earth
    description: Production server
security: []
tags:
  - name: Projects
    description: Endpoints for retrieving project and developer information
  - name: Impact
    description: Endpoints for accessing impact and community metrics
  - name: Financials
    description: Endpoints for accessing financial data (some require extended permissions)
paths:
  /financials/details/{project_id}:
    get:
      summary: Get Detailed Financial Information
      description: |
        Retrieves detailed financial information for a specific project.
        Requires extended API key with additional permissions.

        This endpoint provides sensitive financial data including:
        - Detailed payment breakdowns
        - Distribution methods
        - Payment verification status

        Note: This endpoint has a lower rate limit than standard endpoints.
      operationId: getFinancialsDetails
      parameters:
        - name: project_id
          in: path
          required: true
          description: Unique identifier of the project
          schema:
            type: string
            format: uuid
        - name: start_date
          in: query
          description: Start date for financial data (ISO 8601 format)
          schema:
            type: string
            format: date
            example: '2024-01-01'
        - name: end_date
          in: query
          description: End date for financial data (ISO 8601 format)
          schema:
            type: string
            format: date
            example: '2024-12-31'
      responses:
        '200':
          description: Detailed financial information successfully retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinancialsDetails'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_dates:
                  summary: Invalid date range
                  value:
                    code: INVALID_DATE_RANGE
                    message: End date must be after start date
                future_dates:
                  summary: Future dates not allowed
                  value:
                    code: FUTURE_DATES
                    message: Date range cannot include future dates
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_token:
                  summary: No token provided
                  value:
                    code: MISSING_TOKEN
                    message: No bearer token provided
                expired_token:
                  summary: Token expired
                  value:
                    code: TOKEN_EXPIRED
                    message: Token has expired. Please obtain a new token.
                invalid_token:
                  summary: Invalid token
                  value:
                    code: INVALID_TOKEN
                    message: Token is malformed or signature is invalid
        '403':
          description: Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                standard_key:
                  summary: Standard API key used
                  value:
                    code: INSUFFICIENT_PERMISSIONS
                    message: This endpoint requires an Extended API key
                unauthorized_project:
                  summary: No access to project
                  value:
                    code: PROJECT_ACCESS_DENIED
                    message: Your API key does not have access to this project
        '404':
          description: Project not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: PROJECT_NOT_FOUND
                message: No project found with the provided ID
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: RATE_LIMIT_EXCEEDED
                message: Financial endpoints are limited to 20 requests per minute
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: INTERNAL_ERROR
                message: An unexpected error occurred
      security:
        - ExtendedAuth: []
components:
  schemas:
    FinancialsDetails:
      type: object
      required:
        - project_id
        - revenue_share_amount
        - revenue_share_percentage
        - total_community_income
        - payment_types
        - payment_distribution
        - payment_methods
        - payment_frequency
      properties:
        project_id:
          type: string
          description: Project identifier
          example: proj_789012
        revenue_share_amount_usd:
          type: number
          description: Total amount shared with community in USD
          example: 1500000
        revenue_share_percentage:
          type: number
          description: Percentage of revenue shared with community
          minimum: 0
          maximum: 100
          example: 30.5
        total_community_income_usd:
          type: number
          description: Total income received by community in USD
          example: 2000000
        payment_types:
          type: object
          description: Breakdown of different payment types and their amounts
          example:
            planting: 5000
            labour: 3000
            lease: 2000
            revenue-share: 10000
            equipment: 4000
            expenses: 1500
            training: 2500
            seedlings: 1200
            technical: 3000
            health: 500
            audit: 1000
            taxes: 600
            maintenance: 700
            loans: 800
            savings: 900
            insurance: 1000
            pension: 1100
          additionalProperties:
            $ref: '#/components/schemas/PaymentType'
        payment_distribution:
          type: object
          required:
            - payment_direct
            - payment_group
          properties:
            payment_direct:
              type: number
              description: Percentage of payments made directly to individuals
              minimum: 0
              maximum: 100
              example: 70
            payment_group:
              type: number
              description: Percentage of payments made to community groups
              minimum: 0
              maximum: 100
              example: 30
        payment_methods:
          type: object
          required:
            - payment_mobile_money
            - payment_bank_transfer
            - payment_unknown
          properties:
            payment_mobile_money:
              type: number
              description: Percentage of payments via mobile money
              minimum: 0
              maximum: 100
              example: 60
            payment_bank_transfer:
              type: number
              description: Percentage of payments via bank transfer
              minimum: 0
              maximum: 100
              example: 35
            payment_unknown:
              type: number
              description: Percentage of payments via untracked methods
              minimum: 0
              maximum: 100
              example: 5
        payment_frequency:
          type: integer
          description: Average payment frequency in days
          minimum: 1
          example: 30
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code for machine processing
          example: INVALID_PROJECT_ID
        message:
          type: string
          description: Human-readable error message
          example: The provided project ID does not exist
        details:
          type: object
          description: Additional error details when available
          nullable: true
    PaymentType:
      type: object
      required:
        - amount
        - tag
        - verified
      properties:
        amount:
          type: number
          description: Payment amount in project currency
          example: 50000
        tag:
          type: string
          description: Classification of payment purpose
          enum:
            - operational
            - benefit
            - financial_inclusion
            - in_kind
          example: benefit
        verified:
          type: boolean
          description: Whether the payment has been verified by Terraspect
          example: true
  securitySchemes:
    ExtendedAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Extended access token required for more sensitive data, in the format
        `Authorization: Bearer <token>`

````