# Campfire — Accounting API: gotchas

> Canonical URL: https://developers.apideck.com/apis/accounting/campfire/gotchas

## POST /accounting/bills

`bill_number` is required on create, even though the unified schema treats it as
optional — omitting it fails with `bill_number: This field is required.` and no bill
is created.

## GET /accounting/invoices

`terms` returns the payment term's display name (for example `Net 30` or
`Due on Receipt`), and `terms_id` returns its identifier. Invoices with no payment
term set return `null` for both.

When creating or updating an invoice, set the payment term with `terms_id` — the
display name is read-only and is ignored on write.

`sub_total` and `total_tax` are both derived, not returned by Campfire, which reports
no invoice-level sub-total or tax figure. `total_tax` is the sum of the per-line
`tax_amount` values and `sub_total` is `total` minus that sum, each rounded to four
decimal places, so `sub_total + total_tax` reconciles to `total`.

On a small number of records Campfire's own header total and line amounts disagree, and
on those the derived `sub_total` will not equal the sum of `line_items[].total_amount`.

Both are omitted rather than zero when Campfire returns no line detail for the record.

## POST /accounting/invoices

Every invoice line must reference a product. Set `line_items[].item.id` on each line —
if any line omits it, Campfire rejects the entire request with
`lines[0]: Invoice line must have either a product or a bundle set` and no invoice is
created. The rejection applies to the whole request, not just the offending line.

Retrieve the values to pass from `GET /accounting/invoice-items` and use the `id` it
returns. The product must already exist in Campfire; an id that does not resolve is
rejected too.

`due_date` is also required on create, even though the unified schema treats it as
optional — omitting it fails with `due_date: This field is required.`

## PATCH /accounting/invoices/{id}

Every invoice line must reference a product. When you send `line_items`, set
`line_items[].item.id` on each line — if any line omits it, Campfire rejects the entire
request with `lines[0]: Invoice line must have either a product or a bundle set` and no
change is applied.

Retrieve the values to pass from `GET /accounting/invoice-items` and use the `id` it
returns. The product must already exist in Campfire; an id that does not resolve is
rejected too.

## GET /accounting/bill-credit-notes

Bill credit notes are Campfire Debit Memos (the accounts-payable mirror of the AR `credit-notes`, which are Campfire Credit Memos). `supplier` is the Campfire vendor. `status` reflects how much of the credit has been applied: `posted` while open (nothing applied), `partially_paid` when partially used, `paid` when fully used, and `voided` when voided. `balance`/`remaining_credit` report the unapplied amount. Line items are ledger-account based, so `line_items[].quantity`, `unit_price` and `item` are not populated. `allocations` is not returned — a debit memo is not linked to a specific bill; it is applied against accounts payable separately. On update, supplying `line_items` replaces the entire set of lines (line item `id`s are not stable across updates); omit `line_items` to leave the existing lines unchanged.

## GET /accounting/company-info

Campfire does not have a dedicated company info endpoint. This operation returns the first
entity (subsidiary) from the entities list. For multi-entity accounts, use the subsidiaries
endpoint to get all entities.

## GET /accounting/trial-balance

Built from Campfire's trial balance with income statement accounts on a fiscal year-to-date basis: balance sheet accounts are cumulative to `filter[end_date]` (today by default) and income and expense accounts run from the start of the entity's fiscal year (`start_date`); retained earnings is its own line. Each account's ending balance is netted into one debit or credit, and accounts with a zero balance are left out. Every line has `line_type` `account` and Campfire's account id as `account_id`. The entity is the one in `x-apideck-company-id`, else the connection's entity; child entities are not rolled up. Unlike Campfire's balance sheet and profit and loss in this API, which are not filtered by entity, the trial balance is scoped to that entity, so the three reports can differ on a multi-entity account. Without an entity the report covers the entities the API key can see, and returns a `422` if they use more than one currency, inactive entities included. `currency` is the entity's base currency. `filter[accounting_method]=cash` returns a `400`. A report whose debits and credits differ by half a cent or more returns a `502`.

[API reference](https://developers.apideck.com/apis/accounting/reference.md) · [Coverage matrix](https://developers.apideck.com/apis/accounting/coverage)
