> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fitsociety.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoice accounting documents

> Read complete invoices and credit notes with signed amounts, ledger details, identity sources, and reconciliation warnings.

Use the accounting document endpoint to map one invoice or credit note into your
bookkeeping system. It returns all line items belonging to the document,
including invoices with more than 100 lines. Collection reads such as the invoice
list remain paginated; the accounting response represents one complete document.

```http theme={null}
GET /public/v1/finance/invoices/{invoiceId}/accounting
Authorization: Bearer <access_token>
```

Required scope: `finance_invoices:read`. Company access is determined by the
access token. The linked client must remain accessible to that company. There
is no request body, pagination parameter, or write side effect.

```bash theme={null}
curl -H "Authorization: Bearer $FITSOCIETY_ACCESS_TOKEN" \
  "https://api.fitsociety.io/public/v1/finance/invoices/000000000000000000000001/accounting"
```

The path uses the invoice resource ID from an invoice response or
`invoice.created` event. `invoiceNumber` is the human-readable business number.
For a credit note, `originalInvoiceNumber` identifies the original business
invoice number and is not a resource ID.

## Document fields

The response uses the usual `{ data, meta }` envelope and returns the document
under `data.invoice`.

| Fields | Meaning |
| :- | :- |
| `invoiceId`, `invoiceNumber`, `invoiceType` | Resource ID, business number, and `Invoice` or `CreditNote`. |
| `originalInvoiceNumber` | Original business invoice number for a credit note; otherwise nullable. |
| `issueDate`, `dueDate` | Canonical `YYYY-MM-DD` dates, or null when unavailable. |
| `status` | `Pending`, `Paid`, or `Chargeback`, or null when unavailable. |
| `paymentStatus` | Processing state: `None`, `NeedProcessing`, `Created`, or `Failed`, or null when unavailable. Use `status` to determine whether an invoice is paid. |
| `currency` | Invoice currency code, or null when unavailable. |
| `billingProfileId`, `locationId` | Associated billing profile and location IDs when available. |
| `issuer`, `recipient` | Explicit identity fields and their data source. |
| `items` | Every line in invoice order, with sequential `lineNumber` values. |
| `totals` | Recorded document totals, calculated line total, and reconciliation difference. |
| `warnings` | Objects with a `code` and a human-readable `message`. |
| `pdfAvailable` | Whether an existing invoice PDF can be requested separately. |
| `createdAt` | UTC creation timestamp, or null when unavailable. |

Each line contains `description`, non-negative `quantity`, signed
`unitPriceIncl`, `vatRate` as a percentage, signed `amountExcl`, `vatAmount`,
`amountIncl`, and `adjustmentType` (`charge` or `discount`). `ledgerAccountId`,
`ledgerNumber`, `ledgerName`, `billingPeriodStart`, and `billingPeriodEnd` are
nullable. Billing periods use canonical `YYYY-MM-DD` dates.

## Amounts and reconciliation

Monetary fields are JSON numbers in the invoice currency. Line amounts and
document totals are rounded to two decimal places. `unitPriceIncl` preserves its
stored precision before multiplication by `quantity`; do not round it first.
Regular charges are positive. Discounts are negative. A credit note
reverses these signs, including the sign of any discount line. Keep these signed
values when mapping the document into bookkeeping; do not negate a credit note
a second time.

`totals.amountIncl` and `totals.vatAmount` preserve the recorded issued totals
with the document sign applied. `totals.amountExcl` is their difference.
`totals.calculatedAmountIncl` comes from all invoice lines, rounded at document
level. `totals.difference` is the recorded inclusive total minus that calculated
inclusive total at currency precision. A VAT-only mismatch also produces a
`STORED_TOTAL_DIFFERS` warning.

`LINE_ROUNDING_DIFFERENCE` indicates that summing the rounded line amounts
differs from rounding the underlying amounts once at document level. Its message
reports the inclusive, VAT and exclusive deltas in the invoice currency.
Preserve the recorded document totals and review how your destination handles
rounding adjustments, including when `totals.difference` is zero.

Missing recorded totals are calculated from the lines and produce
`STORED_TOTAL_UNAVAILABLE`. Invalid numeric data returns a server error without a
partial accounting document. Review warnings before creating a bookkeeping
entry.

## Identity and ledger sources

Both `issuer` and `recipient` contain `name`, `vatNumber`, `commerceNumber`,
`addressLine1`, `addressLine2`, `postalCode`, `city`, `country`, and `dataSource`.
The recipient also contains `recipientId` and `email`.

`issuer.dataSource` is `invoice_snapshot` or `unavailable`. The recipient can
also use `current_client_record`. A historical recipient snapshot takes
precedence, including a partial snapshot; missing historical fields remain null
instead of being filled with current details. `current_client_record` is
explicitly marked and does not establish the identity at the time of issue.

Ledger names and numbers reflect current company ledger records when available.
`LEDGER_CURRENT_RECORD` makes that source explicit. Missing or inaccessible
ledger details remain null and produce `LEDGER_UNAVAILABLE` for the affected
line.

