> ## 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 Invoice Upload Revenue Links

> Dry run of the invoice upload's revenue linking, in the order given (the order the upload posts them). Nothing is saved.



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json post /coa/api/v1/invoice/csv-revenue-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 **10 requests per second**. This limit is shared
    across

    all endpoints for the same API user. OAuth app tokens get the same limit,

    counted separately for each app connection. 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:
  /coa/api/v1/invoice/csv-revenue-preview:
    post:
      tags:
        - Accounts Receivable
      summary: Preview Invoice Upload Revenue Links
      description: >-
        Dry run of the invoice upload's revenue linking, in the order given (the
        order the upload posts them). Nothing is saved.
      operationId: coa_api_v1_invoice_csv_revenue_preview_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadRevenuePreviewRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UploadRevenuePreviewRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadRevenuePreviewRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadRevenuePreview'
          description: ''
components:
  schemas:
    UploadRevenuePreviewRequest:
      type: object
      properties:
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/PreviewInvoice'
      required:
        - invoices
    UploadRevenuePreview:
      type: object
      properties:
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/PreviewInvoiceResult'
        contracts:
          type: array
          items:
            $ref: '#/components/schemas/PreviewContract'
      required:
        - contracts
        - invoices
    PreviewInvoice:
      type: object
      description: >-
        The invoice the upload will post, plus the row reference the page shows
        it under.
      properties:
        reference:
          type: string
        invoice_number:
          type: string
          nullable: true
        invoice_date:
          type: string
          format: date
          nullable: true
        period_start:
          type: string
          format: date
          nullable: true
        period_end:
          type: string
          format: date
          nullable: true
        currency:
          type: string
          nullable: true
        entity:
          type: integer
          nullable: true
        client:
          type: integer
          nullable: true
        contract:
          type: integer
          nullable: true
        lines:
          type: array
          items:
            $ref: '#/components/schemas/PreviewLine'
      required:
        - lines
        - reference
    PreviewInvoiceResult:
      type: object
      properties:
        reference:
          type: string
        invoice_number:
          type: string
          nullable: true
        contract_id:
          type: integer
          nullable: true
        status:
          type: string
        reason:
          type: string
          nullable: true
        review_flags:
          type: array
          items:
            type: string
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/PreviewAllocation'
      required:
        - allocations
        - contract_id
        - invoice_number
        - reason
        - reference
        - review_flags
        - status
    PreviewContract:
      type: object
      properties:
        id:
          type: integer
        deal_name:
          type: string
          nullable: true
        deal_id:
          type: string
          nullable: true
        currency:
          type: string
        revenue_lines:
          type: array
          items:
            $ref: '#/components/schemas/PreviewRevenueLine'
      required:
        - currency
        - deal_id
        - deal_name
        - id
        - revenue_lines
    PreviewLine:
      type: object
      properties:
        product:
          type: integer
          nullable: true
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        discount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        service_date:
          type: string
          format: date
          nullable: true
      required:
        - amount
    PreviewAllocation:
      type: object
      properties:
        revenue_line_id:
          type: integer
        amount_before:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        allocated_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        split:
          type: boolean
        outside_period:
          type: boolean
      required:
        - allocated_amount
        - amount_before
        - outside_period
        - revenue_line_id
        - split
    PreviewRevenueLine:
      type: object
      properties:
        id:
          type: integer
        transaction_date:
          type: string
          format: date
          nullable: true
        transaction_end_date:
          type: string
          format: date
          nullable: true
        product_name:
          type: string
          nullable: true
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        invoice_id:
          type: integer
          nullable: true
        invoice_number:
          type: string
          nullable: true
      required:
        - amount
        - id
        - invoice_id
        - invoice_number
        - product_name
        - transaction_date
        - transaction_end_date

````