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

# Preview Contract Termination Settlement



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json get /rr/api/v1/contracts/{id}/termination-settlement-preview
openapi: 3.0.3
info:
  title: Campfire Developer APIs
  version: 1.0.0
  description: >
    ## Introduction

    Campfire's developer APIs offer granular access to Campfire's core
    accounting,

    revenue recognition, and financial data features.


    These APIs are designed to be used by developers to build custom
    integrations,

    automate workflows, and perform any other programmatic operations.


    ## Rate limits

    API users can make up to **5 requests per second**. This limit is shared
    across

    all endpoints for the same API user. Requests that exceed the limit receive
    a

    `429 Too Many Requests` response. Wait for the number of seconds specified
    in

    the `Retry-After` response header before retrying.
servers:
  - url: https://api.meetcampfire.com
    description: Production server
security: []
tags:
  - name: Cash Management
    description: Operations related to accounts, transactions, and other bank-related data.
  - name: Core Accounting
    description: >-
      Operations related to core accounting data, such as the chart of accounts,
      entity management, and the general ledger.
  - name: Revenue Recognition
    description: >-
      Operations related to revenue recognition, contract management, and
      contract data aggregation.
  - name: Accounts Receivable
    description: Operations related to invoicing and the AR subledger
  - name: Accounts Payable
    description: Operations related to billing and the AP subledger.
  - name: Financial Statements
    description: Operations related to financial statement generation and data aggregation.
  - name: Settings
    description: Operations related to system and accounting settings configuration.
paths:
  /rr/api/v1/contracts/{id}/termination-settlement-preview:
    get:
      tags:
        - Revenue Recognition
      summary: Preview Contract Termination Settlement
      operationId: rr_api_v1_contracts_termination_settlement_preview_retrieve
      parameters:
        - in: query
          name: credit_unused_revenue
          schema:
            type: boolean
            default: true
        - in: path
          name: id
          schema:
            type: integer
          required: true
        - in: query
          name: termination_date
          schema:
            type: string
            format: date
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminationSettlementPreviewResponse'
          description: ''
components:
  schemas:
    TerminationSettlementPreviewResponse:
      type: object
      properties:
        termination_date:
          type: string
          format: date
        posting_date:
          type: string
          format: date
        total_reversal_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        total_credit_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        total_tax_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        lines:
          type: array
          items:
            $ref: '#/components/schemas/TerminationSettlementLine'
        warnings:
          type: array
          items:
            type: string
        can_settle:
          type: boolean
        blocking_reason:
          type: string
          nullable: true
      required:
        - blocking_reason
        - can_settle
        - lines
        - posting_date
        - termination_date
        - total_credit_amount
        - total_reversal_amount
        - total_tax_amount
        - warnings
    TerminationSettlementLine:
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/KindEnum'
        source_id:
          type: integer
          nullable: true
        label:
          type: string
        product_id:
          type: integer
          nullable: true
        product_name:
          type: string
          nullable: true
        reversal_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        credit_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        tax_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        billed_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        consumed_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        unused_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
      required:
        - billed_amount
        - consumed_amount
        - credit_amount
        - kind
        - label
        - product_id
        - product_name
        - reversal_amount
        - source_id
        - tax_amount
        - unused_amount
    KindEnum:
      enum:
        - subscription
        - prepaid_commit
      type: string
      description: |-
        * `subscription` - subscription
        * `prepaid_commit` - prepaid_commit

````