Other warning codes are `ISSUER_SNAPSHOT_UNAVAILABLE`, `RECIPIENT_UNAVAILABLE`,
`RECIPIENT_CURRENT_RECORD`, `CURRENCY_UNAVAILABLE`,
`CREDIT_ORIGINAL_INVOICE_UNAVAILABLE`, and `INVOICE_LINES_UNAVAILABLE`.

## PDFs and delivery

The accounting document contains `pdfAvailable` and does not contain a download
URL. Request PDF download metadata through
`GET /public/v1/finance/invoices/{invoiceId}/pdf` with the separate
`finance_invoice_pdfs:read` scope. See [finance](https://docs.fitsociety.io/public-api/finance.md) for invoice
lists and PDF access, and [exports](https://docs.fitsociety.io/public-api/exports.md) for date-range export
packages.

For an event-driven integration, retrieve this document after an
`invoice.created` event and branch on `invoiceType`. Treat webhook delivery as
repeatable: use the invoice resource ID as your stable document key in the
destination system. A `CreditNote` is a separate accounting document, linked by
its `originalInvoiceNumber`; stop for review if that number is unavailable.

## Make invoice triggers

A dedicated Make accounting connection can request these scopes through fresh
company administrator consent:

```text theme={null}
platform:read
finance_invoices:read
finance_invoice_pdfs:read
finance_invoice_webhooks:read
finance_invoice_webhooks:write
```

These permissions read financial documents and manage invoice notifications.
They do not request health-data or private-communication access. Existing saved
connections retain their approved scopes.

Use `GET /public/v1/make/accounting/events?event=invoice.created` to retrieve up
to three recent company events. Subscribe with
`POST /public/v1/make/accounting/webhooks`, an `Idempotency-Key` header and a JSON
body containing `event: "invoice.created"` and your dedicated Make webhook URL.
The response contains `id`, `companyId`, `event` and `signingSecret`. Keep the
secret private and verify signed notifications before processing their data.
Only dedicated Make HTTPS hook URLs are accepted. Unsubscribe using
`DELETE /public/v1/make/accounting/webhooks/{id}` and a fresh `Idempotency-Key`.

Invoices and credit notes share the `invoice.created` event. Separate triggers
filter the signed `data.invoiceType` field by `Invoice` or `CreditNote`.
Retrieve the full document using `data.invoiceId`. A PDF can still be pending
when the creation event arrives: the PDF endpoint then returns `404` with
`error.key: PDF_NOT_AVAILABLE`. Retry the same document ID later; do not create a
replacement invoice. PDF download URLs expire, so retrieve a fresh URL before a
delayed download.

Before posting to a bookkeeping system, reserve a durable document key from
company ID, invoice ID and document type. Mark it delivered only after storing a
confirmed destination receipt. Duplicate events and retries must reuse that
key; an event ID alone is insufficient. If a destination request times out,
check for the document at the destination before repeating its creation.

## Zapier invoice triggers

A new Zapier accounting connection can request the same five scopes listed
above. Existing general connections keep their approved permissions. The
accounting permissions do not require health-data or private-communication
consent; company administrator approval is still required.

Use `GET /public/v1/zapier/accounting/events?event=invoice.created` for up to
three recent company events. Create a subscription with
`POST /public/v1/zapier/accounting/webhooks`, an `Idempotency-Key` and
`{"event":"invoice.created","url":"<dedicated Zapier callback>"}`. The
response provides `id`, `companyId`, `event` and a private `signingSecret`.
Unsubscribe through
`DELETE /public/v1/zapier/accounting/webhooks/{id}` with a fresh request key.

Notifications retain the signed Zapier event format. Verify the signature with
that subscription's secret before filtering `data.invoiceType` or reading
`data.invoiceId`. The two document types use the same `invoice.created` event.
The document and PDF reads use the shared finance endpoints; a successful
notification alone does not establish a completed bookkeeping entry.

## n8n invoice triggers

Company-specific n8n accounting credentials can be limited to the same five
scopes. These accounting permissions are separate from the general event
permissions and their sensitive-data consent requirements.

Manage this connection's accounting subscriptions with
`GET` or `POST /public/v1/n8n/accounting/webhooks`, and retrieve or remove one
through `GET` or `DELETE /public/v1/n8n/accounting/webhooks/{id}`. Writes require
an `Idempotency-Key`. The POST body contains a public HTTPS `url`, exactly
`events: ["invoice.created"]` and the n8n trigger's derived signing secret.
Subscription responses contain `id`, `url`, `events`, `status` and
`signingKeyHash`. The signing secret is never returned.

Lists default to ten subscriptions and allow up to 100 per page. Continue using
`page` and `meta.pagination.hasNextPage`. Both document types retain the n8n
company-bound, signed event envelope. Filter on document type only after
signature verification and retrieve the full document through the shared
finance endpoints.

## Errors

`400` indicates an invalid invoice resource ID. `401` indicates missing or
invalid authentication. `403` indicates insufficient scope or unavailable
integration access. `404` indicates an unavailable invoice or linked client in
the authenticated company. Rate limits return `429`; unexpected errors or
invalid accounting data return `500`. Retry transient failures using the same
destination document key to prevent duplicate bookkeeping entries.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.