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

# Get the filing archive

> Every filing the company has on record, newest event first: returns LAC transmitted, returns filed in an authority's own service and recorded from their receipt, and returns read back from the authority as already filed. Bounded and paged independently of the review period in `GET /filings`, which only covers the current and previous VAT period.

Read authority is company membership plus the payroll role, not the current filing authority: a company whose books moved to its own accountant keeps the record of what LAC filed for it. Incomes Register filings need the admin or approver role and `payroll_scope` says whether they are included.

A `200` always means the canonical read succeeded, so an empty `records` list means the company has no filings; a failed read is `503`. Optional enrichments degrade independently through `documents_status` and `confirmations_status`.



## OpenAPI

````yaml /openapi.yaml get /filings/history
openapi: 3.1.0
info:
  title: LAC Customer API
  version: 2026-10-06.2
  description: >
    Last Accounting Company (LAC) is an AI-native accounting firm for Finnish
    SMBs:

    continuous reconciliation, daily close, real-time dashboards, and full Vero
    reporting.

    This API is the same surface the LAC customer portal UI uses. It gives you
    programmatic

    access to your books (read-only general-ledger views), financial statements,
    documents,

    invoicing, payroll, source-system connections, and the message channel to
    Björn, the

    accounting agent.


    ## Authentication


    Customer API requests carry `Authorization: Bearer <token>`. Two token kinds
    are accepted:


    - **Portal API key** (`lac_sk_...`) — minted in portal Settings → API
    access. Keys have a
      scope of `read` or `write`. Read-scoped keys are refused on all mutating methods
      (POST/PATCH/DELETE). Write-scoped keys act as the `operator` role: they can never
      use payroll endpoints (reads included), change company settings, grant access,
      approve or return an invoice, or manage API keys. Payroll and company settings
      require an interactive admin or existing broad approver. Invoice decisions require the matching invoice
      review permission. Write-scoped keys can prepare draft partner
      seller profiles. An interactive company admin must review the evidence and activate
      a profile or change an active profile.
    - **Firebase ID token** — the interactive session token used by the portal
    UI itself.


    The Shopify App endpoints are provider-facing exceptions with explicit

    per-operation security: App Home assets are public, App Bridge actions use

    a Shopify session JWT, and privacy webhooks use Shopify's raw-body HMAC.


    API keys are pinned to a single company, so the `customer_id` parameter
    (query string on

    GETs, body field on writes) can always be omitted when authenticating with
    an API key.

    Interactive tokens with access to multiple companies use `customer_id` to
    select one.


    ## Conventions


    - All field names are `snake_case` on the wire.

    - Monetary amounts are **integer cents** (fields suffixed `_cents`).

    - Rates and percentages are **basis points** (fields suffixed
    `_basis_points`;
      10000 = 100%, e.g. Finnish standard VAT 25.5% = 2550).
    - Quantities on invoice lines are decimal strings (e.g. `"1"`, `"2.5"`).

    - Dates are `YYYY-MM-DD`; periods are `YYYY-MM`; ranges accept `YYYY-MM`,
    `YYYY-Qn`,
      `YYYY`, `all`, `this_month`, or `last_6_months`.

    ## Limits


    - Document uploads: at most 20 files and 25 MB per request.

    - Sheet pagination: `limit` is capped at 200 rows per page (0 =
    unpaginated).


    ## Errors


    Errors return a JSON envelope `{"error": "...", "detail": "..."}` with a
    conventional

    HTTP status code (401 missing/invalid token, 403 insufficient scope or role,
    404 not

    found, 422 validation failure).


    More at
    [docs.lastaccountingcompany.com](https://docs.lastaccountingcompany.com).
  contact:
    name: Last Accounting Company
    url: https://docs.lastaccountingcompany.com
servers:
  - url: https://api.app.lastaccountingcompany.com/portal
    description: Production (note the /portal base path).
security:
  - apiKey: []
tags:
  - name: Company
    description: Company profile, identity, overview, and agent status.
  - name: Onboarding
    description: Saved customer onboarding facts, source inventory, and opening statements.
  - name: Books
    description: >-
      Read-only windows into the canonical general ledger: the spreadsheet-style
      Books/VAT sheet, financial statements, and analytics. There is no
      cell-edit or batch-edit API — the books are maintained by LAC. The one
      write here is a row declaration: your answer about a row (no receipt
      exists, private, a split, or a different booking), recorded as evidence
      for Björn.
  - name: Dimensions
    description: >-
      Project, cost-centre, department, and customer-defined reporting lenses
      over posted general-ledger lines. Provider catalogs are read-only; local
      axes and values are available for bank/file-only books.
  - name: Documents
    description: Receipt/invoice/contract uploads and per-file ingest metadata.
  - name: Messages
    description: The chat channel to Björn, the accounting agent.
  - name: Work log
    description: >-
      Append-only work-hours log (date, minutes, note). Hours are records for
      invoicing and payroll evidence; they do not post to the books. Kilometres
      are not logged here — vehicle travel is submitted as an expense claim in
      the portal, where statutory reimbursement rates apply.
  - name: Filings
    description: Filing authorization, review requests, and produced output packages.
  - name: Invoicing
    description: >-
      Sales invoicing — drafts, partner seller profiles, e-invoice sending, PDF
      finalizing, credit notes, reminders, recurring templates, and the
      invoice-customer register. LAC sends buyer invoices on the e-invoice
      network only. A partner-profile invoice also sends its legal seller a
      bookkeeping PDF copy.
  - name: Payroll
    description: >-
      Payroll workspace — employees, tax cards, employer settings, draft runs,
      and payslips. Every payroll operation (reads included) requires an
      interactive admin or existing broad-approver session and is NOT available
      to API keys.
  - name: Payments
    description: >-
      Review and named-human release for source-bound purchase, payroll, and
      reimbursement payments. Direct Open Payments delivery is the only rail:
      there is no manual payment composer and no bank or Wise file. A batch that
      cannot be delivered directly to the bank fails closed rather than becoming
      the customer's manual task.
  - name: Connections
    description: >-
      Source-system connections (bank, settlement providers, commerce,
      accounting systems, inbox/Gmail, Google Sheets) and service-connection
      requests/confirmations. PayPal connects with the company's own PayPal app,
      whose Client ID and Secret this API accepts, or with PayPal partner
      consent, which depends on PayPal approving LAC as a partner and returns a
      URL that a company admin must open. Other browser-interactive consent
      flows remain portal-only.
  - name: Shopify App
    description: >-
      Public Shopify App Home, App Bridge token exchange, installation handoff,
      and mandatory privacy webhooks. Offline access tokens never enter a
      browser.
  - name: Imports
    description: Historical import runs (e.g. migrated books) and their artifacts.
  - name: API keys
    description: >-
      Manage portal API keys. These endpoints require an interactive admin
      session (Firebase token) and are NOT available to API-key bearers, which
      receive 403.
  - name: Lens
    description: >-
      Typed, display-ready read models over the books: the transactions window
      (full row universe, three-state status, keyset pagination), the per-row
      booking view, data coverage, and the connections catalog.
  - name: Accounting
    description: >-
      The accountant's read models: general ledger, journal entries, context
      cards, the filings strip with previews, and the SQL explorer. Every
      endpoint here requires LAC staff access or the company admin role; other
      bearers receive 403.
paths:
  /filings/history:
    get:
      tags:
        - Filings
      summary: Get the filing archive
      description: >-
        Every filing the company has on record, newest event first: returns LAC
        transmitted, returns filed in an authority's own service and recorded
        from their receipt, and returns read back from the authority as already
        filed. Bounded and paged independently of the review period in `GET
        /filings`, which only covers the current and previous VAT period.


        Read authority is company membership plus the payroll role, not the
        current filing authority: a company whose books moved to its own
        accountant keeps the record of what LAC filed for it. Incomes Register
        filings need the admin or approver role and `payroll_scope` says whether
        they are included.


        A `200` always means the canonical read succeeded, so an empty `records`
        list means the company has no filings; a failed read is `503`. Optional
        enrichments degrade independently through `documents_status` and
        `confirmations_status`.
      operationId: getFilingHistory
      parameters:
        - $ref: '#/components/parameters/CustomerIdQuery'
        - name: limit
          in: query
          required: false
          description: Records per page.
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
        - name: cursor
          in: query
          required: false
          description: >-
            Opaque `next_cursor` from the previous page. Bound to the company
            and the read scope; a cursor from another company or another scope
            is rejected rather than silently paging a different list.
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          description: One page of the filing archive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilingHistoryPage'
        '400':
          description: >-
            The limit is out of range, or the cursor does not match this company
            and scope.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '503':
          description: >-
            The canonical filing records could not be read. Retryable, and never
            to be presented as a company with no filings.
components:
  parameters:
    CustomerIdQuery:
      name: customer_id
      in: query
      required: false
      description: >-
        Target company. Optional — API keys are pinned to one company, and
        single-company sessions default to it.
      schema:
        type: string
  schemas:
    FilingHistoryPage:
      type: object
      description: One bounded page of the filing archive plus its honest read state.
      additionalProperties: false
      required:
        - customer_id
        - records
        - documents_status
        - confirmations_status
        - payroll_scope
      properties:
        customer_id:
          type: string
        records:
          type: array
          items:
            $ref: '#/components/schemas/FilingHistoryRecord'
        next_cursor:
          type: string
          description: Absent on the last page.
        documents_status:
          type: string
          enum:
            - available
            - unavailable
        confirmations_status:
          type: string
          enum:
            - available
            - unavailable
            - not_applicable
        payroll_scope:
          type: string
          enum:
            - included
            - excluded_permission
        service_mode:
          type: string
        books_authority:
          type: string
    FilingHistoryRecord:
      type: object
      description: >-
        One retained filing event. Provenance, status and confirmation are
        separate truthful facts: an externally recorded filing is never an LAC
        transmission, and an acknowledged transmission is never a confirmation.
      additionalProperties: false
      required:
        - id
        - source_kind
        - source_id
        - record_kind
        - filing_type
        - period
        - provenance
        - authority_environment
        - status
        - documents
        - documents_state
      properties:
        id:
          type: string
          description: '`<source_kind>:<owner row id>`.'
        source_kind:
          type: string
          enum:
            - authority_submission
            - manual_authority_receipt
            - external_authority_adoption
        source_id:
          type: string
        record_kind:
          type: string
          enum:
            - filing
            - authority_request
          description: >-
            `authority_request` is a non-filing authority action such as a
            register application. The customer filing archive excludes it.
        filing_type:
          type: string
        period:
          type: string
          description: >-
            Stored period spelling, which may be an alias for a wider statutory
            period.
        period_start:
          type: string
        period_end:
          type: string
          description: Exact statutory span, absent when none could be resolved.
        provenance:
          type: string
          enum:
            - lac_transmission
            - manual_authority_receipt
            - external_authority
        authority:
          type: string
        authority_environment:
          type: string
        status:
          type: string
          enum:
            - authority_acknowledged
            - authority_processing
            - authority_accepted
            - authority_receipt_recorded
            - filed_external
        submitted_at:
          type: string
          description: >-
            When the filing went to the authority. Absent when nothing recorded
            it — an externally observed filing has no known filing time.
        observed_at:
          type: string
          description: When LAC observed an externally filed return.
        reference:
          type: string
        draft_uuid:
          type: string
        replaces_record_id:
          type: string
          description: Explicit correction lineage; absent rather than guessed.
        request_kind:
          type: string
        confirmation:
          $ref: '#/components/schemas/FilingHistoryConfirmation'
        documents:
          type: array
          items:
            $ref: '#/components/schemas/FilingHistoryDocument'
        documents_state:
          type: string
          description: >-
            Whether this record's document list could be read. A record whose
            documents the caller may not read is not listed at all, so there is
            no masked state.
          enum:
            - available
            - unavailable
    Error:
      type: object
      description: Standard error envelope.
      properties:
        error:
          type: string
          description: Machine-readable error message.
        detail:
          type: string
          description: Human-readable detail.
    FilingHistoryConfirmation:
      type: object
      description: >-
        How one VAT transmission reconciles against the authority's own filed
        return register. Only `confirmed_at_vero` means the authority has shown
        the return; API acceptance alone never does.
      additionalProperties: false
      required:
        - state
        - ack_at
      properties:
        state:
          type: string
          enum:
            - accepted_awaiting_processing
            - confirmed_at_vero
            - authority_mismatch
        ack_at:
          type: string
          description: When the authority's API acknowledged the transmission.
        confirmed_at:
          type: string
          description: Present only when the state is confirmed.
    FilingHistoryDocument:
      type: object
      description: >-
        One document a filing record offers. Carries no storage location and no
        digest: the download re-resolves both from the canonical records.
      additionalProperties: false
      required:
        - key
        - kind
        - title
        - filename
        - available
      properties:
        key:
          type: string
          description: Opaque identifier of this document within its record.
        kind:
          type: string
          enum:
            - retained_artifact
            - submitted_copy
            - report_rendering
        role:
          type: string
          description: Artifact role for a retained file; absent for a generated copy.
        title:
          type: string
        filename:
          type: string
        content_type:
          type: string
        available:
          type: boolean
          description: >-
            False when the relation exists but the bytes cannot currently be
            identified or verified. The filing still renders.
        unavailable_reason:
          type: string
          enum:
            - retained_object_missing
            - document_removed
            - submitted_bytes_unverifiable
            - retained_report_incomplete
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        Insufficient scope or role — e.g. a read-scoped key on a mutating
        method, or an API key on an interactive-session-only endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: lac_sk_...
      description: >-
        Portal API key minted in portal Settings → API access. Scope `read` or
        `write`; pinned to one company. Send as `Authorization: Bearer
        lac_sk_...`.

````

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