LumaBill Fiscal Years API

Fiscal years and the year-end revaluation of foreign-currency positions

GitHub OpenAPI

Operations 3

GET /fiscal-years List fiscal years #
POST /fiscal-years/{id}/fx-revaluation/preview Preview the year-end FX revaluation #
POST /fiscal-years/{id}/fx-revaluation Book the year-end FX revaluation #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lumabill-ch:lumabill-ch-fiscal-years-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lumabill-ch-fiscal-years-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lumabill Fiscal Years API
  version: '1.0'
  description: 'The Lumabill API gives **Pro and Lifetime** subscribers programmatic access to

    Swiss invoicing and bookkeeping data. You can create and manage invoices,

    clients, expenses, journal entries, and more - the same data you see in the

    Lumabill dashboard. ## Authentication


    All requests must carry a Bearer API key in the `Authorization` header:


    ```

    Authorization: Bearer lmb_your_api_key_here

    ```


    API keys are created in **Settings → API Keys** inside the Lumabill dashboard. ## Profile scoping


    A Lumabill account can have multiple profiles (companies). By default the key

    is scoped to the profile it was created for. If a key has access to multiple

    profiles, supply the `X-Profile-Id` header with the UUID of the target profile. ## Rate limits


    | Operation | Limit |

    |-----------|-------|

    | Reads (GET) | 60 requests / minute per API key |

    | Writes (POST, PUT, DELETE) | 20 requests / minute per API key |


    When the limit is exceeded the API returns `429 Too Many Requests` with a

    `Retry-After` header indicating when you may retry (seconds from now). ## Pagination


    List endpoints support cursor-free page-based pagination via query parameters:


    | Parameter | Default | Maximum |

    |-----------|---------|---------|

    | `page` | 1 | - |

    | `per_page` | 50 | 100 |


    Responses include a top-level `meta` object:


    ```json

    {

    "data": [...],

    "meta": { "page": 1, "per_page": 50, "total": 243 }

    }

    ```


    ## Errors


    All error responses share a common shape:


    ```json

    {

    "error": {

    "code": "ERROR_CODE",

    "message": "Human-readable description"

    }

    }

    ```


    Common error codes: `INVALID_API_KEY`, `FORBIDDEN`, `NOT_FOUND`,

    `VALIDATION_ERROR`, `RATE_LIMIT_EXCEEDED`, `SUBSCRIPTION_REQUIRED`,

    `READ_ONLY_KEY`, `CLIENT_NOT_FOUND`, `INTERNAL_ERROR`. ## Smart defaults


    When creating invoices or offers the API auto-resolves most fields from

    your profile so you can send minimal payloads. Only `lines` is required. | Field | Auto-resolved from |

    |-------|-------------------|

    | `invoice_number` | Profile prefix + sequential counter (e.g. `IV-010`) |

    | `issue_date` | Today |

    | `due_date` | `issue_date` + profile payment deadline (default 30 days) |

    | `currency` | Profile default currency (default `CHF`) |

    | `vat_rate` (on lines) | Profile default tax rate |

    | Sender details | Profile company name, address, IBAN, etc. |

    | Payment info | Profile payment template and deadline |


    **`client_id` shorthand** - pass a `client_id` UUID instead of a full

    client object. The API fetches the client and snapshots the data

    automatically. Returns `404` with code `CLIENT_NOT_FOUND` if the client

    does not exist in your profile. **Minimal example:**


    ```json

    POST /invoices

    {

    "client_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",

    "lines": [

    { "description": "Consulting", "quantity": 2, "price": 150 }

    ]

    }

    ```


    Any field you explicitly provide overrides the auto-resolved default. ## MCP Server (AI Assistant Integration)


    Connect your Lumabill account to AI assistants like Claude, ChatGPT, and Cursor

    using the Model Context Protocol (MCP). **Endpoint:** `https://mcp.lumabill.ch/mcp?key={your_api_key}`


    **Setup for Claude Desktop** - add to `claude_desktop_config.json`:

    ```json

    {

    "mcpServers": {

    "lumabill": {

    "type": "streamable-http",

    "url": "https://mcp.lumabill.ch/mcp?key=lmb_your_key_here"

    }

    }

    }

    ```


    **Setup for Claude Code** - add to `.mcp.json` in your project:

    ```json

    {

    "mcpServers": {

    "lumabill": {

    "type": "streamable-http",

    "url": "https://mcp.lumabill.ch/mcp?key=lmb_your_key_here"

    }

    }

    }

    ```


    **Setup for Cursor** - add to MCP settings:

    - Name: `lumabill`

    - Type: `streamable-http`

    - URL: `https://mcp.lumabill.ch/mcp?key=lmb_your_key_here`


    The MCP server exposes all API endpoints as tools. Your AI assistant can:

    - Create and manage invoices, offers, and expenses

    - Look up clients and vendors

    - Generate financial reports (P&L, balance sheet, VAT)

    - Import bank transactions

    - Query revenue data


    **API key permissions apply:** Read-only keys only expose read tools.'
  contact:
    name: Lumabill Support
    url: https://lumabill.com/contact
  license:
    name: Proprietary
