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

# Create Accounting Bill

> 
        Creates a new accounting bill with line items and automatic journal entry generation.

        This endpoint allows for complex bill creation with:
        - Multiple line items with different accounts, departments, and vendor assignments
        - Automatic accounts payable journal entry creation
        - Tax calculations and tax account handling
        - Exchange rate support for multi-currency transactions
        - Custom field support for additional bill metadata

        Requirements:
        - All referenced accounts must exist and be active
        - Vendor must exist
        - Entity must exist
        - Line items must have valid amounts and descriptions
        - Currency must be valid for the entity
        - Accounting date must be before closed book date
        



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json post /coa/api/v1/bill/
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/bill/:
    post:
      tags:
        - Accounts Payable
      summary: Create Accounting Bill
      description: |2-

                Creates a new accounting bill with line items and automatic journal entry generation.

                This endpoint allows for complex bill creation with:
                - Multiple line items with different accounts, departments, and vendor assignments
                - Automatic accounts payable journal entry creation
                - Tax calculations and tax account handling
                - Exchange rate support for multi-currency transactions
                - Custom field support for additional bill metadata

                Requirements:
                - All referenced accounts must exist and be active
                - Vendor must exist
                - Entity must exist
                - Line items must have valid amounts and descriptions
                - Currency must be valid for the entity
                - Accounting date must be before closed book date
                
      operationId: coa_api_v1_bill_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountingBill'
            examples:
              CreateBillRequest:
                value:
                  payment_term: 1234
                  bill_date: '2025-08-01'
                  due_date: '2025-08-24'
                  lines:
                    - tags:
                        - id: '8355'
                          name: Project A
                          group: 727
                      account: '2622'
                      account_name: 6700 - Office Expenses
                      amount: 10000
                      description: 1x Large Expense Line
                      bill_customer: '34182'
                      bill_customer_name: ABC Bead Supply
                      department: '35'
                      department_name: Engineering
                  entity: '54'
                  entity_name: Top Level
                  entity_currency: USD
                  currency: USD
                  exchange_rate_book: 1
                  exchange_rate: 1
                  vendor: '34182'
                  vendor_name: ABC Bead Supply
                  bill_number: '1234567'
                  item_date: '2025-08-01'
                  message_on_bill: A really big expense
                  mailing_address: 1234 Campground Road. San Francisco CA 98765
                summary: Standard bill creation with multiple line items
                description: >-
                  Example of creating a bill with multiple expense line items,
                  vendor assignment, and payment terms
              CreateBillResponse:
                value:
                  id: 31894
                  lines:
                    - id: 298626
                      account_number: '6700'
                      account_name: 6700 - Office Expenses
                      department_name: Engineering
                      bill_customer_name: ABC Bead Supply
                      tags:
                        - id: 8355
                          group_name: Projects
                          parent_name: null
                          parent: null
                          name: Project A
                          created_at: 2025-07-17T16:21:02+0000
                          last_modified_at: 2025-07-17T16:21:02+0000
                          group: 727
                      amortization_schedule: []
                      description: 1x Large Expense Line
                      amount: 10000
                      tax: 0
                      tax_description: null
                      source: null
                      source_id: null
                      currency: USD
                      created_at: 2025-07-25T04:24:32+0000
                      last_modified_at: 2025-07-25T04:24:32+0000
                      account: 2622
                      bill_customer: 34182
                      department: 35
                  payments: []
                  payment_journal_entries: []
                  status: open
                  past_due_days: null
                  entity_name: Top Level
                  entity_currency: USD
                  vendor_name: ABC Bead Supply
                  attachments: []
                  total_amount: 10000
                  amount_due: 10000
                  amount_paid: 0
                  item_date: '2025-08-01'
                  voided_date: null
                  search_vector: null
                  search_text: null
                  mailing_address: 1234 Campground Road. San Francisco CA 98765
                  terms: null
                  bill_number: '1234567'
                  bill_date: '2025-08-01'
                  due_date: '2025-08-24'
                  paid_date: null
                  message_on_bill: A really big expense
                  source_id: null
                  source: null
                  payment_status: open
                  currency: USD
                  exchange_rate: 1
                  exchange_rate_book: 1
                  created_at: 2025-07-25T04:24:32+0000
                  last_modified_at: 2025-07-25T04:24:32+0000
                  entity: 54
                  vendor: 34182
                  payment_term: 1234
                  payment_term_name: Net 30
                  journal_entry: 7491951
                  source_file: null
                  tax_rate: null
                  voided_journal_entry: null
                summary: Response after successfully creating a bill
                description: >-
                  Example response showing the created bill with generated IDs,
                  calculated totals, and journal entry information
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AccountingBill'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AccountingBill'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingBill'
              examples:
                CreateBillResponse:
                  value:
                    id: 31894
                    lines:
                      - id: 298626
                        account_number: '6700'
                        account_name: 6700 - Office Expenses
                        department_name: Engineering
                        bill_customer_name: ABC Bead Supply
                        tags:
                          - id: 8355
                            group_name: Projects
                            parent_name: null
                            parent: null
                            name: Project A
                            created_at: 2025-07-17T16:21:02+0000
                            last_modified_at: 2025-07-17T16:21:02+0000
                            group: 727
                        amortization_schedule: []
                        description: 1x Large Expense Line
                        amount: 10000
                        tax: 0
                        tax_description: null
                        source: null
                        source_id: null
                        currency: USD
                        created_at: 2025-07-25T04:24:32+0000
                        last_modified_at: 2025-07-25T04:24:32+0000
                        account: 2622
                        bill_customer: 34182
                        department: 35
                    payments: []
                    payment_journal_entries: []
                    status: open
                    past_due_days: null
                    entity_name: Top Level
                    entity_currency: USD
                    vendor_name: ABC Bead Supply
                    attachments: []
                    total_amount: 10000
                    amount_due: 10000
                    amount_paid: 0
                    item_date: '2025-08-01'
                    voided_date: null
                    search_vector: null
                    search_text: null
                    mailing_address: 1234 Campground Road. San Francisco CA 98765
                    terms: null
                    bill_number: '1234567'
                    bill_date: '2025-08-01'
                    due_date: '2025-08-24'
                    paid_date: null
                    message_on_bill: A really big expense
                    source_id: null
                    source: null
                    payment_status: open
                    currency: USD
                    exchange_rate: 1
                    exchange_rate_book: 1
                    created_at: 2025-07-25T04:24:32+0000
                    last_modified_at: 2025-07-25T04:24:32+0000
                    entity: 54
                    vendor: 34182
                    payment_term: 1234
                    payment_term_name: Net 30
                    journal_entry: 7491951
                    source_file: null
                    tax_rate: null
                    voided_journal_entry: null
                  summary: Response after successfully creating a bill
                  description: >-
                    Example response showing the created bill with generated
                    IDs, calculated totals, and journal entry information
          description: ''
      security:
        - knoxApiToken: []
