> For the complete documentation index, see [llms.txt](https://docs.lavanda.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lavanda.app/finance-and-accounting/invoices.md).

# Invoices

Invoices are issued against a booking once its services have been confirmed. They sit alongside receipts, credit notes, refund notes, and reversal notes under the shared `documents` GraphQL connection.

## Issuance lifecycle

An invoice moves through three states that are visible on the `issuedDetails` field of every accounting document:

| State   | `issuedDetails` | `issuingStartedAt` | `issuedAt` |
| ------- | --------------- | ------------------ | ---------- |
| Draft   | `null`          | n/a                | n/a        |
| Issuing | non-null        | set                | `null`     |
| Issued  | non-null        | set                | set        |

`issuedDetails` is `null` until the issue command is dispatched. Once issuance has started, `issuedDetails.issuingStartedAt` is set and remains set until issuance completes or is rejected by the tax authority. Use `issuedDetails.issuedAt` to detect the terminal "issued" state, which is what consumers should rely on to mark an invoice as fully issued.

> **Note:** Before May 2026 the `issuedDetails` outer null check meant "fully issued". From May 2026 onwards it means "issuance has started", so existing consumers must switch to checking `issuedDetails.issuedAt != null` for the same semantics.

## Querying an invoice

```graphql
query Invoice($id: ID!) {
  accounting {
    documents(filters: { workspaceId: { eq: "workspace-id" }, id: { in: [$id] } }) {
      edges {
        node {
          id
          issuedDetails {
            displayDocumentNumber
            issuingStartedAt
            issuedAt
            balance { amount currency }
          }
        }
      }
    }
  }
}
```

```json
{ "id": "invoice-id" }
```

Payments allocated against this invoice are documented on the [Payments](/finance-and-accounting/payments.md) page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lavanda.app/finance-and-accounting/invoices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
