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

# Get Cash Balance Timeline

> Get complete cash balance timeline for a location with all events aggregated.

By default (when no start_date is provided), returns the last 7 days of data for performance.
The timeline will automatically include the most recent cash balance closure before the start date
to ensure accurate running balance calculations.



## OpenAPI

````yaml get /billing/cash-balance/timeline
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/cash-balance/timeline:
    get:
      tags:
        - provider
        - billing
      summary: Get Cash Balance Timeline
      description: >-
        Get complete cash balance timeline for a location with all events
        aggregated.


        By default (when no start_date is provided), returns the last 7 days of
        data for performance.

        The timeline will automatically include the most recent cash balance
        closure before the start date

        to ensure accurate running balance calculations.
      operationId: get_cash_balance_timeline_billing_cash_balance_timeline_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: location_id
          in: query
          required: true
          schema:
            type: string
            title: Location Id
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Start Date
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: End Date
        - name: include_calculated
          in: query
          required: false
          schema:
            type: boolean
            default: true
            title: Include Calculated
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CashBalanceTimelineResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CashBalanceTimelineResponse:
      properties:
        events:
          items:
            $ref: '#/components/schemas/TimelineEvent'
          type: array
          title: Events
          description: List of timeline events
        stats:
          $ref: '#/components/schemas/TimelineStats'
          description: Summary statistics
      type: object
      required:
        - events
        - stats
      title: CashBalanceTimelineResponse
      description: Complete timeline response including events and stats.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TimelineEvent:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the event
        type:
          type: string
          enum:
            - balance_closure
            - adjustment
            - calculated_balance
            - discrepancy_note
            - cash_payment
            - cash_refund
          title: Type
          description: Type of timeline event
        date:
          type: string
          format: date-time
          title: Date
          description: Date/time of the event
        cashBalance:
          anyOf:
            - $ref: '#/components/schemas/CashBalanceDetail'
            - type: 'null'
          description: Cash balance details if type is balance_closure
        adjustment:
          anyOf:
            - $ref: '#/components/schemas/CashBalanceAdjustmentDetail'
            - type: 'null'
          description: Adjustment details if type is adjustment
        calculatedBalance:
          anyOf:
            - $ref: '#/components/schemas/CalculatedDailyBalance'
            - type: 'null'
          description: Calculated balance details if type is calculated_balance
        paymentSummary:
          anyOf:
            - $ref: '#/components/schemas/PaymentSummaryForTimeline'
            - type: 'null'
          description: Payment details if type is cash_payment
        refundSummary:
          anyOf:
            - $ref: '#/components/schemas/RefundSummaryForTimeline'
            - type: 'null'
          description: Refund details if type is cash_refund
        locationName:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationname
          description: Name of the location
      type: object
      required:
        - id
        - type
        - date
      title: TimelineEvent
      description: Timeline event for cash balance display.
    TimelineStats:
      properties:
        totalEvents:
          type: integer
          title: Totalevents
          description: Total number of events
        balanceClosures:
          type: integer
          title: Balanceclosures
          description: Number of balance closures
        adjustments:
          type: integer
          title: Adjustments
          description: Number of adjustments
        discrepancies:
          type: integer
          title: Discrepancies
          description: Number of discrepancies
      type: object
      required:
        - totalEvents
        - balanceClosures
        - adjustments
        - discrepancies
      title: TimelineStats
      description: Summary statistics for timeline events.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CashBalanceDetail:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the cash balance
        creatorId:
          type: string
          title: Creatorid
          description: The ID of the creator
        locationId:
          type: string
          title: Locationid
          description: The ID of the location
        closingBalance:
          type: integer
          title: Closingbalance
          description: The closing balance amount in cents
        balanceDiscrepancy:
          type: integer
          title: Balancediscrepancy
          description: The balance discrepancy amount in cents
        discrepancyAcknowledged:
          type: boolean
          title: Discrepancyacknowledged
          description: Whether the discrepancy has been acknowledged
          default: false
        acknowledgedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Acknowledgedbyid
          description: The ID of the user who acknowledged the discrepancy
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: The date and time the cash balance was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: The date and time the cash balance was last updated
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the cash balance record is archived/voided
          default: false
        locationName:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationname
          description: The name of the location
        creatorName:
          anyOf:
            - type: string
            - type: 'null'
          title: Creatorname
          description: The name of the creator
        acknowledgedByName:
          anyOf:
            - type: string
            - type: 'null'
          title: Acknowledgedbyname
          description: The name of the user who acknowledged the discrepancy
      type: object
      required:
        - id
        - creatorId
        - locationId
        - closingBalance
        - balanceDiscrepancy
        - createdDate
      title: CashBalanceDetail
      description: Detailed cash balance record including location name and creator name.
    CashBalanceAdjustmentDetail:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the adjustment
        locationId:
          type: string
          title: Locationid
          description: The ID of the location
        amount:
          type: integer
          title: Amount
          description: The adjustment amount in cents
        reason:
          type: string
          title: Reason
          description: The reason for the adjustment
        creatorId:
          type: string
          title: Creatorid
          description: The ID of the creator
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: The date and time the adjustment was created
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the adjustment has been voided
          default: false
        creatorName:
          anyOf:
            - type: string
            - type: 'null'
          title: Creatorname
          description: The name of the creator
      type: object
      required:
        - id
        - locationId
        - amount
        - reason
        - creatorId
        - createdDate
      title: CashBalanceAdjustmentDetail
      description: Detailed cash balance adjustment information including creator details.
    CalculatedDailyBalance:
      properties:
        date:
          type: string
          format: date-time
          title: Date
          description: The date for this calculated balance
        endingBalance:
          type: integer
          title: Endingbalance
          description: Ending balance in cents
        startingBalance:
          type: integer
          title: Startingbalance
          description: Starting balance in cents
        cashPayments:
          type: integer
          title: Cashpayments
          description: Total cash payments in cents
        cashRefunds:
          type: integer
          title: Cashrefunds
          description: Total cash refunds in cents
        adjustments:
          type: integer
          title: Adjustments
          description: Total adjustments in cents
        locationId:
          type: string
          title: Locationid
          description: The location ID
        locationName:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationname
          description: The location name
      type: object
      required:
        - date
        - endingBalance
        - startingBalance
        - cashPayments
        - cashRefunds
        - adjustments
        - locationId
      title: CalculatedDailyBalance
      description: Daily calculated balance summary.
    PaymentSummaryForTimeline:
      properties:
        id:
          type: string
          title: Id
          description: Payment ID
        amount:
          type: integer
          title: Amount
          description: Payment amount in cents
        payerName:
          type: string
          title: Payername
          description: Name of the payer
        creatorName:
          type: string
          title: Creatorname
          description: Name of the user who processed the payment
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: Payment creation date
        paymentMedium:
          type: string
          title: Paymentmedium
          description: Payment medium (e.g., CASH)
      type: object
      required:
        - id
        - amount
        - payerName
        - creatorName
        - createdDate
        - paymentMedium
      title: PaymentSummaryForTimeline
      description: Payment summary for timeline display.
    RefundSummaryForTimeline:
      properties:
        id:
          type: string
          title: Id
          description: Refund ID
        amount:
          type: integer
          title: Amount
          description: Refund amount in cents
        payerName:
          type: string
          title: Payername
          description: Name of the original payer
        creatorName:
          type: string
          title: Creatorname
          description: Name of the user who processed the refund
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: Refund creation date
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Reason for the refund
      type: object
      required:
        - id
        - amount
        - payerName
        - creatorName
        - createdDate
      title: RefundSummaryForTimeline
      description: Refund summary for timeline display.

````