servers:
- url: https://api.lumabill.ch/v1
  description: Production
- url: https://api.dev.lumabill.ch/v1
  description: Development / Sandbox
security:
- BearerAuth: []
tags:
- name: Fiscal Years
  description: Fiscal years and the year-end revaluation of foreign-currency positions
paths:
  /fiscal-years:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    get:
      operationId: listFiscalYears
      summary: List fiscal years
      tags:
      - Fiscal Years
      responses:
        '200':
          description: The profile's fiscal years, newest first
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FiscalYear'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
  /fiscal-years/{id}/fx-revaluation/preview:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    - $ref: '#/components/parameters/ResourceId'
    post:
      operationId: previewFxRevaluation
      summary: Preview the year-end FX revaluation
      tags:
      - Fiscal Years
      description: 'Double-entry profiles only (403 DOUBLE_ENTRY_REQUIRED). Values every foreign-currency (FW) bank account and every open FW invoice, credit note, expense and revenue at the closing rate (Stichtagskurs) of the fiscal-year end and returns the CHF difference per item. Books nothing. Closing rates are prefilled (ESTV ICTax year-end list for a 31.12. close where it lists the currency, else the ESTV/BAZG daily rate of the closing date) and can be overridden in `rates`. Errors (400): FX_REVALUATION_TOO_EARLY (the year has not ended, with `endDate`), FX_REVALUATION_INVALID (policy / threshold), FX_INVALID_RATE (with `currency`), FX_PRIOR_YEAR_NOT_CLOSED (the previous fiscal year is still open, so this year holds no Saldovortrag and its FW saldi would be wrong: close the prior year first). The response carries a `previewToken` for the commit. Being a POST, it needs a read_write API key.'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FxRevaluationRequest'
      responses:
        '200':
          description: The valuation with its rates, items, totals and warnings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FxRevaluationPreview'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
  /fiscal-years/{id}/fx-revaluation:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    - $ref: '#/components/parameters/ResourceId'
    post:
      operationId: commitFxRevaluation
      summary: Book the year-end FX revaluation
      tags:
      - Fiscal Years
      description: 'Posts one system journal entry dated the fiscal-year end (`externalSource: system`, "Neubewertung Fremdwährungen per dd.mm.yyyy"): per item the CHF difference on the FW account, 1100 or 2000 against the FX result account (profile setting, default 6960), lines tagged `fxKind: revaluation`, no VAT code. Needs a rate for every currency in scope and never fetches one. Runs in one transaction that locks the fiscal year; a closed year answers 400 FISCAL_YEAR_CLOSED. Running it again replaces the previous run (its entry gets a Storno, the run is superseded); an identical result answers 200 with `unchanged: true` and writes nothing. Errors (400): FX_RATE_MISSING (with `currencies`), FX_INVALID_RATE, FX_REVALUATION_TOO_EARLY, FX_REVALUATION_INVALID, FX_ACCOUNT_MISSING, FX_PRIOR_YEAR_NOT_CLOSED (close the prior year first so its Saldovortrag is posted); 403 DOUBLE_ENTRY_REQUIRED; 409 FX_REVALUATION_PREVIEW_CHANGED when the body''s `previewToken` no longer matches the ledger (a booking in scope changed since the preview: preview again and commit with the new token). The year close then no longer reports FX_REVALUATION_MISSING.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FxRevaluationRequest'
      responses:
        '201':
          description: Revaluation booked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FxRevaluationCommitResult'
        '200':
          description: The current run already books this result; nothing written
          content:
            application/json:
              schema:
                type: object
                properties:
                  unchanged:
                    type: boolean
                    enum:
                    - true
                  run:
                    $ref: '#/components/schemas/FxRevaluationRun'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: 'FX_REVALUATION_PREVIEW_CHANGED: bookings in scope changed since the preview whose `previewToken` was sent; nothing written

            '
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Currency:
      type: string
      description: 'ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.

        '
      enum:
      - CHF
      - EUR
      - USD
      - GBP
      - JPY
      - CAD
      - AUD
      - SEK
      - NOK
      - DKK
      - HUF
      example: CHF
    FiscalYear:
      type: object
      properties:
        id:
          type: string
          format: uuid
        year:
          type: integer
          example: 2025
        startDate:
          type: string
          format: date
        endDate:
          type: string
          format: date
        status:
          type: string
          enum:
          - OPEN
          - CLOSED
        closedAt:
          type:
          - string
          - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        exportStatus:
          type:
          - string
          - 'null'
        exportRequestedAt:
          type:
          - string
          - 'null'
          format: date-time
    FxRateSource:
      type: string
      description: 'Where a rate came from: `BAZG` (ESTV/BAZG daily or monthly average sell rate), `BAZG_CROSS` (derived through a cross rate), `ICTAX` (ESTV year-end list, mid rate), `ACTUAL` (the CHF amount actually moved), `MANUAL` (entered by you).

        '
      example: BAZG
    FxRevaluationCommitResult:
      type: object
      properties:
        unchanged:
          type: boolean
        run:
          $ref: '#/components/schemas/FxRevaluationRun'
        items:
          type: array
          items:
            $ref: '#/components/schemas/FxRevaluationItem'
        totals:
          $ref: '#/components/schemas/FxRevaluationTotals'
        rates:
          type: array
          items:
            $ref: '#/components/schemas/FxRevaluationRate'
        superseded:
          type:
          - object
          - 'null'
          description: The previous run of the year, replaced by a Storno of its entry
          properties:
            runId:
              type: string
              format: uuid
            journalEntryId:
              type:
              - string
              - 'null'
              format: uuid
            stornoEntryId:
              type:
              - string
              - 'null'
              format: uuid
    FxRevaluationItem:
      type: object
      properties:
        key:
          type: string
          example: bank:0d6f2c1e-...
        kind:
          type: string
          enum:
          - bank
          - debitor
          - kreditor
        orientation:
          type: string
          enum:
          - asset
          - liability
        chartAccountId:
          type:
          - string
          - 'null'
          format: uuid
        accountCode:
          type:
          - string
          - 'null'
        accountName:
          type:
          - string
          - 'null'
        documentType:
          type:
          - string
          - 'null'
          enum:
          - INVOICE
          - EXPENSE
          - REVENUE
          - null
        documentId:
          type:
          - string
          - 'null'
          format: uuid
        documentKind:
          type:
          - string
          - 'null'
        label:
          type:
          - string
          - 'null'
        documentDate:
          type:
          - string
          - 'null'
          format: date
        currency:
          $ref: '#/components/schemas/Currency'
        fwSaldo:
          type: number
          format: double
        chfBookBefore:
          type: number
          format: double
          description: CHF book value before this run
        rate:
          type:
          - number
          - 'null'
          format: double
        chfTarget:
          type: number
          format: double
        delta:
          type: number
          format: double
          description: chfTarget minus chfBookBefore
        gain:
          type: number
          format: double
          description: P&L effect (positive = gain)
        fxKind:
          type:
          - string
          - 'null'
          enum:
          - revaluation
          - realized
          - null
        skippedReason:
          type:
          - string
          - 'null'
          enum:
          - below_threshold
          - niederstwert
          - settled
          - rate_missing
          - null
        posted:
          type: boolean
        settledAfterYearEnd:
          type: boolean
    FxRevaluationRequest:
      type: object
      properties:
        rates:
          type: object
          description: 'Closing rate per currency, keyed by currency code. Optional on the preview (overrides the prefilled rate); required on the commit, one for every currency in scope (the commit never fetches a rate).

            '
          additionalProperties:
            $ref: '#/components/schemas/FxRateInput'
          example:
            EUR:
              rate: 0.9312
              source: ICTAX
              rateType: closing
              rateDate: '2025-12-31'
              retrievedAt: '2026-01-05T08:00:00.000Z'
            USD: 0.8
        policy:
          type: string
          enum:
          - stichtag
          - niederstwert
          description: '`stichtag` books unrealized gains and losses at the closing rate; `niederstwert` books no unrealized gains on open items (FW bank accounts are always valued at the closing rate). Default: the profile''s `fxValuationPolicy`.

            '
        threshold:
          type: number
          format: double
          minimum: 0
          default: 0.01
          description: Items whose CHF difference is below this amount are skipped
        previewToken:
          type: string
          description: 'Commit only: the `previewToken` of the preview the commit books. When bookings in scope changed since that preview, the commit answers 409 FX_REVALUATION_PREVIEW_CHANGED and writes nothing; run the preview again and commit with its new token.

            '
    FxRateInput:
      description: 'One closing rate: a number is a manual rate (CHF per 1 unit, source MANUAL, rate date = the fiscal-year end); an object echoes a rate of the preview with its provenance (an unknown source becomes MANUAL).

        '
      oneOf:
      - type: number
        format: double
        example: 0.9312
      - type: object
        required:
        - rate
        properties:
          rate:
            type: number
            format: double
          source:
            $ref: '#/components/schemas/FxRateSource'
          rateType:
            type: string
            enum:
            - daily
            - monthly
            - closing
          rateDate:
            type: string
            format: date
          retrievedAt:
            type: string
            format: date-time
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
              example: NOT_FOUND
            message:
              type: string
              example: The requested resource was not found.
    FxRevaluationTotals:
      type: object
      properties:
        gain:
          type: number
          format: double
        loss:
          type: number
          format: double
        net:
          type: number
          format: double
        postedCount:
          type: integer
        skippedCount:
          type: integer
    FxRevaluationRun:
      type: object
      properties:
        id:
          type: string
          format: uuid
        runDate:
          type: string
          format: date
        policy:
          type: string
          enum:
          - stichtag
          - niederstwert
        threshold:
          type: number
          format: double
        journalEntryId:
          type:
          - string
          - 'null'
          format: uuid
        createdAt:
          type: string
          format: date-time
    FxRevaluationPreview:
      type: object
      properties:
        fiscalYear:
          $ref: '#/components/schemas/FiscalYear'
        runDate:
          type: string
          format: date
          description: The fiscal-year end
        policy:
          type: string
          enum:
          - stichtag
          - niederstwert
        threshold:
          type: number
          format: double
        rates:
          type: array
          items:
            $ref: '#/components/schemas/FxRevaluationRate'
        items:
          type: array
          items:
            $ref: '#/components/schemas/FxRevaluationItem'
        totals:
          $ref: '#/components/schemas/FxRevaluationTotals'
        warnings:
          type: array
          description: 'Objects with a `code`: RATE_MISSING (currencies), RATE_FALLBACK (a 31.12. ICTax currency answered by the BAZG daily rate), RATE_DATE_DIFFERS, OVERDRAFT (accounts), SETTLED_AFTER_YEAR_END, DOCUMENT_RATE_MISSING (count, items), FX_ACCOUNT_MISSING.

            '
          items:
            type: object
            additionalProperties: true
            properties:
              code:
                type: string
        currentRun:
          allOf:
          - $ref: '#/components/schemas/FxRevaluationRun'
        unchanged:
          type: boolean
          description: The current run already books exactly this result; a commit changes nothing
        canCommit:
          type: boolean
        previewToken:
          type: string
          description: 'Identity of this preview (the ledger state it valued). Send it back on the commit; a commit whose token no longer matches the ledger answers 409 FX_REVALUATION_PREVIEW_CHANGED.

            '
    FxRevaluationRate:
      type: object
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        rate:
          type:
          - number
          - 'null'
          format: double
        source:
          $ref: '#/components/schemas/FxRateSource'
        rateType:
          type:
          - string
          - 'null'
          enum:
          - daily
          - monthly
          - closing
          - null
        rateDate:
          type:
          - string
          - 'null'
          format: date
        retrievedAt:
          type:
          - string
          - 'null'
          format: date-time
        manual:
          type: boolean
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: VALIDATION_ERROR
              message: The field 'due_date' must be on or after 'issue_date'.
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: NOT_FOUND
              message: The requested resource was not found.
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred. Please try again later.
    RateLimitExceeded:
      description: Rate limit exceeded
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying
          schema:
            type: integer
          example: 30
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: RATE_LIMIT_EXCEEDED
              message: Rate limit exceeded. Please retry after 30 seconds.
    Forbidden:
      description: Subscription required or read-only key on a write endpoint
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            subscription_required:
              summary: Subscription required
              value:
                error:
                  code: SUBSCRIPTION_REQUIRED
                  message: A Pro or Lifetime subscription is required to use this endpoint.
            read_only_key:
              summary: Read-only key
              value:
                error:
                  code: READ_ONLY_KEY
                  message: This API key is read-only and cannot perform write operations.
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INVALID_API_KEY
              message: The provided API key is invalid or has been revoked.
  parameters:
    ResourceId:
      name: id
      in: path
      required: true
      description: UUID of the resource
      schema:
        type: string
        format: uuid
      example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
    ProfileIdHeader:
      name: X-Profile-Id
      in: header
      description: 'UUID of the target profile. Required when the API key is not already scoped to a single profile.

        '
      required: false
      schema:
        type: string
        format: uuid
      example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: lmb_...
      description: API key obtained from Lumabill dashboard → Settings → API Keys