> ## 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.

# Mark Invoice as Paid

> Mark an invoice as paid, allowing partial payments.

        This endpoint supports multiple payment methods:
        - Apply existing transactions as payments
        - Apply credit memos to reduce the invoice balance
        - Create manual payments without a transaction

        The request body should contain at least one of:
        - transactions: List of transaction payments to apply
        - credit_memos: List of credit memos to apply
        - empty_transactions: List of manual payments without transactions



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json post /coa/api/v1/invoice/{invoice_id}/pay/
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.
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/{invoice_id}/pay/:
    post:
      tags:
        - Accounts Receivable
      summary: Mark Invoice as Paid
      description: |-
        Mark an invoice as paid, allowing partial payments.

                This endpoint supports multiple payment methods:
                - Apply existing transactions as payments
                - Apply credit memos to reduce the invoice balance
                - Create manual payments without a transaction

                The request body should contain at least one of:
                - transactions: List of transaction payments to apply
                - credit_memos: List of credit memos to apply
                - empty_transactions: List of manual payments without transactions
      operationId: coa_api_v1_invoice_pay_create
      parameters:
        - in: path
          name: invoice_id
          schema:
            type: integer
          description: ID of the invoice to mark as paid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkPaid'
            examples:
              MarkInvoiceAsPaidRequest:
                value:
                  invoice_id: '58700'
                  transactions:
                    - transaction_id: 14728800
                      transaction_description: Payment from Campfire Software Inc
                      account_id: '2553'
                      account_name: 1100 - Accounts Receivable
                      amount: 883.33
                  credit_memos:
                    - credit_memo_id: 4029
                      credit_memo_number: CM-0000007
                      amount: 150
                      posted_at: '2025-07-25'
                  empty_transactions: []
                summary: Mark Invoice as Paid Request
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MarkPaid'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MarkPaid'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarkInvoicePaidResponse'
          description: ''
      security:
        - knoxApiToken: []
components:
  schemas:
    MarkPaid:
      type: object
      properties:
        transaction_match_id:
          type: integer
          nullable: true
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/MarkPaidTransaction'
          nullable: true
        credit_memos:
          type: array
          items:
            $ref: '#/components/schemas/MarkPaidCreditMemo'
          nullable: true
        debit_memos:
          type: array
          items:
            $ref: '#/components/schemas/MarkPaidDebitMemo'
          nullable: true
        empty_transactions:
          type: array
          items:
            $ref: '#/components/schemas/MarkPaidEmptyTransaction'
          nullable: true
    MarkInvoicePaidResponse:
      type: object
      description: >-
        200 payload for the mark-invoice-paid endpoint.


        The endpoint returns ids of the records it created rather than the
        invoice itself.

        ``auto_created_credit_memos`` is only present when an overpayment
        produced one.
      properties:
        journal_entry_ids:
          type: array
          items:
            type: integer
        payment_ids:
          type: array
          items:
            type: integer
        auto_created_credit_memos:
          type: array
          items:
            $ref: '#/components/schemas/MarkInvoicePaidAutoCreatedCreditMemo'
      required:
        - journal_entry_ids
        - payment_ids
    MarkPaidTransaction:
      type: object
      properties:
        transaction_match_id:
          type: integer
          nullable: true
        transaction_id:
          type: integer
          nullable: true
        transaction_ids:
          type: array
          items:
            type: integer
          nullable: true
        account_id:
          type: integer
          nullable: true
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        amount_payable:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        credit_account_id:
          type: integer
          nullable: true
        writeoff_account_id:
          type: integer
          nullable: true
        withholding_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        withholding_tax_rate_id:
          type: integer
          nullable: true
      required:
        - amount
    MarkPaidCreditMemo:
      type: object
      properties:
        credit_memo_id:
          type: integer
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        posted_at:
          type: string
          format: date
      required:
        - amount
        - credit_memo_id
        - posted_at
    MarkPaidDebitMemo:
      type: object
      properties:
        debit_memo_id:
          type: integer
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        posted_at:
          type: string
          format: date
      required:
        - amount
        - debit_memo_id
        - posted_at
    MarkPaidEmptyTransaction:
      type: object
      properties:
        account_id:
          type: integer
        account_name:
          type: string
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        payment_date:
          type: string
          format: date
        department_id:
          type: integer
          nullable: true
        tag_ids:
          type: array
          items:
            type: integer
        memo:
          type: string
          nullable: true
        external_id:
          type: string
          nullable: true
          maxLength: 256
        currency:
          type: string
          nullable: true
        amount_in_invoice_currency:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        amount_in_bill_currency:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        withholding_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        withholding_tax_rate_id:
          type: integer
          nullable: true
      required:
        - account_id
        - account_name
        - amount
        - payment_date
    MarkInvoicePaidAutoCreatedCreditMemo:
      type: object
      properties:
        id:
          type: integer
        credit_memo_number:
          type: string
      required:
        - credit_memo_number
        - id
  securitySchemes:
    knoxApiToken:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````