openapi: 3.0.3 info: title: Campfire Developer APIs Accounts Payable Accounts Receivable 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: Accounts Receivable description: Operations related to invoicing and the AR subledger paths: /coa/api/v1/credit-memo: get: operationId: coa_api_v1_credit_memo_list description: "\n Retrieves a paginated list of accounting credit memos with comprehensive filtering and sorting capabilities.\n\n This endpoint provides a powerful interface for browsing and searching credit memos with:\n - Advanced filtering by date ranges, status, clients, entities, and contracts\n - Full-text search across credit memo numbers, messages, and client names\n - Flexible sorting by multiple fields including amounts and relationships\n - Optimized performance with efficient database queries and pagination\n - Complete credit memo details including line items, payment status, and accounting relationships\n\n **Key Features:**\n - Date range filtering for credit memo creation and application dates\n - Status-based filtering (open, partially_used, used, voided)\n - Client and entity-based filtering with hierarchical client support\n - Contract association filtering for revenue recognition workflows\n - Full-text search capabilities across key fields\n\n **Query Parameters:**\n - `start_date`, `end_date`: Filter by credit memo date range\n - `status`: Filter by application status (open, partially_used, used, voided)\n - `q`: Full-text search across credit memo number, message, and client name\n - `client`: Filter by specific client IDs (supports multiple values)\n - `entity`: Filter by specific entity IDs (supports multiple values)\n - `contract`: Filter by specific contract IDs (supports multiple values)\n - `sort`: Sort by various fields (credit_memo_date, client_name, total_amount, etc.)\n - `limit`, `offset`: Pagination controls for large result sets\n " summary: List Credit Memos parameters: - in: query name: client schema: type: array items: type: integer description: Filter by client IDs (can specify multiple) - in: query name: contract schema: type: array items: type: integer description: Filter by contract IDs (can specify multiple) - in: query name: end_date schema: type: string description: Filter credit memos created on or before this date (YYYY-MM-DD format) - in: query name: entity schema: type: array items: type: integer description: Filter by entity IDs (can specify multiple) - in: query name: limit schema: type: integer description: Number of results to return per page - in: query name: offset schema: type: integer description: Number of results to skip for pagination - in: query name: q schema: type: string description: Search credit memo numbers, messages, and client names - in: query name: sort schema: type: string enum: - -amount_used - -client_name - -credit_memo_date - -credit_memo_number - -total_amount - amount_used - client_name - credit_memo_date - credit_memo_number - total_amount description: Sort results by field (prefix with - for descending) - in: query name: start_date schema: type: string description: Filter credit memos created on or after this date (YYYY-MM-DD format) - in: query name: status schema: type: string enum: - open - partially_used - used - voided description: Filter by application status tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedAccountingCreditMemoList' examples: CreditMemosListResponse: value: count: 123 next: http://api.example.org/accounts/?offset=400&limit=100 previous: http://api.example.org/accounts/?offset=200&limit=100 results: - count: 150 next: http://api.example.com/credit-memos/?limit=20&offset=20 previous: null results: - id: 4258 lines: - id: 5449 account_number: '4107' account_name: 4107 - Subscription fees product_name: Annual Subscription department_name: Engineering tags: - id: 7736 parent_name: null parent: null name: Other created_at: 2025-06-18T21:09:34+0000 last_modified_at: 2025-06-18T21:09:34+0000 group: null description: Credit for overpayment on annual subscription amount: 1000.23 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-25T21:04:38+0000 product: 3679 account: 169208 department: 35 payments: [] total_amount: 1000.23 amount_used: 0 amount_remaining: 1000.23 entity_name: Top Level entity_currency: USD client_name: Client A credit_account_name: 5230 - Cloud Credits attachments: [] credit_memo_number: CM-0000008 voided_date: null ref_number: null credit_memo_date: '2025-07-01' applied_date: null message_on_credit_memo: Credit memo for annual subscription overpayment. Thank you for your business. application_status: open currency: USD exchange_rate: 1 exchange_rate_book: 1 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-25T21:04:38+0000 customer: 2 entity: 54 client: 33973 credit_account: 41905 journal_entry: 7491953 contract: null voided_journal_entry: null summary: Credit Memos List Response description: '' post: operationId: coa_api_v1_credit_memo_create description: "\n Creates a new accounting credit memo with line items and automatic journal entry generation.\n\n This endpoint allows for comprehensive credit memo creation with:\n - Multiple line items with different products, accounts, amounts, and departmental allocations\n - Automatic journal entry creation following double-entry bookkeeping principles\n - Multi-currency support with exchange rate handling\n - Client and entity relationship management\n - Contract associations for revenue recognition tracking\n - Product-based line item categorization with tax handling\n - Tag-based transaction categorization and reporting\n " summary: Create Credit Memo tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' examples: CreateCreditMemoRequest: value: lines: - tags: - id: '7736' name: Other product: '3679' product_name: Annual Subscription account: '169208' account_name: Subscription fees department: '35' department_name: Engineering description: Credit for overpayment on annual subscription amount: 1000.23 entity: '54' entity_name: Top Level entity_currency: USD currency: USD client: '33973' client_name: Client A credit_memo_date: '2025-07-01' exchange_rate_book: 1 exchange_rate: 1 credit_account: '41905' credit_account_name: 5230 - Cloud Credits message_on_credit_memo: Credit memo for annual subscription overpayment. Thank you for your business. summary: Create Credit Memo Request application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/AccountingCreditMemo' multipart/form-data: schema: $ref: '#/components/schemas/AccountingCreditMemo' required: true security: - knoxApiToken: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' examples: CreateCreditMemoResponse: value: id: 4258 lines: - id: 5449 account_number: '4107' account_name: 4107 - Subscription fees product_name: Annual Subscription department_name: Engineering tags: - id: 7736 parent_name: null parent: null name: Other created_at: 2025-06-18T21:09:34+0000 last_modified_at: 2025-06-18T21:09:34+0000 group: null description: Credit for overpayment on annual subscription amount: 1000.23 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-25T21:04:38+0000 product: 3679 account: 169208 department: 35 payments: [] total_amount: 1000.23 amount_used: 0 amount_remaining: 1000.23 entity_name: Top Level entity_currency: USD client_name: Client A credit_account_name: 5230 - Cloud Credits attachments: [] credit_memo_number: CM-0000008 voided_date: null ref_number: null credit_memo_date: '2025-07-01' applied_date: null message_on_credit_memo: Credit memo for annual subscription overpayment. Thank you for your business. application_status: open currency: USD exchange_rate: 1 exchange_rate_book: 1 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-25T21:04:38+0000 customer: 2 entity: 54 client: 33973 credit_account: 41905 journal_entry: 7491953 contract: null voided_journal_entry: null summary: Create Credit Memo Response description: '' /coa/api/v1/credit-memo/{credit_memo_id}/mark-used: post: operationId: coa_api_v1_credit_memo_mark_used_create description: "Mark a credit memo as used by linking to an existing transaction.\n\n The transaction's debit amount will be recategorized to A/R to clear the credit memo.\n The credit memo's status will be updated to \"used\" or \"partially_used\" based on\n the amount applied vs the total amount." summary: Mark Credit Memo as Used parameters: - in: path name: credit_memo_id schema: type: integer description: ID of the credit memo to mark as used required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/MarkCreditMemoUsed' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MarkCreditMemoUsed' multipart/form-data: schema: $ref: '#/components/schemas/MarkCreditMemoUsed' required: true security: - knoxApiToken: [] responses: '200': content: application/json: schema: description: Credit memo marked as used successfully description: '' /coa/api/v1/credit-memo/{credit_memo_id}/payment/{payment_id}/void: post: operationId: coa_api_v1_credit_memo_payment_void_create description: "Void a credit memo 'mark used' payment by creating a reversing journal entry.\n\n This creates a reversing JE that credits the A/R account and debits Uncategorized,\n then marks the payment as voided." summary: Void Credit Memo Used Payment parameters: - in: path name: credit_memo_id schema: type: integer description: ID of the credit memo required: true - in: path name: payment_id schema: type: integer description: ID of the payment to void required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/VoidPayment' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/VoidPayment' multipart/form-data: schema: $ref: '#/components/schemas/VoidPayment' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemoPayment' description: '' delete: operationId: coa_api_v1_credit_memo_payment_void_destroy description: "Remove a credit memo 'mark used' payment application.\n\n This recategorizes the transaction back to Uncategorized and deletes the payment record." summary: Delete Credit Memo Used Payment parameters: - in: path name: credit_memo_id schema: type: integer description: ID of the credit memo required: true - in: path name: payment_id schema: type: integer description: ID of the payment to delete required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '204': description: No response body /coa/api/v1/credit-memo/{credit_memo_id}/reopen/: post: operationId: coa_api_v1_credit_memo_reopen_create description: "Reopen a voided credit memo.\n\n This removes the void date and void journal entry, and sets the credit memo status back to open.\n The voiding journal entry will be deleted to reverse the void operation." summary: Reopen Voided Credit Memo parameters: - in: path name: credit_memo_id schema: type: integer description: ID of the voided credit memo to reopen required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' description: '' /coa/api/v1/credit-memo/{credit_memo_id}/void/: post: operationId: coa_api_v1_credit_memo_void_create description: "Void an existing credit memo.\n\n This creates a reversing journal entry to void the credit memo by reversing all debit and credit amounts.\n The credit memo status will be updated to reflect the void." summary: Void Credit Memo parameters: - in: path name: credit_memo_id schema: type: integer description: ID of the credit memo to void required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/VoidCreditMemoRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/VoidCreditMemoRequest' multipart/form-data: schema: $ref: '#/components/schemas/VoidCreditMemoRequest' required: true security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' description: '' /coa/api/v1/credit-memo/{id}: get: operationId: coa_api_v1_credit_memo_retrieve description: "\n Retrieves a single accounting credit memo with complete details including line items, payments, and accounting relationships.\n\n This endpoint provides comprehensive credit memo information with:\n - Complete credit memo metadata (dates, amounts, status, currency, terms)\n - All associated line items with product details, account information, and departmental allocations\n - Payment application history with journal entry references and transaction details\n - Client and entity information with relationship details\n - Contract associations for revenue recognition and reporting\n - File attachments and supporting documentation\n - Journal entry references for accounting audit trails and compliance\n " summary: Retrieve Credit Memo parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' examples: CreditMemoDetailsResponse: value: id: 4258 lines: - id: 5449 account_number: '4107' account_name: 4107 - Subscription fees product_name: Annual Subscription department_name: Engineering tags: - id: 7736 parent_name: null parent: null name: Other created_at: 2025-06-18T21:09:34+0000 last_modified_at: 2025-06-18T21:09:34+0000 group: null description: Credit for overpayment on annual subscription amount: 1000.23 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-25T21:04:38+0000 product: 3679 account: 169208 department: 35 payments: - id: 2205 payment_journal_entry: 7495832 payment_journal_entry_order: JE-0007823 payment_transaction: 19485762 amount: 500.0 payment_date: '2025-07-15' created_at: 2025-07-15T14:30:22+0000 last_modified_at: 2025-07-15T14:30:22+0000 voided_date: null voided_journal_entry: null invoice: id: 47892 invoice_number: INV-0000512 total_amount: 1000.23 amount_used: 500.0 amount_remaining: 500.23 entity_name: Top Level entity_currency: USD client_name: Client A contract_name: Annual Service Agreement 2025 credit_account_name: 5230 - Cloud Credits attachments: - id: 15643 name: credit_memo_supporting_docs.pdf file_size: 245760 content_type: application/pdf created_at: 2025-07-01T10:15:33+0000 last_modified_at: 2025-07-01T10:15:33+0000 credit_memo_number: CM-0000008 voided_date: null voided_journal_entry_order: null ref_number: REF-2025-0087 credit_memo_date: '2025-07-01' applied_date: '2025-07-15' message_on_credit_memo: Credit memo for annual subscription overpayment. Thank you for your business. application_status: partially_used currency: USD exchange_rate: 1 exchange_rate_book: 1 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-15T14:30:22+0000 customer: 2 entity: 54 client: 33973 credit_account: 41905 journal_entry: 7491953 contract: 1892 voided_journal_entry: null summary: Credit Memo Details Response description: '' put: operationId: coa_api_v1_credit_memo_update description: "\n Performs a complete update of an existing accounting credit memo using PUT semantics.\n\n This endpoint allows full replacement of credit memo data including:\n - Complete credit memo metadata update (dates, amounts, client, entity, currency)\n - Full line item replacement with new products, accounts, amounts, and departmental allocations\n - Journal entry recalculation and update with new accounting transactions\n - Exchange rate updates for multi-currency credit memos\n - Contract and reference number association updates\n - Custom field updates and modifications\n\n **Important Notes:**\n - This is a full replacement operation - all credit memo data will be updated\n - Missing fields in the request will be set to null or default values\n - Existing line items will be completely replaced with the new line items\n - Journal entries will be updated to reflect all changes\n " summary: Update Credit Memo parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' examples: UpdateCreditMemoRequest: value: lines: - tags: - id: '7736' name: Other product: '3679' product_name: Annual Subscription account: '169208' account_name: Subscription fees department: '35' department_name: Engineering description: Updated credit for subscription overpayment amount: 1250.5 - tags: [] product: '3680' product_name: Professional Services account: '169209' account_name: Service Revenue department: '36' department_name: Sales description: Additional credit for services amount: 500.0 entity: '54' entity_name: Top Level entity_currency: USD currency: USD client: '33973' client_name: Client A credit_memo_date: '2025-07-01' exchange_rate_book: 1 exchange_rate: 1 credit_account: '41905' credit_account_name: 5230 - Cloud Credits message_on_credit_memo: Updated credit memo for subscription overpayment and additional services. Thank you for your business. ref_number: REF-2025-0087-UPDATED summary: Update Credit Memo Request application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/AccountingCreditMemo' multipart/form-data: schema: $ref: '#/components/schemas/AccountingCreditMemo' required: true security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' examples: UpdateCreditMemoResponse: value: id: 4258 lines: - id: 5449 account_number: '4107' account_name: 4107 - Subscription fees product_name: Annual Subscription department_name: Engineering tags: - id: 7736 parent_name: null parent: null name: Other created_at: 2025-06-18T21:09:34+0000 last_modified_at: 2025-06-18T21:09:34+0000 group: null description: Updated credit for subscription overpayment amount: 1250.5 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-25T22:15:12+0000 product: 3679 account: 169208 department: 35 - id: 5450 account_number: '4108' account_name: 4108 - Service Revenue product_name: Professional Services department_name: Sales tags: [] description: Additional credit for services amount: 500.0 created_at: 2025-07-25T22:15:12+0000 last_modified_at: 2025-07-25T22:15:12+0000 product: 3680 account: 169209 department: 36 payments: [] total_amount: 1750.5 amount_used: 0 amount_remaining: 1750.5 entity_name: Top Level entity_currency: USD client_name: Client A credit_account_name: 5230 - Cloud Credits attachments: [] credit_memo_number: CM-0000008 voided_date: null ref_number: REF-2025-0087-UPDATED credit_memo_date: '2025-07-01' applied_date: null message_on_credit_memo: Updated credit memo for subscription overpayment and additional services. Thank you for your business. application_status: open currency: USD exchange_rate: 1 exchange_rate_book: 1 created_at: 2025-07-25T21:04:38+0000 last_modified_at: 2025-07-25T22:15:12+0000 customer: 2 entity: 54 client: 33973 credit_account: 41905 journal_entry: 7491953 contract: null voided_journal_entry: null summary: Update Credit Memo Response description: '' patch: operationId: coa_api_v1_credit_memo_partial_update description: "\n Performs a partial update of an existing accounting credit memo using PATCH semantics.\n\n This endpoint allows selective modification of credit memo fields without requiring\n a complete credit memo replacement. You can update specific aspects of the credit memo while\n leaving other fields unchanged.\n\n **Updatable Fields:**\n - Credit memo metadata (dates, messages, descriptions, client, entity, currency)\n - Line items (amounts, accounts, descriptions, departments, products)\n - Reference numbers and contract associations\n - Exchange rates and currency information\n - Custom fields and additional metadata\n - Application status and tracking information\n " summary: Partial Update Credit Memo parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedAccountingCreditMemo' examples: UpdateCreditMemoAmount: value: amount: '750.00' internal_message: 'Adjusted credit amount per client request - approval #CM-2024-456' summary: Update Credit Memo Amount description: Partial update to adjust the credit memo amount and add internal notes UpdateLineItem: value: line_items: - id: line-item-uuid-789 description: 'Updated: Credit for Enterprise license overpayment - Q1 2024' department: id: dept-uuid-accounting name: Accounting Department summary: Update Line Item description: Partial update to modify a specific line item description and department application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedAccountingCreditMemo' multipart/form-data: schema: $ref: '#/components/schemas/PatchedAccountingCreditMemo' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingCreditMemo' examples: UpdateCreditMemoResponse: value: id: 9a4bc225-ebe6-41fa-9a2f-de7947899c6c number: CM-2024-001 date: '2024-03-15' amount: '750.00' currency: USD exchange_rate: '1.0000' amount_used: '0.00' amount_available: '750.00' status: open client: id: client-uuid-123 name: Acme Corporation currency: USD entity: id: entity-uuid-456 name: Tech Solutions LLC internal_message: 'Adjusted credit amount per client request - approval #CM-2024-456' client_message: 'Credit for overpayment on Invoice #INV-2024-001' line_items: - id: line-item-uuid-789 account: id: account-uuid-revenue name: Revenue - Software Licenses code: '4001' description: Credit for software license overpayment amount: '750.00' department: id: dept-uuid-sales name: Sales Department product: id: product-uuid-license name: Enterprise License applied_payments: [] tags: - overpayment - software-license contract: null created_at: '2024-03-15T10:30:00Z' updated_at: '2024-03-16T14:22:00Z' summary: Update Credit Memo Response description: Response showing the updated credit memo with modified amount and notes description: '' delete: operationId: coa_api_v1_credit_memo_destroy description: "\n Permanently deletes an accounting credit memo and all associated data from the system.\n\n This endpoint performs a complete removal of the credit memo including:\n - Complete credit memo record deletion with all line items\n - Automatic journal entry removal and accounting transaction cleanup\n\n **Accounting Impact:**\n - Associated journal entries are automatically deleted to maintain accounting integrity\n - Exchange rate records and multi-currency data are cleaned up\n\n **Restrictions:**\n - Credit memos that have been applied to invoices cannot be deleted\n - Credit memos in closed accounting periods may have deletion restrictions\n - Consider the impact on historical financial reporting\n " summary: Delete Credit Memo parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '204': description: No response body /coa/api/v1/credit-memo/{id}/pdf/: get: operationId: get_credit_memo_pdf summary: Get Credit Memo PDF parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': description: No response body /coa/api/v1/credit-memo/{id}/send/: put: operationId: send_credit_memo description: Send a single credit memo via email. summary: Send Credit Memo parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': description: No response body /coa/api/v1/credit-memo/bulk-search: post: operationId: coa_api_v1_credit_memo_bulk_search_create description: Search for thousands of credit memos by exact credit memo number match in a single request. Optimized for performance. summary: Bulk Search Credit Memos by Number tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/BulkCreditMemoSearch' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/BulkCreditMemoSearch' multipart/form-data: schema: $ref: '#/components/schemas/BulkCreditMemoSearch' required: true security: - knoxApiToken: [] responses: '200': content: application/json: schema: type: object additionalProperties: {} description: Unspecified response body description: '' /coa/api/v1/credit-memo/next-credit-memo-number: get: operationId: coa_api_v1_credit_memo_next_credit_memo_number_retrieve summary: Get Next Credit Memo Number tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': description: No response body /coa/api/v1/invoice/: get: operationId: coa_api_v1_invoice_list description: "\n Retrieve a paginated list of invoices with comprehensive filtering, sorting, and download capabilities.\n\n This endpoint provides powerful invoice listing with:\n - Advanced filtering by date ranges, status, clients, and entities\n - Full-text search across multiple fields\n - Flexible sorting options including custom calculated fields\n - Async CSV export functionality via email\n - Optimized queries with prefetched relationships\n\n **Filtering Options:**\n - Date-based filtering (invoice_date, due_date ranges)\n - Status-based filtering (payment status, sent status, aging buckets)\n - Entity and client-based filtering (supports multiple selections)\n - Contract and currency filtering\n - Full-text search across invoice numbers, addresses, messages, and client names\n\n **Sorting Capabilities:**\n - Standard field sorting (invoice_date, total_amount, due_date, etc.)\n - Custom calculated field sorting (amount_due, client_name, contract_name)\n - Ascending/descending order with null handling\n\n **Performance Features:**\n - Efficient database queries with proper indexing\n - Prefetched related objects (lines, payments, clients, entities)\n - Pagination support for large datasets\n - Optimized for high-volume invoice management\n\n **Export Functionality:**\n - Async CSV generation and email delivery\n - Filtered export based on current query parameters\n - Background processing to handle large datasets\n " summary: List Invoices parameters: - in: query name: client schema: type: integer description: Filter by client ID. Can be specified multiple times explode: true style: form - in: query name: contract schema: type: integer description: Filter by contract ID - in: query name: currency schema: type: string description: Filter by currency code (e.g., USD, EUR) - in: query name: download schema: type: boolean default: false description: If true, triggers async CSV download workflow and sends result via email - in: query name: end_date schema: type: string description: Filter invoices with invoice_date on or before this date (YYYY-MM-DD) - in: query name: entity schema: type: integer description: Filter by entity ID. Can be specified multiple times explode: true style: form - in: query name: invoice_number schema: type: string description: Filter by exact invoice number - name: limit required: false in: query description: Number of results to return per page. schema: type: integer - in: query name: line_tag_group_id schema: type: integer description: Filter invoices with at least one line item assigned a tag from this tag group ID - in: query name: line_tag_id schema: type: integer description: Filter invoices with at least one line item assigned this tag ID - name: offset required: false in: query description: The initial index from which to return the results. schema: type: integer - in: query name: paid_date_from schema: type: string description: Filter invoices with paid_date on or after this date (YYYY-MM-DD) - in: query name: paid_date_to schema: type: string description: Filter invoices with paid_date on or before this date (YYYY-MM-DD) - in: query name: parent_client schema: type: integer description: Filter by parent client (Vendor) ID. Returns invoices for the specified client and all of its descendants via vendor lineage. - in: query name: q schema: type: string description: Search query - searches shipping address, invoice number, message, or client name - in: query name: ref_number schema: type: string description: Filter by exact ref number - in: query name: sentStatus schema: type: string enum: - not_sent - sent description: Filter by sent status - in: query name: sort schema: type: string default: -invoice_date description: 'Sort order. Use field name for ascending, -field for descending. Special fields: client_name, amount_due. Default: -invoice_date' - in: query name: start_date schema: type: string description: Filter invoices with invoice_date on or after this date (YYYY-MM-DD) - in: query name: status schema: type: string enum: - '1_30' - '31_60' - '61_90' - '91_120' - current - over_120 - paid - partially_paid - past_due - sent - uncollectible - unpaid - voided description: Filter by payment status tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedAccountingInvoiceListList' description: '' post: operationId: coa_api_v1_invoice_create description: "\n Creates a new accounting invoice with line items and automatic journal entry generation.\n\n This endpoint allows for comprehensive invoice creation with:\n - Multiple line items with different products, rates, quantities, and tax handling\n - Automatic accounts receivable journal entry creation\n - Tax calculations and tax account handling\n - Multi-currency support with exchange rate handling\n - Product-based taxation rules\n - Service date tracking for revenue recognition\n - Contract and purchase order integration\n - Stripe payment integration support\n\n Key features:\n - Credits revenue accounts for each line item amount\n - Debits accounts receivable for the total amount\n - Handles tax calculations with appropriate tax accounts\n - Supports entity-specific currency conversions\n - Creates proper double-entry accounting transactions\n - Validates client, entity, and product relationships\n - Integrates with Stripe for payment processing\n\n Requirements:\n - All referenced products, clients, and entities must exist and be active\n - Client must be of type 'customer'\n - Line items must have valid amounts, quantities, and rates\n - Currency must be valid for the entity\n - Tax calculations must comply with configured tax rules\n " summary: Create Invoice tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' examples: CreateInvoiceRequest: value: terms: net_30 invoice_date: '2025-07-01' due_date: '2025-07-31' lines: - service_date: '2025-07-01' amount: 50 product: '2545' product_name: Product A product_is_taxable: false anrok_item_id: null rate: 50 description: Invoice Line Item quantity: 1 tax: 5 entity: '54' entity_name: Top Level entity_currency: USD entity_invoice_message: 'Please make a payment to the following bank: Bank Name: JP Morgan Chase Bank Address: 456 Another Rd, San Francisco, CA, USA SWIFT/BIC Code: XYZBUS22 Account Number: 123456789 Account Type: Checking Account Name: Campfire Software' currency: USD message_on_invoice: 'Please make a payment to the following bank: Bank Name: JP Morgan Chase Bank Address: 456 Another Rd, San Francisco, CA, USA SWIFT/BIC Code: XYZBUS22 Account Number: 123456789 Account Type: Checking Account Name: Campfire Software' stripe_connection: '' stripe_connection_name: '' stripe_connection_entity: '54' exchange_rate_book: 1 exchange_rate: 1 client: '33973' client_name: Client A client_email: null client_invoice_message: null billing_address: '' shipping_address: '' contract: '12954' contract_name: Campfire invoice_number: '987654321' purchase_order_number: '123456789' item_date: '2025-07-01' period_start: '2025-07-01' period_end: '2025-07-31' summary: Create Invoice Request application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/AccountingInvoice' multipart/form-data: schema: $ref: '#/components/schemas/AccountingInvoice' required: true security: - knoxApiToken: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' examples: CreateInvoiceResponse: value: id: 145055 lines: - id: 337587 product_name: Product A stripe_product_id: null product_is_taxable: false anrok_item_id: null service_date: '2025-07-01' description: Invoice Line Item quantity: 1 rate: 50 currency: USD amount: 50 tax: 5 tax_description: null created_at: 2025-07-25T18:54:43+0000 last_modified_at: 2025-07-25T18:54:43+0000 product: 2545 payments: [] payment_journal_entries: [] client_name: Client A client_email: null client_invoice_message: null client_use_stripe_auto_bill: false status: open past_due_days: null entity_name: Top Level entity_currency: USD entity_invoice_message: 'Please make a payment to the following bank: Bank Name: JP Morgan Chase Bank Address: 456 Another Rd, San Francisco, CA, USA SWIFT/BIC Code: XYZBUS22 Account Number: 123456789 Account Type: Checking Account Name: Campfire Software' total_amount: 55 amount_paid: 0 amount_due: 55 contract_name: Campfire attachments: [] invoice_number: '987654321' revenue_transactions: [] item_date: '2025-07-01' voided_journal_entry_order: null search_vector: null search_text: null auto_send_invoice: false auto_send_invoice_at: null auto_sent_at: null reminder_sent_dates: {} billing_address: '' shipping_address: '' terms: net_30 ref_number: null purchase_order_number: '123456789' invoice_date: '2025-07-01' due_date: '2025-07-31' shipping_date: null paid_date: null uncollectible_date: null sent_date: null period_start: '2025-07-01' period_end: '2025-07-31' location_of_sale: null message_on_invoice: 'Please make a payment to the following bank: Bank Name: JP Morgan Chase Bank Address: 456 Another Rd, San Francisco, CA, USA SWIFT/BIC Code: XYZBUS22 Account Number: 123456789 Account Type: Checking Account Name: Campfire Software' payment_status: open warning_message: null created_at: 2025-07-25T18:54:43+0000 last_modified_at: 2025-07-25T18:54:43+0000 currency: USD exchange_rate: 1 exchange_rate_book: 1 last_sent_at: null integration_id: null integration_context: null use_stripe_auto_bill: false stripe_payment_link_id: null stripe_payment_intent_id: null stripe_invoice_id: null stripe_pdf_url: null stripe_payment_link: null source: null source_id: null voided_date: null entity: 54 client: 33973 bad_debt_journal_entry: null journal_entry: 7491952 contract: 12954 avalara_connection: null sphere_connection: null anrok_connection: null tax_rate: null stripe_connection: null source_file: null voided_journal_entry: null summary: Create Invoice Response description: '' /coa/api/v1/invoice-payments: get: operationId: coa_api_v1_invoice_payments_list description: "\n Retrieve a paginated list of invoice payments (payments applied against accounts\n receivable invoices), designed for syncing payment data into external systems.\n\n Results are ordered by (last_modified_at, id) ascending, so pages are stable and\n a sync can resume from where it left off.\n\n **Full sync (cursor pagination):**\n - Pass an empty cursor parameter (cursor=) on the first request\n - Follow the 'next' URL from each response until it is null\n\n **Incremental sync (time-based):**\n - Store the highest last_modified_at value you have processed\n - On the next run, pass it as last_modified_at__gte to fetch only new and updated payments\n\n **Voids:**\n - Voided payments are included by default with voided_date set, so integrators can\n detect payments that were reversed after a previous sync\n - Filter with voided=true or voided=false to fetch only one kind\n " summary: List Invoice Payments parameters: - in: query name: cursor schema: type: string description: Opts into cursor pagination. Pass an empty value (cursor=) on the first request, then follow the 'next' URL from each response until it is null. The cursor value is opaque - do not parse or construct it. Cursor pagination is recommended for full syncs as it avoids the performance penalty of deep offsets on large result sets. - in: query name: external_id schema: type: string description: Filter for the payment carrying this upstream external_id. Use it to reconcile a payment you created via the invoice pay endpoint back to your source-system record. An empty value is ignored and returns all payments. - in: query name: invoice_id schema: type: integer description: Filter for payments applied to this invoice id. - in: query name: last_modified_at__gte schema: type: string description: 'Filter for payments modified on or after this timestamp. Format: ISO 8601 (e.g., ''2024-01-01T00:00:00Z'' or ''2024-01-01''). Use this for incremental syncs: store the highest last_modified_at you have processed and pass it on the next sync run.' - in: query name: last_modified_at__lte schema: type: string description: 'Filter for payments modified on or before this timestamp. Format: ISO 8601 (e.g., ''2024-12-31T23:59:59Z'' or ''2024-12-31''). Date-only values are inclusive of the entire day.' - in: query name: limit schema: type: integer default: 100 description: Maximum number of records to return per page. Default 100, maximum 10000. Use with offset to paginate - in: query name: offset schema: type: integer default: 0 description: Number of records to skip before collecting the result page. Use with limit to paginate - in: query name: skip_count schema: type: boolean default: false description: When 'true', skips the total COUNT query and returns a lower-bound 'count' instead. Recommended for large syncs where the exact total is not needed. - in: query name: voided schema: type: boolean description: Filter by void status. When 'true', returns only voided payments (voided_date is set). When 'false', returns only active payments. When omitted, returns both so integrators can detect and propagate voids. tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedInvoicePaymentSyncList' description: '' /coa/api/v1/invoice/{invoice_id}/calculate-payment: post: operationId: coa_api_v1_invoice_calculate_payment_create description: "Calculate the payment details for an invoice.\n\n This endpoint calculates:\n - Total amount due on the invoice\n - Applied payments (existing + proposed)\n - Applied credits (existing + proposed credit memos)\n - Payment term discounts (based on payment dates) - ALL OR NOTHING: discount only applies if paying full invoice\n - Remaining balance due\n\n Supports payment terms with early payment discounts (all-or-nothing).\n " summary: Calculate Invoice Payment parameters: - in: path name: invoice_id schema: type: integer description: ID of the invoice required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/CalculatePaymentInput' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CalculatePaymentInput' multipart/form-data: schema: $ref: '#/components/schemas/CalculatePaymentInput' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CalculatePaymentOutput' 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: '' /coa/api/v1/invoice/{invoice_id}/default-payment: post: operationId: coa_api_v1_invoice_default_payment_create description: "Get the default payment amount for an invoice based on when payment is posted.\n\n If the invoice has discount terms and the posted date is within the discount period,\n the discounted amount is returned. Otherwise, the full amount is returned.\n " summary: Get Default Payment Amount parameters: - in: path name: invoice_id schema: type: integer description: ID of the invoice required: true tags: - Accounts Receivable 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 security: - knoxApiToken: [] 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: '' /coa/api/v1/invoice/{invoice_id}/pay/: post: operationId: coa_api_v1_invoice_pay_create description: "Mark an invoice as paid, allowing partial payments.\n\n This endpoint supports multiple payment methods:\n - Apply existing transactions as payments\n - Apply credit memos to reduce the invoice balance\n - Create manual payments without a transaction\n\n The request body should contain at least one of:\n - transactions: List of transaction payments to apply\n - credit_memos: List of credit memos to apply\n - empty_transactions: List of manual payments without transactions" summary: Mark Invoice as Paid parameters: - in: path name: invoice_id schema: type: integer description: ID of the invoice to mark as paid required: true tags: - Accounts Receivable 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' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/MarkInvoicePaidResponse' description: '' /coa/api/v1/invoice/{invoice_id}/payment/{payment_id}/void/: post: operationId: coa_api_v1_invoice_payment_void_create description: "Void an existing invoice payment.\n\n This creates a reversing journal entry to void the payment and updates the invoice status.\n For Stripe payments, this will also process a refund through Stripe.\n\n Optionally accepts a void_date in the request body to specify when the payment should be voided.\n If not provided, defaults to today's date." summary: Void Invoice Payment parameters: - in: path name: invoice_id schema: type: integer description: ID of the invoice required: true - in: path name: payment_id schema: type: integer description: ID of the payment to void required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/VoidPayment' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/VoidPayment' multipart/form-data: schema: $ref: '#/components/schemas/VoidPayment' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingInvoicePayment' description: '' delete: operationId: coa_api_v1_invoice_payment_void_destroy description: "Delete an invoice payment.\n\n This removes the payment record and updates the transaction to uncategorized.\n For Stripe payments, this will also process a refund through Stripe." summary: Delete Invoice Payment parameters: - in: path name: invoice_id schema: type: integer description: ID of the invoice required: true - in: path name: payment_id schema: type: integer description: ID of the payment to delete required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '204': description: No response body /coa/api/v1/invoice/{invoice_id}/reopen/: post: operationId: coa_api_v1_invoice_reopen_create description: "Reopen a voided invoice.\n\n This removes the void date and void journal entry, and sets the invoice status back to open.\n The voiding journal entry will be deleted to reverse the void operation." summary: Reopen Voided Invoice parameters: - in: path name: invoice_id schema: type: integer description: ID of the voided invoice to reopen required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' description: '' /coa/api/v1/invoice/{invoice_id}/void/: post: operationId: coa_api_v1_invoice_void_create description: "Void an existing invoice.\n\n This creates a reversing journal entry to void the invoice by reversing all debit and credit amounts.\n The invoice status will be updated to reflect the void." summary: Void Invoice parameters: - in: path name: invoice_id schema: type: integer description: ID of the invoice to void required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/VoidInvoiceRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/VoidInvoiceRequest' multipart/form-data: schema: $ref: '#/components/schemas/VoidInvoiceRequest' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' description: '' /coa/api/v1/invoice/{id}/: get: operationId: coa_api_v1_invoice_retrieve description: "\n Retrieves a single accounting invoice with complete details including line items, payments, and accounting relationships.\n\n This endpoint provides comprehensive invoice information with:\n - Complete invoice metadata (dates, amounts, status, terms)\n - All associated line items with product details and tax information\n - Payment history with journal entry references and transaction details\n " summary: Retrieve Invoice parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' examples: InvoiceWithPayment: value: id: 47864 lines: - id: 206228 product_name: Enterprise Subscription stripe_product_id: prod_RncZVXRunpKxAk product_is_taxable: true anrok_item_id: null service_date: '2028-04-01' description: Enterprise Subscription (2028-04-01 - 2028-06-30) quantity: 1 rate: 6249.99 currency: USD amount: 6249.99 tax: 0 tax_description: null created_at: 2025-05-02T16:24:50+0000 last_modified_at: 2025-05-02T16:24:50+0000 product: 1717 payments: - id: 22220 credit_memo: null currency: USD amount: 6249.99 payment_date: '2025-04-30' created_at: 2025-04-24T23:13:35+0000 voided_date: null source: MANUAL last_modified_at: 2025-04-24T23:13:35+0000 payment_journal_entry: null payment_transaction: null voided_journal_entry: null payment_journal_entries: - null client_name: Apple client_email: null client_invoice_message: null client_use_stripe_auto_bill: false status: paid past_due_days: null entity_name: Top Level entity_currency: USD entity_invoice_message: 'Please make a payment to the following bank: Bank Name: JP Morgan Chase Bank Address: 456 Another Rd, San Francisco, CA, USA SWIFT/BIC Code: XYZBUS22 Account Number: 123456789 Account Type: Checking Account Name: Campfire Software' total_amount: 6249.99 amount_paid: 6249.99 amount_due: 0 attachments: [] invoice_number: INV-0000493 revenue_transactions: [] item_date: null voided_journal_entry_order: null search_vector: null search_text: INV_0000493 Apple auto_send_invoice: false auto_send_invoice_at: null auto_sent_at: null reminder_sent_dates: {} billing_address: '' shipping_address: '' terms: net_30 ref_number: null purchase_order_number: null invoice_date: '2028-04-01' due_date: '2028-05-01' shipping_date: null paid_date: '2025-04-30' uncollectible_date: null sent_date: null period_start: '2028-04-01' period_end: '2028-06-30' location_of_sale: null message_on_invoice: 'Pay invoice here: https://billing.stripe.com/p/login/test_8wM8At9rYeT3ayY4gm' payment_status: paid warning_message: null created_at: 2025-03-21T19:39:47+0000 last_modified_at: 2025-05-02T16:24:50+0000 currency: USD exchange_rate: 1 exchange_rate_book: 1 last_sent_at: null integration_id: null integration_context: null use_stripe_auto_bill: false stripe_payment_link_id: null stripe_payment_intent_id: null stripe_invoice_id: null stripe_pdf_url: null stripe_payment_link: null source: null source_id: null voided_date: null entity: 54 client: 24020 bad_debt_journal_entry: null journal_entry: 2681173 contract: null avalara_connection: null sphere_connection: null anrok_connection: null tax_rate: null stripe_connection: null source_file: null voided_journal_entry: null summary: Invoice with Payment description: '' put: operationId: coa_api_v1_invoice_update description: "\n Performs a complete update of an existing accounting invoice using PUT semantics.\n\n This endpoint allows full replacement of invoice data including:\n - Complete invoice metadata update (dates, amounts, terms, client, entity)\n - Full line item replacement with new products, quantities, rates, and tax calculations\n - Journal entry recalculation and update with new accounting transactions\n - Exchange rate updates for multi-currency invoices\n\n **Important Notes:**\n - This is a full replacement operation - all invoice data will be updated\n - Missing fields in the request will be set to null or default values\n - Existing line items will be completely replaced with the new line items\n - Journal entries will be updated to reflect all changes\n " summary: Update Invoice parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/AccountingInvoice' multipart/form-data: schema: $ref: '#/components/schemas/AccountingInvoice' required: true security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' description: '' patch: operationId: coa_api_v1_invoice_partial_update description: "\n Performs a partial update of an existing accounting invoice using PATCH semantics.\n\n This endpoint allows selective modification of invoice fields without requiring\n a complete invoice replacement. You can update specific aspects of the invoice while\n leaving other fields unchanged.\n\n **Updatable Fields:**\n - Invoice metadata (dates, terms, descriptions, client, entity, currency)\n - Line items (amounts, accounts, descriptions, departments, products)\n - Payment terms and due dates\n - Tax calculations and allocations\n - Custom fields and tags\n - Contract and purchase order associations\n - Exchange rates and currency information\n " summary: Partial Update Invoice parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedAccountingInvoice' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedAccountingInvoice' multipart/form-data: schema: $ref: '#/components/schemas/PatchedAccountingInvoice' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/AccountingInvoice' description: '' delete: operationId: coa_api_v1_invoice_destroy description: "\n Permanently deletes an accounting invoice and its associated journal entry and related data.\n\n This endpoint performs a complete deletion of the invoice including:\n - Removal of all invoice line items and associated product data\n - Deletion of the corresponding accounts receivable journal entry\n - Removal of payment records and journal entries\n\n **Important Notes:**\n - This operation is irreversible and permanently removes the invoice from the system\n - The associated journal entry will be automatically deleted to maintain accounting integrity\n\n **Restrictions:**\n - Invoices in closed accounting periods cannot be deleted\n - Consider the impact on historical financial reporting\n " summary: Delete Invoice parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '204': description: No response body /coa/api/v1/invoice/bulk-apply-payment: post: operationId: coa_api_v1_invoice_bulk_apply_payment_create description: 'Apply a single transaction payment to multiple selected invoices. Supports two selection modes: - Explicit invoice IDs (``invoice_ids``) - Filter-based selection (``filters``) for "select all matching" behaviour Reuses :meth:`MarkInvoicePaidView.apply_transaction_payment` so that line-level payment splitting, FX gain/loss realisation, and transaction cleanup are all respected. A single ``DraftQueue`` is created when approval is required.' summary: Bulk Apply Transaction Payment to Selected Invoices tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/BulkApplyInvoicePayment' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/BulkApplyInvoicePayment' multipart/form-data: schema: $ref: '#/components/schemas/BulkApplyInvoicePayment' required: true security: - knoxApiToken: [] responses: '200': content: application/json: schema: type: object additionalProperties: {} description: '' /coa/api/v1/invoice/bulk-create: post: operationId: bulk_create_invoices description: "\n Create multiple invoices atomically in a single transaction.\n\n All invoices are created within a single database transaction. If any invoice creation fails,\n all invoices are rolled back and no invoices are created.\n\n This endpoint validates all invoices before creating any of them, ensuring data integrity.\n " summary: Bulk Create Invoices tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/BulkCreateInvoices' examples: ExampleRequest: value: invoices: - invoice_date: '2025-05-06' item_date: '2025-05-06' due_date: '2025-06-05' entity: 1 client: 123 currency: USD payment_term: 1 lines: - product: 456 quantity: 1 rate: 1000.0 amount: 1000.0 service_date: '2025-05-06' description: Monthly subscription - invoice_date: '2025-06-06' item_date: '2025-06-06' due_date: '2025-07-06' entity: 1 client: 123 currency: USD payment_term: 1 lines: - product: 456 quantity: 1 rate: 1000.0 amount: 1000.0 service_date: '2025-06-06' description: Monthly subscription summary: Example Request application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/BulkCreateInvoices' multipart/form-data: schema: $ref: '#/components/schemas/BulkCreateInvoices' required: true security: - knoxApiToken: [] responses: '201': content: application/json: schema: type: array items: $ref: '#/components/schemas/AccountingInvoice' examples: ExampleResponse: value: - - id: 1001 invoice_number: INV-20250506-001 invoice_date: '2025-05-06' due_date: '2025-06-05' total_amount: '1000.00' amount_due: '1000.00' status: open - id: 1002 invoice_number: INV-20250606-001 invoice_date: '2025-06-06' due_date: '2025-07-06' total_amount: '1000.00' amount_due: '1000.00' status: open summary: Example Response description: '' '400': description: No response body /coa/api/v1/invoice/bulk-search: post: operationId: coa_api_v1_invoice_bulk_search_create description: Search for thousands of invoices by exact invoice number match in a single request. Optimized for performance. summary: Bulk Search Invoices by Number tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/BulkInvoiceSearch' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/BulkInvoiceSearch' multipart/form-data: schema: $ref: '#/components/schemas/BulkInvoiceSearch' required: true security: - knoxApiToken: [] responses: '200': content: application/json: schema: type: object additionalProperties: {} description: Unspecified response body description: '' /coa/api/v1/invoice/report/{id}/data: get: operationId: coa_api_v1_invoice_report_data_retrieve description: 'Execute saved invoice report and return DataTable-compatible response. :param request: HTTP request with query params :param pk: Custom report ID :return: Paginated, sparse-formatted response' summary: Execute invoice report parameters: - in: query name: aggregation_fields schema: type: string description: 'Aggregates: sum:amount, sum:amount_paid, sum:amount_due, etc.' - in: query name: client_id schema: type: string description: Filter by client ID(s) - in: query name: contract_id schema: type: string description: Filter by contract ID(s) - in: query name: currency schema: type: string description: Filter by currency code - in: query name: department_id schema: type: string description: Filter by department ID(s) - in: query name: end_date schema: type: string description: End date (YYYY-MM-DD) - in: query name: entity_id schema: type: string description: Entity ID(s), comma-separated - in: query name: group_fields schema: type: string description: 'Row dimensions: client_id, invoice_id, invoice_date_month, product_id, etc.' - in: query name: group_keys schema: type: string description: Drilldown parent keys - in: path name: id schema: type: integer required: true - in: query name: include_totals schema: type: boolean description: Include grand totals row - in: query name: limit schema: type: integer description: Page size (max 10000) - in: query name: mode schema: type: string description: paginated | full | csv - in: query name: offset schema: type: integer description: Pagination offset - in: query name: payment_status schema: type: string description: 'Filter by status: draft,open,sent,partial,paid,uncollectible' - in: query name: pivot_fields schema: type: string description: 'Column dimensions: product_id, client_id, etc.' - in: query name: product_id schema: type: string description: Filter by product ID(s) - in: query name: shouldPivot schema: type: boolean description: Enable pivot columns - in: query name: start_date schema: type: string description: Start date (YYYY-MM-DD) tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/InvoiceReportResponse' examples: GroupedByClientWithProductPivot: value: count: 5 results: - client_id: 42 client_name: Acme Corp amount: 50000.0 amount_paid: 30000.0 Widget A::::amount: 25000.0 Widget B::::amount: 25000.0 filter_params: invoice__client_id: 42 group_id: 123456 id: 123456 engine_used: postgres pivot_result_fields: - Widget A::::amount - Widget B::::amount pivot_value_mappings: product_id: Widget A: 1 Widget B: 2 summary: grouped_by_client_with_product_pivot description: '' /coa/api/v1/invoice/report/preview: get: operationId: coa_api_v1_invoice_report_preview_retrieve description: 'Execute invoice report preview from query params. :param request: HTTP request with report configuration :return: Paginated response or CSV stream' summary: Preview invoice report parameters: - in: query name: aggregation_fields schema: type: string description: 'Aggregates: sum:amount, sum:amount_paid, sum:amount_due, etc.' - in: query name: client_id schema: type: string description: Filter by client ID(s) - in: query name: contract_id schema: type: string description: Filter by contract ID(s) - in: query name: currency schema: type: string description: Filter by currency code - in: query name: department_id schema: type: string description: Filter by department ID(s) - in: query name: end_date schema: type: string description: End date (YYYY-MM-DD) - in: query name: entity_id schema: type: string description: Entity ID(s), comma-separated - in: query name: group_fields schema: type: string description: 'Row dimensions: client_id, invoice_id, invoice_date_month, product_id, etc.' - in: query name: group_keys schema: type: string description: Drilldown parent keys - in: query name: include_totals schema: type: boolean description: Include grand totals row - in: query name: limit schema: type: integer description: Page size (max 10000) - in: query name: mode schema: type: string description: paginated | full | csv - in: query name: offset schema: type: integer description: Pagination offset - in: query name: payment_status schema: type: string description: 'Filter by status: draft,open,sent,partial,paid,uncollectible' - in: query name: pivot_fields schema: type: string description: 'Column dimensions: product_id, client_id, etc.' - in: query name: product_id schema: type: string description: Filter by product ID(s) - in: query name: shouldPivot schema: type: boolean description: Enable pivot columns - in: query name: start_date schema: type: string description: Start date (YYYY-MM-DD) tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/InvoiceReportResponse' description: '' /coa/api/v1/invoice/statement/client/{client_id}/pdf/: get: operationId: get_client_invoice_statement_pdf description: 'Generate a customer statement PDF for a specific client. This creates a professional, customer-facing statement showing: - All outstanding invoices as of the specified date - Running balance - Total balance due - Payment advice slip' summary: Get Client Invoice Statement PDF parameters: - in: path name: client_id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': description: No response body /rr/api/v1/product: get: operationId: list_products description: "\n Retrieve a list of contract products 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 Products 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: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedProductList' description: '' post: operationId: create_product description: Create a new product summary: Create Contract Product tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/Product' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Product' multipart/form-data: schema: $ref: '#/components/schemas/Product' security: - knoxApiToken: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/Product' description: '' /rr/api/v1/product/{id}: get: operationId: rr_api_v1_product_retrieve summary: Retrieve Product parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Product' description: '' put: operationId: rr_api_v1_product_update summary: Update Product parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/Product' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Product' multipart/form-data: schema: $ref: '#/components/schemas/Product' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Product' description: '' patch: operationId: rr_api_v1_product_partial_update summary: Partial Update Product parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedProduct' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedProduct' multipart/form-data: schema: $ref: '#/components/schemas/PatchedProduct' security: - knoxApiToken: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Product' description: '' delete: operationId: rr_api_v1_product_destroy summary: Delete Product parameters: - in: path name: id schema: type: integer required: true tags: - Accounts Receivable security: - knoxApiToken: [] responses: '204': description: No response body components: schemas: AccountingCreditMemo: type: object properties: id: type: integer readOnly: true lines: type: array items: $ref: '#/components/schemas/AccountingCreditMemoLine' payments: type: array items: $ref: '#/components/schemas/AccountingCreditMemoPayment' readOnly: true amount_remaining: type: number format: double description: Calculate amount remaining from database fields readOnly: true entity_name: type: string readOnly: true entity_currency: type: string readOnly: true client_name: type: string readOnly: true client_email: type: string readOnly: true contract_name: type: string readOnly: true credit_account_number: type: string readOnly: true credit_account_name: type: string nullable: true description: Combines account number and name in the format "number - name" readOnly: true attachments: type: array items: $ref: '#/components/schemas/File' readOnly: true credit_memo_number: type: string 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 last_modified_at: type: string format: date-time readOnly: true is_deleted: type: boolean readOnly: true default: false deleted_at: type: string format: date-time readOnly: true nullable: true chat_uuid: type: string format: uuid writeOnly: true search_vector: type: string readOnly: true nullable: true search_text: type: string readOnly: true nullable: true credit_memo_type: $ref: '#/components/schemas/CreditMemoTypeEnum' ref_number: type: string nullable: true maxLength: 120 credit_memo_date: type: string format: date applied_date: type: string format: date nullable: true message_on_credit_memo: type: string nullable: true application_status: nullable: true oneOf: - $ref: '#/components/schemas/ApplicationStatusEnum' - $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 last_sent_at: type: string format: date-time nullable: true anrok_transaction_id: type: string nullable: true description: ID of the negation transaction in Anrok for this credit memo maxLength: 255 integration_id: type: string nullable: true maxLength: 250 integration_context: nullable: true vat_number: type: string nullable: true maxLength: 250 total_amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true description: Sum of all line item amounts amount_used: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true description: Sum of all non-voided payment amounts chat_id: type: integer maximum: 2147483647 minimum: -2147483648 nullable: true customer: type: integer readOnly: true entity: type: integer client: type: integer nullable: true credit_account: type: integer nullable: true journal_entry: type: integer nullable: true contract: type: integer nullable: true voided_journal_entry: type: integer nullable: true anrok_connection: type: integer nullable: true avalara_connection: type: integer nullable: true sphere_connection: type: integer nullable: true required: - amount_remaining - attachments - client_email - client_name - contract_name - created_at - credit_account_name - credit_account_number - credit_memo_date - customer - deleted_at - entity - entity_currency - entity_name - id - is_deleted - last_modified_at - lines - payments - search_text - search_vector - voided_date - voided_journal_entry_order PaginatedInvoicePaymentSyncList: type: object required: - count - results properties: count: type: integer example: 123 next: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=400&limit=100 previous: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=200&limit=100 results: type: array items: $ref: '#/components/schemas/InvoicePaymentSync' AccountingInvoiceJournalEntry: type: object properties: id: type: integer readOnly: true journal_entry: type: integer readOnly: true journal_entry_order: type: string readOnly: true journal_entry_date: type: string format: date readOnly: true journal_entry_memo: type: string readOnly: true type: allOf: - $ref: '#/components/schemas/AccountingInvoiceJournalEntryTypeEnum' readOnly: true created_at: type: string format: date-time readOnly: true required: - created_at - id - journal_entry - journal_entry_date - journal_entry_memo - journal_entry_order - type CreditMemoPaymentInput: 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 description: Application date required: - amount - credit_memo_id - posted_at AccountingInvoiceLine: type: object properties: id: type: integer readOnly: true invoice: type: integer writeOnly: true product_name: type: string readOnly: true product_bundle_name: type: string readOnly: true stripe_product_id: type: string readOnly: true product_is_taxable: type: boolean readOnly: true anrok_item_id: type: string readOnly: true sphere_item_id: type: string readOnly: true service_date: type: string format: date nullable: true tags: type: array items: type: object additionalProperties: {} readOnly: true department_name: type: string readOnly: true department_code: type: string readOnly: true withholding_tax_rate_name: type: string readOnly: true withholding_tax_rate_value: type: number format: double nullable: true description: Sum of the selected withholding rate's component rates, for line-level preview. readOnly: true description: type: string nullable: true quantity: type: number format: double maximum: 10000000000000000 minimum: -10000000000000000 exclusiveMaximum: true exclusiveMinimum: true rate: type: number format: double maximum: 10000000000000 minimum: -10000000000000 exclusiveMaximum: true exclusiveMinimum: true currency: type: string maxLength: 3 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 entity_use_code: type: string nullable: true description: Avalara entity/use code for line-level tax exemptions maxLength: 25 discount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true description: Discount amount in currency discount_percentage: type: number format: double maximum: 1000 minimum: -1000 exclusiveMaximum: true exclusiveMinimum: true description: Discount percentage (0-100) discount_amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true description: Discount amount calculated from percentage tag_ids: type: array items: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 tag_group_ids: type: array items: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 created_at: type: string format: date-time readOnly: true last_modified_at: type: string format: date-time readOnly: true customer: type: integer readOnly: true product: type: integer nullable: true product_bundle: type: integer nullable: true withholding_tax_rate: type: integer nullable: true description: Marks this line as subject to withholding; used for preview only. Null = not subject. department: type: integer nullable: true required: - anrok_item_id - created_at - customer - department_code - department_name - id - last_modified_at - product_bundle_name - product_is_taxable - product_name - sphere_item_id - stripe_product_id - tags - withholding_tax_rate_name - withholding_tax_rate_value MarkCreditMemoUsed: type: object description: Serializer for marking a credit memo as used with a transaction. properties: transaction_id: type: integer account_id: type: integer amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true payment_date: type: string format: date memo: type: string nullable: true required: - account_id - amount - payment_date - transaction_id PaginatedAccountingInvoiceListList: type: object required: - count - results properties: count: type: integer example: 123 next: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=400&limit=100 previous: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=200&limit=100 results: type: array items: $ref: '#/components/schemas/AccountingInvoiceList' AccountingCreditMemoPayment: type: object properties: id: type: integer readOnly: true payment_journal_entry_order: type: string readOnly: true voided_journal_entry_order: type: string readOnly: true nullable: true invoice: type: string 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 created_at: type: string format: date-time readOnly: true last_modified_at: type: string format: date-time readOnly: true voided_date: type: string format: date nullable: true customer: type: integer readOnly: true credit_memo: type: integer payment_journal_entry: type: integer payment_transaction: type: integer nullable: true voided_journal_entry: type: integer nullable: true required: - created_at - credit_memo - customer - id - invoice - last_modified_at - payment_journal_entry - payment_journal_entry_order - voided_journal_entry_order ProductUsageTierSummary: type: object properties: id: type: integer name: type: string pricing_type: type: string from_quantity: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true to_quantity: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true price: type: number format: double maximum: 100000000000000 minimum: -100000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true percentage: type: number format: double maximum: 100000000000000 minimum: -100000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true required: - from_quantity - id - name - percentage - price - pricing_type - to_quantity PricingModelEnum: enum: - unit_based - fixed_fee - percentage_based - graduated_tiered - volume_based type: string description: '* `unit_based` - Unit based pricing * `fixed_fee` - Fixed fee pricing * `percentage_based` - Percentage based pricing * `graduated_tiered` - Graduated tiered pricing * `volume_based` - Volume based pricing' 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 PaginatedAccountingCreditMemoList: type: object required: - count - results properties: count: type: integer example: 123 next: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=400&limit=100 previous: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=200&limit=100 results: type: array items: $ref: '#/components/schemas/AccountingCreditMemo' MarkInvoicePaidAutoCreatedCreditMemo: type: object properties: id: type: integer credit_memo_number: type: string required: - credit_memo_number - id EngineUsedEnum: enum: - postgres type: string description: '* `postgres` - postgres' PatchedProduct: type: object properties: id: type: integer readOnly: true is_deleted: type: boolean readOnly: true default: false deleted_at: type: string format: date-time readOnly: true nullable: true department_name: type: string readOnly: true invoice_account_name: type: string nullable: true readOnly: true revenue_account_name: type: string nullable: true readOnly: true ar_account_name: type: string nullable: true readOnly: true bad_debt_account_name: type: string nullable: true readOnly: true invoice_unbilled_account_name: type: string nullable: true readOnly: true tax_account_name: type: string readOnly: true tags: type: array items: type: object additionalProperties: {} readOnly: true last_modified_at: type: string format: date-time readOnly: true product_uuid: type: string format: uuid readOnly: true display_name: type: string readOnly: true usage_group_count: type: integer readOnly: true default: 0 usage_groups: type: array items: $ref: '#/components/schemas/ProductUsageGroupSummary' readOnly: true product_id: type: string nullable: true maxLength: 250 product_name: type: string nullable: true maxLength: 250 product_description: type: string nullable: true maxLength: 250 tag_ids: type: array items: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 tag_group_ids: type: array items: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 currency: type: string nullable: true maxLength: 3 price: type: number format: double maximum: 100000000000000 minimum: -100000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true cost: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true exclude_from_mrr: type: boolean is_taxable: type: boolean is_renewable: type: boolean recognize_revenue: type: boolean description: If False, contract-sync skips the revenue-recognition waterfall for this product (no ContractSubscription / RevenueTransaction rows). is_immediate_recognition: type: boolean description: When true, revenue for this product is recognized in full on the invoice finalization date instead of being amortized over the service period. Used by the Stripe accrual JE waterfall. created_at: type: string format: date-time readOnly: true stripe_product_id: type: string nullable: true maxLength: 250 avalara_item_id: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 nullable: true avalara_item_data: nullable: true avalara_tax_code: type: string nullable: true description: Avalara tax code (e.g., SW052000 for SAAS) maxLength: 50 anrok_item_id: type: string nullable: true maxLength: 250 sphere_item_id: type: string nullable: true maxLength: 250 apply_dept_tag_to_invoice_journals: type: boolean nullable: true description: Apply Department and Tag categorization to all lines on Invoice Journals customer: type: integer readOnly: true department: type: integer nullable: true invoice_account: type: integer nullable: true revenue_account: type: integer nullable: true ar_account: type: integer nullable: true bad_debt_account: type: integer nullable: true invoice_unbilled_account: type: integer nullable: true BlankEnum: enum: - '' TransactionPaymentInput: type: object properties: transaction_id: type: integer amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true posted_at: type: string format: date description: Payment date for term discount calculation withholding_amount: type: number format: double maximum: 1000000000000000000 minimum: 0.0 exclusiveMaximum: true nullable: true required: - amount - posted_at - transaction_id BulkInvoice: type: object properties: invoice_number: type: string required: - invoice_number EmptyTransactionInput: type: object properties: amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true payment_date: type: string format: date description: Payment date for term discount calculation withholding_amount: type: number format: double maximum: 1000000000000000000 minimum: 0.0 exclusiveMaximum: true nullable: true required: - amount - payment_date ApplicationStatusEnum: enum: - open - partially_used - used - voided type: string description: '* `open` - Open * `partially_used` - Partially Used * `used` - Used * `voided` - Voided' CreditMemoTypeEnum: enum: - credit_memo - overpayment type: string description: '* `credit_memo` - Credit Memo * `overpayment` - Overpayment' BulkApplyInvoicePayment: type: object properties: transaction_id: type: integer invoice_ids: type: array items: type: integer nullable: true filters: allOf: - $ref: '#/components/schemas/BulkApplyInvoicePaymentFilters' nullable: true required: - transaction_id 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 PaymentStatusCdcEnum: enum: - draft - open - sent - partial - paid - uncollectible - voided type: string description: '* `draft` - Draft * `open` - Open * `sent` - Sent * `partial` - Partially Paid * `paid` - Paid * `uncollectible` - Uncollectible * `voided` - Voided' InvoiceReportResponse: type: object description: Output schema for invoice report responses. properties: count: type: integer description: Total rows before pagination next: type: string nullable: true description: Next page URL (null for datatable pagination) previous: type: string nullable: true description: Previous page URL results: type: array items: $ref: '#/components/schemas/InvoiceReportResultRow' description: Paginated result rows engine_used: allOf: - $ref: '#/components/schemas/EngineUsedEnum' description: 'Execution engine: ''postgres'' * `postgres` - postgres' pivot_result_fields: type: array items: type: string description: Sorted list of pivot column names totals_row: type: object additionalProperties: {} description: Grand totals across all rows pivot_value_mappings: type: object additionalProperties: {} description: 'Mapping of pivot field -> {display_name: id} for drilldown' required: - count - engine_used - next - previous - results 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 BulkInvoiceSearch: type: object properties: invoices: type: array items: $ref: '#/components/schemas/BulkInvoice' maxItems: 10000 minItems: 1 required: - invoices 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 AccountingInvoiceJournalEntryTypeEnum: enum: - reclassification - adjustment - dispute - refund - refund_failure - fx_loss - recoverables type: string description: '* `reclassification` - Reclassification * `adjustment` - Adjustment * `dispute` - Dispute * `refund` - Refund * `refund_failure` - Refund Failure * `fx_loss` - FX Loss * `recoverables` - Recoverables' VoidPayment: type: object properties: void_date: type: string format: date nullable: true VoidCreditMemoRequest: type: object properties: void_date: type: string format: date required: - void_date ProductUsageGroupSummary: type: object properties: id: type: integer readOnly: true name: type: string nullable: true pricing_model: $ref: '#/components/schemas/PricingModelEnum' unit_of_measure: type: string nullable: true tier_count: type: integer readOnly: true default: 0 tiers: type: array items: $ref: '#/components/schemas/ProductUsageTierSummary' readOnly: true required: - id - tier_count - tiers 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' 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 readOnly: true nullable: 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 PatchedAccountingInvoice: type: object properties: id: type: integer readOnly: true lines: type: array items: $ref: '#/components/schemas/AccountingInvoiceLine' emails: type: array items: type: object additionalProperties: {} readOnly: true payments: type: array items: $ref: '#/components/schemas/AccountingInvoicePayment' readOnly: true related_journal_entries: type: array items: $ref: '#/components/schemas/AccountingInvoiceJournalEntry' readOnly: true payment_journal_entries: type: array items: type: integer readOnly: true journal_entry_intercompany: type: string readOnly: true client_name: type: string readOnly: true client_email: type: string readOnly: true anrok_customer_id: type: string readOnly: true client_invoice_message: type: string readOnly: true client_use_stripe_auto_bill: type: boolean readOnly: true public_invoice_payment_url: type: string nullable: true 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 entity_invoice_message: type: string nullable: true readOnly: true total_amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true amount_paid: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true amount_due: type: number format: double readOnly: true withholding_info: type: object additionalProperties: {} nullable: true description: 'Withholding context for the invoice''s entity. ``estimated_withholding_amount`` covers only the remaining amount due (null once fully paid); ``withheld_to_date`` is the signed sum of posted withholding, so actuals replace the estimate as receipts come in. Certificate-based schemes estimate from the entity certificate''s rate (falling back to the scheme default); rules-based schemes sum each line''s selected rate over the line amount, scaled by the remaining-due proportion.' readOnly: true contract_name: type: string readOnly: true attachments: type: array items: $ref: '#/components/schemas/File' readOnly: true invoice_number: type: string stripe_connection_name: type: string readOnly: true stripe_connection_entity: type: integer readOnly: true stripe_connection_billing_portal_enabled: type: boolean readOnly: true avalara_connection_name: type: string readOnly: true avalara_connection_company: type: string 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 payment_term_name: type: string readOnly: true revenue_transactions: type: array items: type: integer writeOnly: true writeOnly: true item_date: type: string format: date nullable: true migrated_journal_id: type: integer writeOnly: true nullable: true voided_journal_entry_order: type: integer nullable: true readOnly: true contract_custom_fields: type: array items: type: object additionalProperties: oneOf: - type: string - type: boolean - type: array items: {} readOnly: true department: type: integer writeOnly: true nullable: true department_name: type: string writeOnly: true nullable: true tags: type: array items: type: integer writeOnly: true last_modified_at: type: string format: date-time readOnly: true is_deleted: type: boolean readOnly: true default: false deleted_at: type: string format: date-time readOnly: true nullable: true chat_uuid: type: string format: uuid writeOnly: true search_vector: type: string readOnly: true nullable: true search_text: type: string readOnly: true nullable: true auto_send_invoice: type: boolean nullable: true auto_send_invoice_at: type: string format: date nullable: true auto_sent_at: type: string format: date-time readOnly: true nullable: true reminder_sent_dates: description: 'Dictionary tracking when reminders were sent for each day overdue (e.g., {''5'': ''2024-01-15'', ''10'': ''2024-01-20''})' pre_due_reminder_sent_dates: description: 'Dictionary tracking when pre-due reminders were sent for each day before due date (e.g., {''3'': ''2024-01-10'', ''7'': ''2024-01-06''})' billing_address: type: string nullable: true billing_addressee: type: string nullable: true maxLength: 255 shipping_address: type: string nullable: true shipping_addressee: type: string nullable: true maxLength: 255 terms: nullable: true oneOf: - $ref: '#/components/schemas/TermsEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' ref_number: type: string nullable: true title: Reference Number maxLength: 120 purchase_order_number: type: string nullable: true maxLength: 120 invoice_date: type: string format: date due_date: type: string format: date shipping_date: type: string format: date nullable: true paid_date: type: string format: date nullable: true uncollectible_date: type: string format: date nullable: true sent_date: type: string format: date readOnly: true nullable: true period_start: type: string format: date nullable: true period_end: type: string format: date nullable: true location_of_sale: type: string nullable: true message_on_invoice: type: string nullable: true ita_allocation_number: type: string nullable: true pattern: ^\d{9}$ maxLength: 9 payment_status: nullable: true oneOf: - $ref: '#/components/schemas/PaymentStatusCdcEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' anrok_transaction_id: type: string nullable: true description: ID of the transaction in Anrok (set when transaction is created) maxLength: 255 warning_message: type: string nullable: true created_at: type: string format: date-time readOnly: true 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 last_sent_at: type: string format: date-time readOnly: true nullable: true integration_id: type: string nullable: true maxLength: 250 integration_context: nullable: true vat_number: type: string nullable: true maxLength: 250 discount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true description: Discount amount for the invoice payment_term_applied_discount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true description: Discount amount applied based on payment term early payment discount use_stripe_auto_bill: type: boolean nullable: true stripe_payment_link_id: type: string nullable: true maxLength: 500 stripe_payment_intent_id: type: string nullable: true maxLength: 500 stripe_invoice_id: type: string nullable: true maxLength: 500 stripe_pdf_url: type: string nullable: true maxLength: 500 stripe_payment_link: type: string nullable: true maxLength: 500 source: type: string nullable: true maxLength: 250 source_id: type: string nullable: true is_migrated: type: boolean description: True for invoices imported via opening balance migration (no finalization JE). voided_date: type: string format: date nullable: true invoice_labels: nullable: true invoice_language: type: string nullable: true maxLength: 10 chat_id: type: integer maximum: 2147483647 minimum: -2147483648 nullable: true customer: type: integer readOnly: true entity: type: integer client: type: integer nullable: true payment_term: type: integer nullable: true bad_debt_journal_entry: type: integer readOnly: true nullable: true journal_entry: type: integer readOnly: true nullable: true ar_account: type: integer readOnly: true nullable: true description: Accounts Receivable account for this invoice. Populated for single-AR and migrated invoices. NULL for multi-AR invoices (aging uses ChartTransactions instead). voided_journal_entry: type: integer readOnly: true nullable: true entity_transfer_journal_entry: type: integer readOnly: true nullable: true contract: type: integer nullable: true avalara_connection: type: integer nullable: true sphere_connection: type: integer nullable: true anrok_connection: type: integer nullable: true tax_rate: type: integer nullable: true stripe_connection: type: integer nullable: true source_file: type: integer nullable: true CalculatePaymentOutput: type: object properties: total_due: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true applied_payments: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true applied_credits: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true applied_withholding: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true term_discounts: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true remaining_due: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true required: - applied_credits - applied_payments - applied_withholding - remaining_due - term_discounts - total_due BulkCreditMemo: type: object properties: credit_memo_number: type: string required: - credit_memo_number CalculatePaymentInput: type: object properties: transactions: type: array items: $ref: '#/components/schemas/TransactionPaymentInput' credit_memos: type: array items: $ref: '#/components/schemas/CreditMemoPaymentInput' empty_transactions: type: array items: $ref: '#/components/schemas/EmptyTransactionInput' 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 BulkApplyInvoicePaymentFilters: type: object properties: entity: type: integer nullable: true client: type: integer nullable: true status: type: string nullable: true max_date: type: string format: date nullable: true search_query: type: string nullable: true AccountingInvoicePayment: type: object properties: id: type: integer readOnly: true credit_memo: type: string readOnly: true payment_transaction_bank_description: type: string readOnly: true payment_journal_entry_order: type: string readOnly: true payment_intercompany_journal: 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: sum of the payment''s own withholding GL legs. Summed over the payment''s legs (not the invoice''s withholding records) so a voided payment still shows what it originally withheld.' 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 created_at: type: string format: date-time readOnly: true voided_date: type: string format: date nullable: true source: nullable: true oneOf: - $ref: '#/components/schemas/Source24dEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' payment_type: readOnly: true nullable: true description: 'Type of payment: credit memo application, bank transaction, or manual transaction * `CREDIT_MEMO` - Credit Memo * `BANK_TRANSACTION` - Bank Transaction * `MANUAL_TRANSACTION` - Manual Transaction' oneOf: - $ref: '#/components/schemas/PaymentTypeEnum' - $ref: '#/components/schemas/NullEnum' external_id: type: string nullable: true description: Stable upstream identifier for this payment (e.g. Stripe balance transaction 'btxn_...', Stripe credit note 'cn_...', or the mart's event external_id for customer-balance applications). Used as the natural dedup/idempotency key. Null for manually-entered payments. maxLength: 256 last_modified_at: type: string format: date-time readOnly: true customer: type: integer readOnly: true invoice: type: integer payment_journal_entry: type: integer nullable: true payment_transaction: type: integer nullable: true fx_gain_loss_realized_transaction: type: integer nullable: true payment_term_discount_transaction: type: integer nullable: true voided_journal_entry: type: integer nullable: true payment_transactions: type: array items: type: integer required: - created_at - credit_memo - customer - external_id - id - invoice - last_modified_at - payment_intercompany_journal - payment_journal_entry_order - payment_transaction_bank_description - payment_type - voided_journal_entry_order - withheld_amount Source24dEnum: enum: - STRIPE - MANUAL type: string description: '* `STRIPE` - Stripe * `MANUAL` - Manual' PaginatedProductList: type: object required: - count - results properties: count: type: integer example: 123 next: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=400&limit=100 previous: type: string nullable: true format: uri example: http://api.example.org/accounts/?offset=200&limit=100 results: type: array items: $ref: '#/components/schemas/Product' NullEnum: enum: - null BulkCreateInvoices: type: object description: Serializer for bulk invoice creation. Accepts a list of invoice data. properties: invoices: type: array items: type: object additionalProperties: {} description: List of invoice data dictionaries matching AccountingInvoiceSerializer structure minItems: 1 required: - invoices InvoicePaymentSync: type: object properties: id: type: integer readOnly: true invoice_id: type: integer readOnly: true invoice_number: type: string readOnly: true amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true currency: type: string readOnly: true payment_date: type: string format: date readOnly: true nullable: true payment_type: readOnly: true nullable: true description: 'Type of payment: credit memo application, bank transaction, or manual transaction * `CREDIT_MEMO` - Credit Memo * `BANK_TRANSACTION` - Bank Transaction * `MANUAL_TRANSACTION` - Manual Transaction' oneOf: - $ref: '#/components/schemas/PaymentTypeEnum' - $ref: '#/components/schemas/NullEnum' source: readOnly: true nullable: true oneOf: - $ref: '#/components/schemas/Source24dEnum' - $ref: '#/components/schemas/NullEnum' external_id: type: string readOnly: true nullable: true description: Stable upstream identifier for this payment (e.g. Stripe balance transaction 'btxn_...', Stripe credit note 'cn_...', or the mart's event external_id for customer-balance applications). Used as the natural dedup/idempotency key. Null for manually-entered payments. voided_date: type: string format: date readOnly: true nullable: true created_at: type: string format: date-time readOnly: true last_modified_at: type: string format: date-time readOnly: true required: - amount - created_at - currency - external_id - id - invoice_id - invoice_number - last_modified_at - payment_date - payment_type - source - voided_date PatchedAccountingCreditMemo: type: object properties: id: type: integer readOnly: true lines: type: array items: $ref: '#/components/schemas/AccountingCreditMemoLine' payments: type: array items: $ref: '#/components/schemas/AccountingCreditMemoPayment' readOnly: true amount_remaining: type: number format: double description: Calculate amount remaining from database fields readOnly: true entity_name: type: string readOnly: true entity_currency: type: string readOnly: true client_name: type: string readOnly: true client_email: type: string readOnly: true contract_name: type: string readOnly: true credit_account_number: type: string readOnly: true credit_account_name: type: string nullable: true description: Combines account number and name in the format "number - name" readOnly: true attachments: type: array items: $ref: '#/components/schemas/File' readOnly: true credit_memo_number: type: string 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 last_modified_at: type: string format: date-time readOnly: true is_deleted: type: boolean readOnly: true default: false deleted_at: type: string format: date-time readOnly: true nullable: true chat_uuid: type: string format: uuid writeOnly: true search_vector: type: string readOnly: true nullable: true search_text: type: string readOnly: true nullable: true credit_memo_type: $ref: '#/components/schemas/CreditMemoTypeEnum' ref_number: type: string nullable: true maxLength: 120 credit_memo_date: type: string format: date applied_date: type: string format: date nullable: true message_on_credit_memo: type: string nullable: true application_status: nullable: true oneOf: - $ref: '#/components/schemas/ApplicationStatusEnum' - $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 last_sent_at: type: string format: date-time nullable: true anrok_transaction_id: type: string nullable: true description: ID of the negation transaction in Anrok for this credit memo maxLength: 255 integration_id: type: string nullable: true maxLength: 250 integration_context: nullable: true vat_number: type: string nullable: true maxLength: 250 total_amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true description: Sum of all line item amounts amount_used: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true description: Sum of all non-voided payment amounts chat_id: type: integer maximum: 2147483647 minimum: -2147483648 nullable: true customer: type: integer readOnly: true entity: type: integer client: type: integer nullable: true credit_account: type: integer nullable: true journal_entry: type: integer nullable: true contract: type: integer nullable: true voided_journal_entry: type: integer nullable: true anrok_connection: type: integer nullable: true avalara_connection: type: integer nullable: true sphere_connection: type: integer nullable: true 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 BulkCreditMemoSearch: type: object properties: credit_memos: type: array items: $ref: '#/components/schemas/BulkCreditMemo' maxItems: 10000 minItems: 1 required: - credit_memos Product: type: object properties: id: type: integer readOnly: true is_deleted: type: boolean readOnly: true default: false deleted_at: type: string format: date-time readOnly: true nullable: true department_name: type: string readOnly: true invoice_account_name: type: string nullable: true readOnly: true revenue_account_name: type: string nullable: true readOnly: true ar_account_name: type: string nullable: true readOnly: true bad_debt_account_name: type: string nullable: true readOnly: true invoice_unbilled_account_name: type: string nullable: true readOnly: true tax_account_name: type: string readOnly: true tags: type: array items: type: object additionalProperties: {} readOnly: true last_modified_at: type: string format: date-time readOnly: true product_uuid: type: string format: uuid readOnly: true display_name: type: string readOnly: true usage_group_count: type: integer readOnly: true default: 0 usage_groups: type: array items: $ref: '#/components/schemas/ProductUsageGroupSummary' readOnly: true product_id: type: string nullable: true maxLength: 250 product_name: type: string nullable: true maxLength: 250 product_description: type: string nullable: true maxLength: 250 tag_ids: type: array items: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 tag_group_ids: type: array items: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 currency: type: string nullable: true maxLength: 3 price: type: number format: double maximum: 100000000000000 minimum: -100000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true cost: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true exclude_from_mrr: type: boolean is_taxable: type: boolean is_renewable: type: boolean recognize_revenue: type: boolean description: If False, contract-sync skips the revenue-recognition waterfall for this product (no ContractSubscription / RevenueTransaction rows). is_immediate_recognition: type: boolean description: When true, revenue for this product is recognized in full on the invoice finalization date instead of being amortized over the service period. Used by the Stripe accrual JE waterfall. created_at: type: string format: date-time readOnly: true stripe_product_id: type: string nullable: true maxLength: 250 avalara_item_id: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 nullable: true avalara_item_data: nullable: true avalara_tax_code: type: string nullable: true description: Avalara tax code (e.g., SW052000 for SAAS) maxLength: 50 anrok_item_id: type: string nullable: true maxLength: 250 sphere_item_id: type: string nullable: true maxLength: 250 apply_dept_tag_to_invoice_journals: type: boolean nullable: true description: Apply Department and Tag categorization to all lines on Invoice Journals customer: type: integer readOnly: true department: type: integer nullable: true invoice_account: type: integer nullable: true revenue_account: type: integer nullable: true ar_account: type: integer nullable: true bad_debt_account: type: integer nullable: true invoice_unbilled_account: type: integer nullable: true required: - ar_account_name - bad_debt_account_name - created_at - customer - deleted_at - department_name - display_name - id - invoice_account_name - invoice_unbilled_account_name - is_deleted - last_modified_at - product_uuid - revenue_account_name - tags - tax_account_name - usage_group_count - usage_groups InvoiceReportResultRow: type: object description: Schema for a single result row (dimensions + aggregates + drilldown). properties: filter_params: type: object additionalProperties: {} description: Filter parameters for drilldown navigation group_id: type: integer description: Row identifier for AG Grid merging id: type: integer description: Row identifier for AG Grid getRowId required: - filter_params - group_id - id AccountingInvoiceList: type: object description: 'Lightweight serializer for the invoice list endpoint. Excludes heavy nested fields (emails, payments, attachments, payment_journal_entries) that are only needed on the detail view. Keeps lines for the duplicate invoice action.' properties: id: type: integer readOnly: true lines: type: array items: $ref: '#/components/schemas/AccountingInvoiceLine' readOnly: true journal_entry_intercompany: type: string readOnly: true client_name: type: string readOnly: true client_email: type: string readOnly: true anrok_customer_id: type: string readOnly: true client_invoice_message: type: string readOnly: true client_use_stripe_auto_bill: type: boolean readOnly: true contract_custom_fields: type: array items: type: object additionalProperties: oneOf: - type: string - type: boolean - type: array items: {} 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 entity_invoice_message: type: string nullable: true readOnly: true total_amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true amount_paid: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true amount_due: type: number format: double readOnly: true contract_name: type: string readOnly: true invoice_number: type: string stripe_connection_name: type: string readOnly: true stripe_connection_entity: type: integer readOnly: true stripe_connection_billing_portal_enabled: type: boolean readOnly: true avalara_connection_name: type: string readOnly: true avalara_connection_company: type: string 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 payment_term_name: type: string readOnly: true revenue_transactions: type: array items: type: integer writeOnly: true writeOnly: true item_date: type: string format: date nullable: true voided_journal_entry_order: type: integer nullable: true readOnly: true last_modified_at: type: string format: date-time readOnly: true is_deleted: type: boolean readOnly: true default: false deleted_at: type: string format: date-time readOnly: true nullable: true search_vector: type: string readOnly: true nullable: true search_text: type: string readOnly: true nullable: true auto_send_invoice: type: boolean nullable: true auto_send_invoice_at: type: string format: date nullable: true auto_sent_at: type: string format: date-time readOnly: true nullable: true reminder_sent_dates: description: 'Dictionary tracking when reminders were sent for each day overdue (e.g., {''5'': ''2024-01-15'', ''10'': ''2024-01-20''})' pre_due_reminder_sent_dates: description: 'Dictionary tracking when pre-due reminders were sent for each day before due date (e.g., {''3'': ''2024-01-10'', ''7'': ''2024-01-06''})' billing_address: type: string nullable: true billing_addressee: type: string nullable: true maxLength: 255 shipping_address: type: string nullable: true shipping_addressee: type: string nullable: true maxLength: 255 terms: nullable: true oneOf: - $ref: '#/components/schemas/TermsEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' ref_number: type: string nullable: true title: Reference Number maxLength: 120 purchase_order_number: type: string nullable: true maxLength: 120 invoice_date: type: string format: date due_date: type: string format: date shipping_date: type: string format: date nullable: true paid_date: type: string format: date nullable: true uncollectible_date: type: string format: date nullable: true sent_date: type: string format: date readOnly: true nullable: true period_start: type: string format: date nullable: true period_end: type: string format: date nullable: true location_of_sale: type: string nullable: true message_on_invoice: type: string nullable: true ita_allocation_number: type: string nullable: true pattern: ^\d{9}$ maxLength: 9 payment_status: nullable: true oneOf: - $ref: '#/components/schemas/PaymentStatusCdcEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' anrok_transaction_id: type: string nullable: true description: ID of the transaction in Anrok (set when transaction is created) maxLength: 255 warning_message: type: string nullable: true created_at: type: string format: date-time readOnly: true 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 last_sent_at: type: string format: date-time readOnly: true nullable: true integration_id: type: string nullable: true maxLength: 250 integration_context: nullable: true vat_number: type: string nullable: true maxLength: 250 discount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true description: Discount amount for the invoice payment_term_applied_discount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true description: Discount amount applied based on payment term early payment discount use_stripe_auto_bill: type: boolean nullable: true stripe_payment_link_id: type: string nullable: true maxLength: 500 stripe_payment_intent_id: type: string nullable: true maxLength: 500 stripe_invoice_id: type: string nullable: true maxLength: 500 stripe_pdf_url: type: string nullable: true maxLength: 500 stripe_payment_link: type: string nullable: true maxLength: 500 source: type: string nullable: true maxLength: 250 source_id: type: string nullable: true is_migrated: type: boolean description: True for invoices imported via opening balance migration (no finalization JE). voided_date: type: string format: date nullable: true invoice_labels: nullable: true invoice_language: type: string nullable: true maxLength: 10 chat_id: type: integer maximum: 2147483647 minimum: -2147483648 nullable: true customer: type: integer readOnly: true entity: type: integer client: type: integer nullable: true payment_term: type: integer nullable: true bad_debt_journal_entry: type: integer nullable: true journal_entry: type: integer nullable: true ar_account: type: integer nullable: true description: Accounts Receivable account for this invoice. Populated for single-AR and migrated invoices. NULL for multi-AR invoices (aging uses ChartTransactions instead). voided_journal_entry: type: integer nullable: true entity_transfer_journal_entry: type: integer nullable: true contract: type: integer nullable: true avalara_connection: type: integer nullable: true sphere_connection: type: integer nullable: true anrok_connection: type: integer nullable: true tax_rate: type: integer nullable: true stripe_connection: type: integer nullable: true source_file: type: integer nullable: true required: - amount_due - amount_paid - anrok_customer_id - auto_sent_at - avalara_connection_company - avalara_connection_name - client_email - client_invoice_message - client_name - client_use_stripe_auto_bill - contract_custom_fields - contract_name - created_at - customer - deleted_at - due_date - entity - entity_currency - entity_invoice_message - entity_name - id - invoice_date - is_deleted - journal_entry_intercompany - last_modified_at - last_sent_at - lines - past_due_days - payment_term_name - search_text - search_vector - sent_date - status - stripe_connection_billing_portal_enabled - stripe_connection_entity - stripe_connection_name - tax_rate_name - tax_rate_value - total_amount - voided_journal_entry_order AccountingInvoice: type: object properties: id: type: integer readOnly: true lines: type: array items: $ref: '#/components/schemas/AccountingInvoiceLine' emails: type: array items: type: object additionalProperties: {} readOnly: true payments: type: array items: $ref: '#/components/schemas/AccountingInvoicePayment' readOnly: true related_journal_entries: type: array items: $ref: '#/components/schemas/AccountingInvoiceJournalEntry' readOnly: true payment_journal_entries: type: array items: type: integer readOnly: true journal_entry_intercompany: type: string readOnly: true client_name: type: string readOnly: true client_email: type: string readOnly: true anrok_customer_id: type: string readOnly: true client_invoice_message: type: string readOnly: true client_use_stripe_auto_bill: type: boolean readOnly: true public_invoice_payment_url: type: string nullable: true 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 entity_invoice_message: type: string nullable: true readOnly: true total_amount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true amount_paid: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true amount_due: type: number format: double readOnly: true withholding_info: type: object additionalProperties: {} nullable: true description: 'Withholding context for the invoice''s entity. ``estimated_withholding_amount`` covers only the remaining amount due (null once fully paid); ``withheld_to_date`` is the signed sum of posted withholding, so actuals replace the estimate as receipts come in. Certificate-based schemes estimate from the entity certificate''s rate (falling back to the scheme default); rules-based schemes sum each line''s selected rate over the line amount, scaled by the remaining-due proportion.' readOnly: true contract_name: type: string readOnly: true attachments: type: array items: $ref: '#/components/schemas/File' readOnly: true invoice_number: type: string stripe_connection_name: type: string readOnly: true stripe_connection_entity: type: integer readOnly: true stripe_connection_billing_portal_enabled: type: boolean readOnly: true avalara_connection_name: type: string readOnly: true avalara_connection_company: type: string 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 payment_term_name: type: string readOnly: true revenue_transactions: type: array items: type: integer writeOnly: true writeOnly: true item_date: type: string format: date nullable: true migrated_journal_id: type: integer writeOnly: true nullable: true voided_journal_entry_order: type: integer nullable: true readOnly: true contract_custom_fields: type: array items: type: object additionalProperties: oneOf: - type: string - type: boolean - type: array items: {} readOnly: true department: type: integer writeOnly: true nullable: true department_name: type: string writeOnly: true nullable: true tags: type: array items: type: integer writeOnly: true last_modified_at: type: string format: date-time readOnly: true is_deleted: type: boolean readOnly: true default: false deleted_at: type: string format: date-time readOnly: true nullable: true chat_uuid: type: string format: uuid writeOnly: true search_vector: type: string readOnly: true nullable: true search_text: type: string readOnly: true nullable: true auto_send_invoice: type: boolean nullable: true auto_send_invoice_at: type: string format: date nullable: true auto_sent_at: type: string format: date-time readOnly: true nullable: true reminder_sent_dates: description: 'Dictionary tracking when reminders were sent for each day overdue (e.g., {''5'': ''2024-01-15'', ''10'': ''2024-01-20''})' pre_due_reminder_sent_dates: description: 'Dictionary tracking when pre-due reminders were sent for each day before due date (e.g., {''3'': ''2024-01-10'', ''7'': ''2024-01-06''})' billing_address: type: string nullable: true billing_addressee: type: string nullable: true maxLength: 255 shipping_address: type: string nullable: true shipping_addressee: type: string nullable: true maxLength: 255 terms: nullable: true oneOf: - $ref: '#/components/schemas/TermsEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' ref_number: type: string nullable: true title: Reference Number maxLength: 120 purchase_order_number: type: string nullable: true maxLength: 120 invoice_date: type: string format: date due_date: type: string format: date shipping_date: type: string format: date nullable: true paid_date: type: string format: date nullable: true uncollectible_date: type: string format: date nullable: true sent_date: type: string format: date readOnly: true nullable: true period_start: type: string format: date nullable: true period_end: type: string format: date nullable: true location_of_sale: type: string nullable: true message_on_invoice: type: string nullable: true ita_allocation_number: type: string nullable: true pattern: ^\d{9}$ maxLength: 9 payment_status: nullable: true oneOf: - $ref: '#/components/schemas/PaymentStatusCdcEnum' - $ref: '#/components/schemas/BlankEnum' - $ref: '#/components/schemas/NullEnum' anrok_transaction_id: type: string nullable: true description: ID of the transaction in Anrok (set when transaction is created) maxLength: 255 warning_message: type: string nullable: true created_at: type: string format: date-time readOnly: true 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 last_sent_at: type: string format: date-time readOnly: true nullable: true integration_id: type: string nullable: true maxLength: 250 integration_context: nullable: true vat_number: type: string nullable: true maxLength: 250 discount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true description: Discount amount for the invoice payment_term_applied_discount: type: number format: double maximum: 1000000000000000000 minimum: -1000000000000000000 exclusiveMaximum: true exclusiveMinimum: true nullable: true description: Discount amount applied based on payment term early payment discount use_stripe_auto_bill: type: boolean nullable: true stripe_payment_link_id: type: string nullable: true maxLength: 500 stripe_payment_intent_id: type: string nullable: true maxLength: 500 stripe_invoice_id: type: string nullable: true maxLength: 500 stripe_pdf_url: type: string nullable: true maxLength: 500 stripe_payment_link: type: string nullable: true maxLength: 500 source: type: string nullable: true maxLength: 250 source_id: type: string nullable: true is_migrated: type: boolean description: True for invoices imported via opening balance migration (no finalization JE). voided_date: type: string format: date nullable: true invoice_labels: nullable: true invoice_language: type: string nullable: true maxLength: 10 chat_id: type: integer maximum: 2147483647 minimum: -2147483648 nullable: true customer: type: integer readOnly: true entity: type: integer client: type: integer nullable: true payment_term: type: integer nullable: true bad_debt_journal_entry: type: integer readOnly: true nullable: true journal_entry: type: integer readOnly: true nullable: true ar_account: type: integer readOnly: true nullable: true description: Accounts Receivable account for this invoice. Populated for single-AR and migrated invoices. NULL for multi-AR invoices (aging uses ChartTransactions instead). voided_journal_entry: type: integer readOnly: true nullable: true entity_transfer_journal_entry: type: integer readOnly: true nullable: true contract: type: integer nullable: true avalara_connection: type: integer nullable: true sphere_connection: type: integer nullable: true anrok_connection: type: integer nullable: true tax_rate: type: integer nullable: true stripe_connection: type: integer nullable: true source_file: type: integer nullable: true required: - amount_due - amount_paid - anrok_customer_id - ar_account - attachments - auto_sent_at - avalara_connection_company - avalara_connection_name - bad_debt_journal_entry - client_email - client_invoice_message - client_name - client_use_stripe_auto_bill - contract_custom_fields - contract_name - created_at - customer - deleted_at - due_date - emails - entity - entity_currency - entity_invoice_message - entity_name - entity_transfer_journal_entry - id - invoice_date - is_deleted - journal_entry - journal_entry_intercompany - last_modified_at - last_sent_at - lines - past_due_days - payment_journal_entries - payment_term_name - payments - public_invoice_payment_url - related_journal_entries - search_text - search_vector - sent_date - status - stripe_connection_billing_portal_enabled - stripe_connection_entity - stripe_connection_name - tax_rate_name - tax_rate_value - total_amount - voided_journal_entry - voided_journal_entry_order - withholding_info PaymentTypeEnum: enum: - CREDIT_MEMO - BANK_TRANSACTION - MANUAL_TRANSACTION type: string description: '* `CREDIT_MEMO` - Credit Memo * `BANK_TRANSACTION` - Bank Transaction * `MANUAL_TRANSACTION` - Manual Transaction' AccountingCreditMemoLine: type: object properties: id: type: integer readOnly: true credit_memo: 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 product_name: type: string readOnly: true anrok_item_id: type: string readOnly: true department_name: type: string readOnly: true tags: type: array items: type: object additionalProperties: {} 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: 9223372036854775807 minimum: -9223372036854775808 format: int64 tag_group_ids: type: array items: type: integer maximum: 9223372036854775807 minimum: -9223372036854775808 format: int64 created_at: type: string format: date-time readOnly: true last_modified_at: type: string format: date-time readOnly: true customer: type: integer readOnly: true product: type: integer nullable: true account: type: integer tax_rate: type: integer nullable: true department: type: integer nullable: true required: - account - account_name - account_number - anrok_item_id - created_at - customer - department_name - id - last_modified_at - product_name - tags - tax_rate_name - tax_rate_value VoidInvoiceRequest: type: object properties: void_date: type: string format: date 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 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"