components:
  schemas:
    AccountingBill:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        lines:
          type: array
          items:
            $ref: '#/components/schemas/AccountingBillLine'
        payments:
          type: array
          items:
            $ref: '#/components/schemas/AccountingBillPayment'
          readOnly: true
        payment_journal_entries:
          type: array
          items:
            type: integer
          readOnly: true
        status:
          type: string
          readOnly: true
        past_due_days:
          type: integer
          nullable: true
          readOnly: true
        entity_name:
          type: string
          readOnly: true
        entity_currency:
          type: string
          readOnly: true
        vendor_name:
          type: string
          readOnly: true
        ap_account_name:
          type: string
          nullable: true
          description: >-
            Return AP account name with number in 'number - name' format,
            similar to name_and_number.
          readOnly: true
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/File'
          readOnly: true
        total_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        amount_due:
          type: number
          format: double
          readOnly: true
        amount_paid:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        item_date:
          type: string
          format: date
          nullable: true
        migrated_journal_id:
          type: integer
          writeOnly: true
          nullable: true
        voided_date:
          type: string
          format: date
          readOnly: true
        voided_journal_entry_order:
          type: string
          readOnly: true
        amortizations:
          type: string
          readOnly: true
        last_modified_at:
          type: string
          format: date-time
          readOnly: true
        ramp_use_sandbox:
          type: string
          readOnly: true
        navan_region:
          type: string
          nullable: true
          description: >-
            Navan data region (``US``/``EU``) for a Navan-sourced bill, else
            ``None``.


            Mirrors ``ramp_use_sandbox``: the frontend builds the "Open in
            Navan" deep

            link from ``source_id`` and uses this to pick the web-app host

            (US -> app.navan.com, EU -> app-fra.navan.com). Navan bills carry no
            FK to

            their connection, so the region is resolved per customer and
            memoized to

            avoid an N+1 lookup across a bill list.
          readOnly: true
        zip_metadata:
          type: string
          readOnly: true
        is_deleted:
          type: boolean
          readOnly: true
          default: false
        deleted_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        payment_term_name:
          type: string
          readOnly: true
        chat_uuid:
          type: string
          format: uuid
          writeOnly: true
        withholding_info:
          type: object
          additionalProperties: {}
          nullable: true
          description: >-
            Withholding context for the bill's entity (AP side).


            ``estimated_withholding_amount`` covers only the remaining amount
            due (null once

            fully paid); ``withheld_to_date`` is the signed sum of posted
            withholding (AP legs

            are credits, reversals debits), so actuals replace the estimate as
            payments post.

            Certificate-based schemes estimate from the vendor certificate's
            rate valid today

            (falling back to the scheme default).
          readOnly: true
        search_vector:
          type: string
          readOnly: true
          nullable: true
        search_text:
          type: string
          readOnly: true
          nullable: true
        mailing_address:
          type: string
          nullable: true
        terms:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/TermsEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        bill_number:
          type: string
          maxLength: 120
        bill_date:
          type: string
          format: date
        due_date:
          type: string
          format: date
        paid_date:
          type: string
          format: date
          nullable: true
        message_on_bill:
          type: string
          nullable: true
        ita_allocation_number:
          type: string
          nullable: true
          pattern: ^\d{9}$
          maxLength: 9
        ita_bill_type:
          nullable: true
          description: |-
            Israel tax compliance: bill classification type

            * `other` - Other
            * `equipment` - Equipment
          oneOf:
            - $ref: '#/components/schemas/ItaBillTypeEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        source_id:
          type: string
          nullable: true
        source:
          type: string
          nullable: true
          maxLength: 250
        source_bill_data:
          nullable: true
        external_ramp_id:
          type: string
          nullable: true
        payment_status:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/AccountingBillPaymentStatusEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        currency:
          type: string
          maxLength: 3
        exchange_rate:
          type: number
          format: double
          maximum: 100000000000000
          minimum: -100000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        exchange_rate_book:
          type: number
          format: double
          maximum: 100000000000000
          minimum: -100000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        tax_behavior:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/TaxBehaviorEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        bill_type:
          $ref: '#/components/schemas/BillTypeEnum'
        chat_id:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        customer:
          type: integer
          readOnly: true
        entity:
          type: integer
        vendor:
          type: integer
          nullable: true
        payment_term:
          type: integer
          nullable: true
          description: Payment term for this bill
        journal_entry:
          type: integer
          nullable: true
        source_file:
          type: integer
          nullable: true
        tax_rate:
          type: integer
          nullable: true
        ap_account:
          type: integer
          nullable: true
          description: Accounts Payable account for this bill
        voided_journal_entry:
          type: integer
          nullable: true
      required:
        - amortizations
        - amount_due
        - amount_paid
        - ap_account_name
        - attachments
        - bill_date
        - bill_number
        - created_at
        - customer
        - deleted_at
        - due_date
        - entity
        - entity_currency
        - entity_name
        - id
        - is_deleted
        - last_modified_at
        - lines
        - navan_region
        - past_due_days
        - payment_journal_entries
        - payment_term_name
        - payments
        - ramp_use_sandbox
        - search_text
        - search_vector
        - status
        - total_amount
        - vendor
        - vendor_name
        - voided_date
        - voided_journal_entry_order
        - withholding_info
        - zip_metadata
    AccountingBillLine:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bill:
          type: integer
          writeOnly: true
        account_number:
          type: string
          readOnly: true
        account_name:
          type: string
          nullable: true
          description: Combines account number and name in the format "number - name"
          readOnly: true
        department_name:
          type: string
          readOnly: true
        department_code:
          type: string
          readOnly: true
        bill_customer_name:
          type: string
          readOnly: true
        tags:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
        amortization_schedule:
          type: array
          items:
            $ref: '#/components/schemas/AmortizationSchedule'
          readOnly: true
        tax_rate_name:
          type: string
          readOnly: true
        tax_rate_value:
          type: number
          format: double
          maximum: 1000000
          minimum: -1000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        description:
          type: string
          nullable: true
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        tax:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        tax_description:
          type: string
          nullable: true
          maxLength: 250
        tag_ids:
          type: array
          items:
            type: integer
            maximum: 9223372036854776000
            minimum: -9223372036854776000
            format: int64
        tag_group_ids:
          type: array
          items:
            type: integer
            maximum: 9223372036854776000
            minimum: -9223372036854776000
            format: int64
        source:
          type: string
          nullable: true
          maxLength: 250
        source_id:
          type: string
          nullable: true
        currency:
          type: string
          maxLength: 3
        created_at:
          type: string
          format: date-time
          readOnly: true
        last_modified_at:
          type: string
          format: date-time
          readOnly: true
        customer:
          type: integer
          readOnly: true
        account:
          type: integer
        tax_rate:
          type: integer
          nullable: true
        bill_customer:
          type: integer
          nullable: true
        department:
          type: integer
          nullable: true
      required:
        - account
        - account_name
        - account_number
        - amortization_schedule
        - bill_customer_name
        - created_at
        - customer
        - department_code
        - department_name
        - id
        - last_modified_at
        - tags
        - tax_rate_name
        - tax_rate_value
    AccountingBillPayment:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        payment_transaction_bank_description:
          type: string
          readOnly: true
        payment_journal_entry_order:
          type: string
          readOnly: true
        voided_journal_entry_order:
          type: string
          readOnly: true
        withheld_amount:
          type: number
          format: double
          nullable: true
          description: >-
            Tax withheld on this payment (AP): sum of the payment's withholding
            credit legs.


            Reads the ``bill_withheld_by_je`` map that
            ``AccountingBillSerializer`` populated from

            prefetched records, so no per-payment query runs. Void reversals
            live on a different

            journal, so they are naturally excluded.
          readOnly: true
        currency:
          type: string
          maxLength: 3
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        payment_date:
          type: string
          format: date
          nullable: true
        source:
          type: string
          nullable: true
          maxLength: 250
        source_id:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        voided_date:
          type: string
          format: date
          nullable: true
        last_modified_at:
          type: string
          format: date-time
          readOnly: true
        customer:
          type: integer
          readOnly: true
        bill:
          type: integer
        payment_journal_entry:
          type: integer
        payment_transaction:
          type: integer
          nullable: true
        voided_journal_entry:
          type: integer
          nullable: true
      required:
        - bill
        - created_at
        - customer
        - id
        - last_modified_at
        - payment_journal_entry
        - payment_journal_entry_order
        - payment_transaction_bank_description
        - voided_journal_entry_order
        - withheld_amount
    File:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        customer:
          type: integer
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: integer
          nullable: true
          readOnly: true
        created_by_name:
          type: string
          readOnly: true
        created_by_email:
          type: string
          readOnly: true
        last_modified_at:
          type: string
          format: date-time
          readOnly: true
        name:
          type: string
        url:
          type: string
          readOnly: true
        s3_content_type:
          type: string
          nullable: true
        s3_content_length:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        s3_path:
          type: string
        object_id:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        app:
          type: string
          readOnly: true
        model:
          type: string
          readOnly: true
        is_deleted:
          type: boolean
          readOnly: true
          default: false
        deleted_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - app
        - created_at
        - created_by
        - created_by_email
        - created_by_name
        - customer
        - deleted_at
        - id
        - is_deleted
        - last_modified_at
        - model
        - name
        - s3_path
        - url
    TermsEnum:
      enum:
        - custom
        - net_5
        - net_7
        - net_10
        - net_15
        - net_20
        - net_30
        - net_40
        - net_45
        - net_60
        - net_90
        - net_105
        - net_120
        - due_on_receipt
      type: string
      description: |-
        * `custom` - Custom
        * `net_5` - Net 5
        * `net_7` - Net 7
        * `net_10` - Net 10
        * `net_15` - Net 15
        * `net_20` - Net 20
        * `net_30` - Net 30
        * `net_40` - Net 40
        * `net_45` - Net 45
        * `net_60` - Net 60
        * `net_90` - Net 90
        * `net_105` - Net 105
        * `net_120` - Net 120
        * `due_on_receipt` - Due on Receipt
    BlankEnum:
      enum:
        - ''
    NullEnum:
      enum:
        - null
    ItaBillTypeEnum:
      enum:
        - other
        - equipment
      type: string
      description: |-
        * `other` - Other
        * `equipment` - Equipment
    AccountingBillPaymentStatusEnum:
      enum:
        - partial
        - open
        - paid
        - payment_not_found
        - payment_pending
        - voided
      type: string
      description: |-
        * `partial` - Partially Paid
        * `open` - Open
        * `paid` - Paid
        * `payment_not_found` - Payment Not Found
        * `payment_pending` - Payment Pending
        * `voided` - Voided
    TaxBehaviorEnum:
      enum:
        - inclusive
        - exclusive
      type: string
      description: |-
        * `inclusive` - Inclusive
        * `exclusive` - Exclusive
    BillTypeEnum:
      enum:
        - BILL
        - PAYROLL
        - REIMBURSEMENT
      type: string
      description: |-
        * `BILL` - Bill
        * `PAYROLL` - Payroll
        * `REIMBURSEMENT` - Reimbursement
    AmortizationSchedule:
      type: object
      properties:
        id:
          type: integer
        amortization:
          type: integer
          writeOnly: true
        accounting_amortization:
          type: integer
          writeOnly: true
        journal_entry_order:
          type: string
          readOnly: true
        date:
          type: string
          format: date
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        posted:
          type: boolean
        customer:
          type: integer
          readOnly: true
        transaction:
          type: integer
          nullable: true
        bill_line:
          type: integer
          nullable: true
        journal_entry:
          type: integer
          nullable: true
      required:
        - amount
        - customer
        - date
        - journal_entry_order
  securitySchemes:
    knoxApiToken:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````