LumaBill Expenses API

Track business expenses and receipts

GitHub OpenAPI

Operations 8

GET /expenses List expenses #
POST /expenses Create an expense #
GET /expenses/{id} Get an expense #
PUT /expenses/{id} Update an expense #
DELETE /expenses/{id} Delete an expense #
POST /expenses/{id}/pay Record a payment against an expense #
GET /expenses/{id}/payments List the recorded payments of an expense #
POST /expenses/{id}/unpay Undo a recorded payment #

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-expenses-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-expenses-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lumabill Expenses 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: Expenses
  description: Track business expenses and receipts
paths:
  /expenses:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    get:
      operationId: listExpenses
      summary: List expenses
      tags:
      - Expenses
      parameters:
      - $ref: '#/components/parameters/PageParam'
      - $ref: '#/components/parameters/PerPageParam'
      - name: from_date
        in: query
        schema:
          type: string
          format: date
      - name: to_date
        in: query
        schema:
          type: string
          format: date
      - name: vendor_id
        in: query
        schema:
          type: string
          format: uuid
      - name: category
        in: query
        schema:
          type: string
      - name: paymentStatus
        in: query
        description: Filter by payment status (use `UNPAID` to find outstanding obligations)
        schema:
          type: string
          enum:
          - UNPAID
          - PARTIALLY_PAID
          - PAID
      - name: excludeMatched
        in: query
        description: If `true`, hide fully paid expenses; partially-paid expenses remain visible
        schema:
          type: boolean
      responses:
        '200':
          description: A paginated list of expenses
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - meta
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Expense'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
    post:
      operationId: createExpense
      summary: Create an expense
      tags:
      - Expenses
      description: A `currency` outside the supported list answers 400 UNSUPPORTED_CURRENCY (with `currency`). In double-entry mode every line needs a debit account (from the line, the vendor's default account or `category`), else 400 EXPENSE_LINE_ACCOUNT_REQUIRED.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExpenseWrite'
      responses:
        '201':
          description: Expense created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Expense'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
  /expenses/{id}:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    - $ref: '#/components/parameters/ResourceId'
    get:
      operationId: getExpense
      summary: Get an expense
      tags:
      - Expenses
      responses:
        '200':
          description: Expense object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Expense'
        '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'
    put:
      operationId: updateExpense
      summary: Update an expense
      tags:
      - Expenses
      description: 'Partial update. The stored exchange rate is kept unless `currency` changes or a new `exchangeRate` is sent (editing lines, amount or date does not re-rate the expense). `exchangeRate: null` (not omitted) drops the stored rate: the expense converts at the ESTV/BAZG rate of its date again; refused with CURRENCY_LOCKED when the expense is paid or revalued. The app''s revenue update (PUT /revenue/{id}, not part of this spec) follows the same rule. Currency errors (400): UNSUPPORTED_CURRENCY (with `currency`), CURRENCY_LOCKED (currency or rate of a booked or paid expense), FX_REVALUATION_LIVE (amount or date of a foreign-currency expense in a fiscal year with a booked FX revaluation), INVALID_EXCHANGE_RATE, EXCHANGE_RATE_IMPLAUSIBLE, AMOUNT_OUT_OF_RANGE (base amount beyond 9''999''999''999.99), VAT_CODE_NOT_VALID_FOR_DATE (e.g. 7.7 % dated 2024 or later).'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExpenseWrite'
      responses:
        '200':
          description: Updated expense
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Expense'
        '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'
    delete:
      operationId: deleteExpense
      summary: Delete an expense
      tags:
      - Expenses
      responses:
        '200':
          description: Expense deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted:
                    type: boolean
                    example: true
        '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'
  /expenses/{id}/pay:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    - $ref: '#/components/parameters/ResourceId'
    post:
      operationId: recordExpensePayment
      summary: Record a payment against an expense
      tags:
      - Expenses
      description: 'Records a full or partial payment against an expense and posts the payment journal entry from the given payment account (e.g. bank). Omitting `amount` pays the remaining balance. `amount` is the CHF (base-currency) book value, unlike invoice payments where it is in the invoice currency; a foreign-currency expense therefore refuses `amount` with 400 FW_AMOUNT_REQUIRED: send `fwAmount` (the amount paid in the expense currency) instead. The dashboard always does. The same rule applies to POST /revenue/{id}/receive. Currency errors (400): FX_RATE_UNAVAILABLE, FX_RATE_SOURCE_UNAVAILABLE (ESTV/BAZG unreachable, retry), INVALID_EXCHANGE_RATE, EXCHANGE_RATE_IMPLAUSIBLE (`exchangeRate`, or the rate `baseAmount` implies, outside 0.5x to 2x of the ESTV/BAZG rate of the payment date), AMOUNT_OUT_OF_RANGE, FW_AMOUNT_REQUIRED, PAYMENT_ACCOUNT_CURRENCY_MISMATCH, OPEN_ITEM_RATE_MISSING (the expense has no stored rate, so its open item has no CHF book value), PAYMENT_EXCEEDS_OPEN (`fwAmount` above what is still open; the expense row is locked for the payment, so a concurrent payment is seen). `zeroSaldoSkipped` reports a zero-saldo realization that was not booked.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExpensePaymentWrite'
      responses:
        '200':
          description: Payment recorded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResult'
        '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'
  /expenses/{id}/payments:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    - $ref: '#/components/parameters/ResourceId'
    get:
      operationId: listExpensePayments
      summary: List the recorded payments of an expense
      tags:
      - Expenses
      responses:
        '200':
          description: Payments, newest first
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaymentRecord'
        '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'
  /expenses/{id}/unpay:
    parameters:
    - $ref: '#/components/parameters/ProfileIdHeader'
    - $ref: '#/components/parameters/ResourceId'
    post:
      operationId: undoExpensePayment
      summary: Undo a recorded payment
      tags:
      - Expenses
      description: Undoes one payment (by `paymentId`, else the most recent). The payment journal entry is reversed with a Storno on the payment date (nothing is deleted, the Buchungsnummer series stays gap-free), bank matches are released and the payment status is recomputed. Rejected with 400 `FISCAL_YEAR_CLOSED` when the payment date lies in a closed fiscal year.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnpayRequest'
      responses:
        '200':
          description: Payment undone
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResult'
        '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'
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
    PaymentRecord:
      type: object
      description: One recorded payment of an invoice or expense (payment_history).
      properties:
        id:
          type: string
          format: uuid
          description: Pass as `paymentId` to the unpay endpoints to undo this payment
        amount:
          type: number
          format: double
        paymentDate:
          type: string
          format: date
        note:
          type:
          - string
          - 'null'
        journalEntryId:
          type:
          - string
          - 'null'
          format: uuid
        paymentAccountId:
          type:
          - string
          - 'null'
          format: uuid
        paymentAccountCode:
          type:
          - string
          - 'null'
        paymentAccountName:
          type:
          - string
          - 'null'
        createdAt:
          type: string
          format: date-time
    ExpensePaymentWrite:
      type: object
      required:
      - paymentAccountId
      - paidDate
      description: 'Foreign-currency expense: the paying account must be in CHF or in the expense currency (400 PAYMENT_ACCOUNT_CURRENCY_MISMATCH). Without `baseAmount` or `exchangeRate` the ESTV/BAZG rate of the payment date is used (400 FX_RATE_UNAVAILABLE when none exists). The response adds `fx` (PaymentFx).

        '
      properties:
        paymentAccountId:
          type: string
          format: uuid
          description: Chart-of-accounts UUID of the paying account (e.g. 1021 Bank)
        paidDate:
          type: string
          format: date
          example: '2026-06-30'
        amount:
          type:
          - number
          - 'null'
          format: double
          description: 'Partial payment amount in CHF (the base-currency book value); omit to pay the remaining balance. Base-currency expenses only: a foreign-currency expense refuses it with 400 FW_AMOUNT_REQUIRED, send `fwAmount` there.

            '
          example: 84.5
        fwAmount:
          type:
          - number
          - 'null'
          format: double
          description: 'Foreign-currency expense only - partial amount in the expense currency. The only way to pay part of a foreign-currency expense (`amount` is refused there).

            '
        exchangeRate:
          type:
          - number
          - 'null'
          format: double
          description: 'Foreign-currency expense only - the rate actually applied (CHF per 1 unit). Omit to use `baseAmount` or the ESTV/BAZG rate of the payment date

            '
        baseAmount:
          type:
          - number
          - 'null'
          format: double
          description: 'Foreign-currency expense only - the CHF that actually left the account (bank statement); wins over `exchangeRate`

            '
        note:
          type:
          - string
          - 'null'
    PaymentFx:
      type:
      - object
      - 'null'
      description: 'Present when a payment of a foreign-currency document was converted (absent for base-currency documents and without bookkeeping). The open item is released at its current CHF book value (after any year-end revaluation, pro rata on partial payments); the difference to the CHF actually moved is the realized Kursdifferenz, booked on the FX result account with `fxKind: realized`.

        '
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        fwAmount:
          type: number
          format: double
          description: Settled amount in the document currency
        exchangeRate:
          type:
          - number
          - 'null'
          format: double
          description: CHF per 1 unit of the document currency on the money leg
        rateSource:
          type: string
          enum:
          - ACTUAL
          - MANUAL
          - BAZG
        baseAmount:
          type: number
          format: double
          description: CHF actually moved through the payment account
        releasedBookValue:
          type: number
          format: double
          description: CHF book value released from the open item
        realizedFx:
          type: number
          format: double
          description: Realized exchange difference in CHF (positive = gain)
    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.
    ExpenseWrite:
      type: object
      required:
      - description
      - amount
      - currency
      - date
      properties:
        vendor_id:
          type:
          - string
          - 'null'
          format: uuid
        description:
          type: string
          example: Office supplies - Q2 2025
        amount:
          type: number
          format: double
          example: 84.5
        currency:
          $ref: '#/components/schemas/Currency'
        exchangeRate:
          type:
          - number
          - 'null'
          format: double
          description: 'Foreign-currency expense only: CHF per 1 unit of `currency`, a positive number (400 INVALID_EXCHANGE_RATE otherwise; 400 EXCHANGE_RATE_IMPLAUSIBLE when outside 0.5x to 2x of the ESTV/BAZG rate of the date (0.0001 to 100 without one; the body carries `officialRate`, `min`, `max`)). Omit to use the ESTV/BAZG rate of the expense date (the monthly average rate when the profile uses the Monatsmittelkurs for that year). On an update the stored rate is kept unless `currency` changes or a new `exchangeRate` is sent; an omitted `exchangeRate` keeps it, an explicit `null` drops a stored manual rate and converts at the ESTV/BAZG rate of the expense date again. A booked, paid or revalued expense keeps its currency and rate (400 CURRENCY_LOCKED, also for `null`).

            '
        date:
          type: string
          format: date
          example: '2025-05-10'
        category:
          type:
          - string
          - 'null'
          example: Office Supplies
        vat_rate:
          type:
          - number
          - 'null'
          format: double
          example: 8.1
        receipt_url:
          type:
          - string
          - 'null'
          format: uri
        lines:
          type:
          - array
          - 'null'
          description: 'Full replacement line items (update only). Required when changing amount or vat_rate so the recognition journal entry can be rebuilt; the expense total becomes the sum of line amounts.

            '
          items:
            type: object
            required:
            - amount
            properties:
              description:
                type: string
              amount:
                type: number
                format: double
              taxRate:
                type:
                - number
                - 'null'
                format: double
              debitAccountId:
                type:
                - string
                - 'null'
                format: uuid
                description: 'Chart-of-accounts UUID to debit (see /chart-accounts). Required in double-entry mode unless the vendor''s default account or `category` resolves one (400 EXPENSE_LINE_ACCOUNT_REQUIRED).

                  '
              vatCode:
                type:
                - string
                - 'null'
    PaymentResult:
      type: object
      required:
      - paymentStatus
      - amountPaid
      properties:
        paymentStatus:
          type: string
          enum:
          - UNPAID
          - PARTIALLY_PAID
          - PAID
        amountPaid:
          type: number
          format: double
        remaining:
          type: number
          format: double
        paymentJournalEntryId:
          type:
          - string
          - 'null'
          format: uuid
        fx:
          $ref: '#/components/schemas/PaymentFx'
        zeroSaldoSkipped:
          type: string
          enum:
          - PRIOR_YEAR_NOT_CLOSED
          - FX_ACCOUNT_MISSING
          description: 'Present when the payment emptied a foreign-currency account in FW but the residual CHF book value was not realized (zero-saldo rule): `PRIOR_YEAR_NOT_CLOSED` (the previous fiscal year is open, so the account has no Saldovortrag yet; close it and the residual is realized then), `FX_ACCOUNT_MISSING` (no FX result account: set one in the FX settings). The payment itself is booked.

            '
        message:
          type: string
    UnpayRequest:
      type: object
      properties:
        paymentId:
          type: string
          format: uuid
          description: Payment to undo (from the payments list); omit to undo the most recent payment
    Expense:
      type: object
      required:
      - id
      - profile_id
      - description
      - amount
      - currency
      - date
      - created_at
      properties:
        id:
          type: string
          format: uuid
          example: b2c3d4e5-2345-6789-bcde-f01234567890
        profile_id:
          type: string
          format: uuid
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        vendor_id:
          type:
          - string
          - 'null'
          format: uuid
          example: 4fb96g75-6828-5673-c4gf-g12345678901
        description:
          type: string
          example: Office supplies - Q2 2025
        amount:
          type: number
          format: double
          example: 84.5
        currency:
          $ref: '#/components/schemas/Currency'
        exchangeRate:
          type:
          - number
          - 'null'
          format: double
          description: 'CHF per 1 unit of `currency` the expense was booked at; null in the base currency

            '
        baseCurrencyAmount:
          type:
          - number
          - 'null'
          format: double
          description: The expense total in CHF
        date:
          type: string
          format: date
          example: '2025-05-10'
        category:
          type:
          - string
          - 'null'
          example: Office Supplies
        vat_rate:
          type:
          - number
          - 'null'
          format: double
          example: 8.1
        receipt_url:
          type:
          - string
          - 'null'
          format: uri
          example: https://files.lumabill.com/receipts/abc123.pdf
        created_at:
          type: string
          format: date-time
          example: '2025-05-10T14:00:00Z'
    PaginationMeta:
      type: object
      required:
      - page
      - per_page
      - total
      properties:
        page:
          type: integer
          example: 1
        per_page:
          type: integer
          example: 50
        total:
          type: integer
          description: Total number of items across all pages
          example: 243
  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:
    PageParam:
      name: page
      in: query
      description: Page number (1-based)
      schema:
        type: integer
        default: 1
        minimum: 1
      example: 1
    PerPageParam:
      name: per_page
      in: query
      description: Items per page (max 100)
      schema:
        type: integer
        default: 50
        minimum: 1
        maximum: 100
      example: 50
    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