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

# Get Default Payment Amount

> Get the default payment amount for an invoice based on when payment is posted.

        If the invoice has discount terms and the posted date is within the discount period,
        the discounted amount is returned. Otherwise, the full amount is returned.
        



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json post /coa/api/v1/invoice/{invoice_id}/default-payment
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}/default-payment:
    post:
      tags:
        - Accounts Receivable
      summary: Get Default Payment Amount
      description: >-
        Get the default payment amount for an invoice based on when payment is
        posted.

                If the invoice has discount terms and the posted date is within the discount period,
                the discounted amount is returned. Otherwise, the full amount is returned.
                
      operationId: coa_api_v1_invoice_default_payment_create
      parameters:
        - in: path
          name: invoice_id
          schema:
            type: integer
          description: ID of the invoice
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDefaultPaymentInput'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GetDefaultPaymentInput'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GetDefaultPaymentInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDefaultPaymentOutput'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
      security:
        - knoxApiToken: []
components:
  schemas:
    GetDefaultPaymentInput:
      type: object
      properties:
        posted_at:
          type: string
          format: date
          description: Date when payment would be posted
        transaction_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
          description: Optional transaction amount
      required:
        - posted_at
    GetDefaultPaymentOutput:
      type: object
      properties:
        default_payment_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        payment_term_discount_note:
          type: string
          nullable: true
      required:
        - default_payment_amount
  securitySchemes:
    knoxApiToken:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````