Campfire Revenue Recognition API
Operations related to revenue recognition, contract management, and contract data aggregation.
Operations related to revenue recognition, contract management, and contract data aggregation.
openapi: 3.0.3
info:
title: Campfire Developer APIs Accounts Payable Revenue Recognition API
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
tags:
- name: Revenue Recognition
description: Operations related to revenue recognition, contract management, and contract data aggregation.
paths:
/rr/api/v1/contracts:
get:
operationId: list_contracts
description: "\n Retrieve a list of contracts with optional filtering and sorting.\n\n Supports including soft-deleted records for audit and recovery purposes.\n When include_deleted=true, returns ONLY deleted records instead of active records.\n Deleted records contain minimal data: 'id', 'is_deleted=true', 'deleted_at' timestamp,\n and 'last_modified_at'. When 'false' or omitted, returns ONLY active records.\n This provides clean separation between active and deleted data.\n\n When download=true, triggers an async workflow that generates a ZIP file with\n contracts_summary.csv and contracts_detail.csv, uploads to S3, and sends an email\n with the download link.\n "
summary: List Contracts
parameters:
- in: query
name: include_deleted
schema:
type: boolean
default: false
description: 'When set to ''true'', returns ONLY deleted records instead of active records. Deleted records contain minimal data: ''id'', ''is_deleted=true'', ''deleted_at'' timestamp, and ''last_modified_at''. When ''false'' or omitted, returns ONLY active records. This provides clean separation between active and deleted data.'
- in: query
name: last_modified_at__gte
schema:
type: string
description: 'Filter for records modified on or after this timestamp. Format: ISO 8601 (e.g., ''2024-01-01T00:00:00Z'' or ''2024-01-01''). Works with both active records and deleted records (filters by deletion time for deleted records).'
- in: query
name: last_modified_at__lte
schema:
type: string
description: 'Filter for records modified on or before this timestamp. Format: ISO 8601 (e.g., ''2024-12-31T23:59:59Z'' or ''2024-12-31''). Works with both active records and deleted records (filters by deletion time for deleted records).'
- name: limit
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: offset
required: false
in: query
description: The initial index from which to return the results.
schema:
type: integer
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedContractList'
description: ''
x-mint:
mcp:
enabled: true
name: get_contracts
description: Retrieve contract information with optional filtering
post:
operationId: create_contract
description: "\n Create a new contract.\n\n Evergreen vs standard:\n - Standard contract: set is_evergreen=false and provide a fixed contract_end_date.\n - Evergreen contract: set is_evergreen=true and leave contract_end_date as null.\n The system manages a rolling effective_end_date, exposes working_end_date for downstream usage,\n and returns evergreen_locked_date for immutable historical boundary rules.\n\n Additional evergreen constraints:\n - is_evergreen and auto_renew cannot both be true.\n - billing_frequency is required for evergreen behavior.\n - skip_evergreen_invoice_generation is creation-time only and cannot be changed on existing contracts.\n - skip_evergreen_invoice_generation=true skips only Campfire's auto-generated evergreen invoices.\n Revenue transactions still generate.\n "
summary: Create Contract
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Contract'
examples:
CreateStandardContract:
value:
client: 101
entity: 11
deal_name: Platform Annual - Fixed Term
contract_start_date: '2026-01-01'
contract_end_date: '2026-12-31'
currency: USD
billing_frequency: annual
is_evergreen: false
auto_renew: false
auto_send_invoices: false
skip_evergreen_invoice_generation: false
summary: Create Standard Contract
CreateEvergreenContractWithGeneratedInvoices:
value:
client: 101
entity: 11
deal_name: Platform Evergreen - Monthly
contract_start_date: '2026-01-01'
contract_end_date: null
currency: USD
billing_frequency: monthly
is_evergreen: true
auto_renew: false
auto_send_invoices: true
skip_evergreen_invoice_generation: false
summary: Create Evergreen Contract with Generated Invoices
CreateEvergreenContractWithoutGeneratedInvoices:
value:
client: 101
entity: 11
deal_name: Platform Evergreen - Imported Invoices
contract_start_date: '2026-01-01'
contract_end_date: null
currency: USD
billing_frequency: monthly
is_evergreen: true
auto_renew: false
auto_send_invoices: false
auto_apply_customer_stripe_config_to_invoices: false
skip_evergreen_invoice_generation: true
summary: Create Evergreen Contract without Generated Invoices
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Contract'
multipart/form-data:
schema:
$ref: '#/components/schemas/Contract'
security:
- knoxApiToken: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/Contract'
description: ''
/rr/api/v1/contracts/{contract_id}/bundles:
get:
operationId: list_contract_bundles
description: "\n Retrieve a list of contract bundles with optional filtering and sorting.\n\n Supports including soft-deleted records for audit and recovery purposes.\n When include_deleted=true, returns ONLY deleted records instead of active records.\n Deleted records contain minimal data: 'id', 'is_deleted=true', 'deleted_at' timestamp,\n and 'last_modified_at'. When 'false' or omitted, returns ONLY active records.\n This provides clean separation between active and deleted data.\n "
summary: List Contract Bundles
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: query
name: include_deleted
schema:
type: boolean
default: false
description: 'When set to ''true'', returns ONLY deleted records instead of active records. Deleted records contain minimal data: ''id'', ''is_deleted=true'', ''deleted_at'' timestamp, and ''last_modified_at''. When ''false'' or omitted, returns ONLY active records. This provides clean separation between active and deleted data.'
- in: query
name: last_modified_at__gte
schema:
type: string
description: 'Filter for records modified on or after this timestamp. Format: ISO 8601 (e.g., ''2024-01-01T00:00:00Z'' or ''2024-01-01''). Works with both active records and deleted records (filters by deletion time for deleted records).'
- in: query
name: last_modified_at__lte
schema:
type: string
description: 'Filter for records modified on or before this timestamp. Format: ISO 8601 (e.g., ''2024-12-31T23:59:59Z'' or ''2024-12-31''). Works with both active records and deleted records (filters by deletion time for deleted records).'
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ContractBundle'
description: ''
post:
operationId: create_contract_bundle
description: "\n Create a new contract bundle.\n\n Evergreen vs standard:\n - Standard contracts require a fixed bundle end_date.\n - Evergreen contracts allow end_date to be null (open-ended) or set to a billing-period end date.\n Evergreen bundle start/end dates must align with billing period boundaries.\n\n Evergreen-specific option:\n - rebalance_journal_entries_indefinitely=true keeps invoice-journal rebalancing in sync as the evergreen\n contract extends.\n "
summary: Create Contract Bundle
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractBundle'
examples:
CreateStandardContractBundle:
value:
contract: 9001
bundle_name: Standard Allocation Bundle
start_date: '2026-01-01'
end_date: '2026-12-31'
rebalance_journal_entries_indefinitely: false
lines:
- product: 1201
amount: '7000.00'
- product: 1202
amount: '3000.00'
summary: Create Standard Contract Bundle
CreateEvergreenContractBundle:
value:
contract: 9002
bundle_name: Evergreen Allocation Bundle
start_date: '2026-04-01'
end_date: null
rebalance_journal_entries_indefinitely: true
lines:
- product: 1201
amount: '6500.00'
- product: 1202
amount: '3500.00'
summary: Create Evergreen Contract Bundle
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ContractBundle'
multipart/form-data:
schema:
$ref: '#/components/schemas/ContractBundle'
required: true
security:
- knoxApiToken: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractBundle'
description: ''
/rr/api/v1/contracts/{contract_id}/bundles/{id}:
get:
operationId: rr_api_v1_contracts_bundles_retrieve
summary: Retrieve Contract Bundle
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractBundle'
description: ''
put:
operationId: rr_api_v1_contracts_bundles_update
summary: Update Contract Bundle
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractBundle'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ContractBundle'
multipart/form-data:
schema:
$ref: '#/components/schemas/ContractBundle'
required: true
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractBundle'
description: ''
patch:
operationId: rr_api_v1_contracts_bundles_partial_update
summary: Partial Update Contract Bundle
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedContractBundle'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedContractBundle'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedContractBundle'
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractBundle'
description: ''
delete:
operationId: rr_api_v1_contracts_bundles_destroy
summary: Delete Contract Bundle
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'204':
description: No response body
/rr/api/v1/contracts/{contract_id}/milestones:
get:
operationId: list_contract_milestones
description: "\n Retrieve a list of milestones for a specific contract with optional filtering and sorting.\n\n Supports including soft-deleted records for audit and recovery purposes.\n When include_deleted=true, returns ONLY deleted records instead of active records.\n Deleted records contain minimal data: 'id', 'is_deleted=true', 'deleted_at' timestamp,\n and 'last_modified_at'. When 'false' or omitted, returns ONLY active records.\n This provides clean separation between active and deleted data.\n "
summary: List Contract Milestones
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: query
name: include_deleted
schema:
type: boolean
default: false
description: 'When set to ''true'', returns ONLY deleted records instead of active records. Deleted records contain minimal data: ''id'', ''is_deleted=true'', ''deleted_at'' timestamp, and ''last_modified_at''. When ''false'' or omitted, returns ONLY active records. This provides clean separation between active and deleted data.'
- in: query
name: last_modified_at__gte
schema:
type: string
description: 'Filter for records modified on or after this timestamp. Format: ISO 8601 (e.g., ''2024-01-01T00:00:00Z'' or ''2024-01-01''). Works with both active records and deleted records (filters by deletion time for deleted records).'
- in: query
name: last_modified_at__lte
schema:
type: string
description: 'Filter for records modified on or before this timestamp. Format: ISO 8601 (e.g., ''2024-12-31T23:59:59Z'' or ''2024-12-31''). Works with both active records and deleted records (filters by deletion time for deleted records).'
- name: limit
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: offset
required: false
in: query
description: The initial index from which to return the results.
schema:
type: integer
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedContractMilestoneList'
description: ''
post:
operationId: create_contract_milestone
description: Create a new milestone for a contract. This will automatically create an associated revenue transaction.
summary: Create Contract Milestone
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractMilestone'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ContractMilestone'
multipart/form-data:
schema:
$ref: '#/components/schemas/ContractMilestone'
required: true
security:
- knoxApiToken: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractMilestone'
description: ''
/rr/api/v1/contracts/{contract_id}/milestones/{milestone_id}/allocations:
get:
operationId: rr_api_v1_contracts_milestones_allocations_retrieve
description: Retrieve the current bundle allocation details for a contract subscription, milestone, or usage.
summary: Get Bundle Allocations
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: milestone_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractProductBundle'
description: ''
put:
operationId: rr_api_v1_contracts_milestones_allocations_update
description: "\n Update the bundle allocations for a contract item.\n\n The sum of all line amounts must equal the bundle's total_amount.\n Changes will cascade to related RevenueTransactions and JournalEntries.\n "
summary: Update Bundle Allocations
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: milestone_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractProductBundleUpdate'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ContractProductBundleUpdate'
multipart/form-data:
schema:
$ref: '#/components/schemas/ContractProductBundleUpdate'
required: true
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractProductBundle'
description: ''
patch:
operationId: rr_api_v1_contracts_milestones_allocations_partial_update
description: Partially update bundle allocations. Same behavior as PUT.
summary: Partial Update Bundle Allocations
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: milestone_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedContractProductBundleUpdate'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedContractProductBundleUpdate'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedContractProductBundleUpdate'
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractProductBundle'
description: ''
/rr/api/v1/contracts/{contract_id}/milestones/{id}:
get:
operationId: rr_api_v1_contracts_milestones_retrieve
summary: Retrieve Contract Milestone
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractMilestone'
description: ''
put:
operationId: rr_api_v1_contracts_milestones_update
summary: Update Contract Milestone
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractMilestone'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ContractMilestone'
multipart/form-data:
schema:
$ref: '#/components/schemas/ContractMilestone'
required: true
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractMilestone'
description: ''
patch:
operationId: rr_api_v1_contracts_milestones_partial_update
summary: Partial Update Contract Milestone
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedContractMilestone'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedContractMilestone'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedContractMilestone'
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractMilestone'
description: ''
delete:
operationId: rr_api_v1_contracts_milestones_destroy
summary: Delete Contract Milestone
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'204':
description: No response body
/rr/api/v1/contracts/{contract_id}/prepaid-commit-summary:
get:
operationId: get_prepaid_commit_summary
summary: Get Prepaid Commit Summary
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
description: No response body
/rr/api/v1/contracts/{contract_id}/prepaid-commits:
get:
operationId: list_prepaid_commits
summary: List Prepaid Commits
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
- name: limit
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: offset
required: false
in: query
description: The initial index from which to return the results.
schema:
type: integer
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedContractPrepaidCommitList'
description: ''
post:
operationId: create_prepaid_commit
summary: Create Prepaid Commit
parameters:
- in: path
name: contract_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractPrepaidCommit'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/ContractPrepaidCommit'
multipart/form-data:
schema:
$ref: '#/components/schemas/ContractPrepaidCommit'
required: true
security:
- knoxApiToken: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/ContractPrepaidCommit'
description: ''
/rr/api/v1/contracts/{contract_id}/prepaid-commits/{commit_id}/consumption:
get:
operationId: list_prepaid_commit_consumption
summary: List Prepaid Commit Consumption
parameters:
- in: path
name: commit_id
schema:
type: integer
required: true
- in: path
name: contract_id
schema:
type: integer
required: true
- name: limit
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: offset
required: false
in: query
description: The initial index from which to return the results.
schema:
type: integer
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedContractPrepaidCommitConsumptionList'
description: ''
post:
operationId: create_prepaid_commit_consumption
summary: Create Prepaid Commit Consumption
parameters:
- in: path
name: commit_id
schema:
type: integer
required: true
- in: path
name: contract_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RecordConsumptionInput'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/RecordConsumptionInput'
multipart/form-data:
schema:
$ref: '#/components/schemas/RecordConsumptionInput'
required: true
security:
- knoxApiToken: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/RecordConsumptionInput'
description: ''
/rr/api/v1/contracts/{contract_id}/prepaid-commits/{commit_id}/consumption/{id}:
put:
operationId: update_prepaid_commit_consumption
summary: Update Prepaid Commit Consumption
parameters:
- in: path
name: commit_id
schema:
type: integer
required: true
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
description: No response body
delete:
operationId: delete_prepaid_commit_consumption
summary: Delete Prepaid Commit Consumption
parameters:
- in: path
name: commit_id
schema:
type: integer
required: true
- in: path
name: contract_id
schema:
type: integer
required: true
- in: path
name: id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'204':
description: No response body
/rr/api/v1/contracts/{contract_id}/prepaid-commits/{commit_id}/process-adjustments:
post:
operationId: process_prepaid_commit_adjustments
description: Process adjustment events for a prepaid commit and create credit memos.
summary: Process Prepaid Commit Adjustments
parameters:
- in: path
name: commit_id
schema:
type: integer
required: true
- in: path
name: contract_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
description: No response body
/rr/api/v1/contracts/{contract_id}/prepaid-commits/{commit_id}/usage-events:
get:
operationId: list_prepaid_commit_usage_events
summary: List Prepaid Commit Usage Events
parameters:
- in: path
name: commit_id
schema:
type: integer
required: true
- in: path
name: contract_id
schema:
type: integer
required: true
- name: limit
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: offset
required: false
in: query
description: The initial index from which to return the results.
schema:
type: integer
tags:
- Revenue Recognition
security:
- knoxApiToken: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedPrepaidUsageEventList'
description: ''
/rr/api/v1/contracts/{contract_id}/prepaid-commits/{commit_id}/usage-events/distinct-values:
get:
operationId: get_prepaid_commit_usage_event_distinct_values
description: Return distinct values for a given JSONB data field, for filter dropdowns.
summary: Get Prepaid Commit Usage Event Distinct Values
parameters:
- in: path
name: commit_id
schema:
type: integer
required: true
- in: path
name: contract_id
schema:
type: integer
required: true
tags:
- Revenue Recognition
security:
# --- truncated at 32 KB (228 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/campfire/refs/heads/main/openapi/campfire-revenue-recognition-api-openapi.yml