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

# Get specific ledger entry

> Returns a single ledger entry by its id, with its VAT, foreign currency and receipt details.

## Getting a ledger entry

Returns a single ledger entry as `ledgerEntry`, in the same shape as when you [find ledger entries](/api/accounting/find):

```bash theme={null}
curl https://api.infinity.swiss/v1/ledger-entries/682338d9e9500b3ffe4baa5a \
  -H "x-api-token: your-api-token"
```

The id is the one returned when the entry was posted, and it stays the same when the entry is edited in Infinity.

<Note>
  Ledger entries with VAT are booked as two transactions internally, but only
  the entry itself has a public id. The id of the VAT transaction is not
  accepted here and results in a `404 Not Found` response with the error code
  `transactions/not-found`.
</Note>


## OpenAPI

````yaml GET /v1/ledger-entries/{ledgerEntryId}
openapi: 3.1.0
info:
  title: infinity.swiss Open API
  version: '1.0'
  summary: ''
servers:
  - url: https://api.infinity.swiss
security:
  - apiKey: []
paths:
  /v1/ledger-entries/{ledgerEntryId}:
    parameters:
      - schema:
          type: string
        name: ledgerEntryId
        in: path
        description: The id of the ledger entry
        required: true
    get:
      tags: []
      summary: Get specific ledger entry
      description: >-
        Returns a single ledger entry by its id, with its VAT, foreign currency
        and receipt details.
      operationId: get-ledger-entry-v1
      responses:
        '200':
          description: The ledger entry with the given id.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ledgerEntry
                properties:
                  ledgerEntry:
                    $ref: '#/components/schemas/LedgerEntry'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '404':
          $ref: '#/components/responses/LedgerEntryNotFound'
components:
  schemas:
    LedgerEntry:
      title: LedgerEntry
      type: object
      description: >-
        A ledger entry is a single booking in the ledger: one amount, posted
        from a debit to a credit account on a date.


        Infinity books the VAT of an entry as a separate VAT transaction
        internally, but the API never returns it on its own: it is folded into
        the `vat` property of the entry it belongs to.
      required:
        - id
        - date
        - description
        - debitAccount
        - creditAccount
        - amount
        - netAmount
        - currency
        - source
        - receiptIds
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          description: >-
            A unique hex identifier for the ledger entry. It stays the same when
            the entry is edited.
          example: 682338d9e9500b3ffe4baa5a
        date:
          type: string
          format: date
          description: The date of the ledger entry in YYYY-MM-DD format.
          example: '2025-02-05'
        description:
          type: string
          description: The single text-line description of the ledger entry.
          example: Consulting revenue
        debitAccount:
          type: integer
          minimum: 1000
          maximum: 9999
          description: The account number of the debit account of the ledger entry.
          example: 1020
        creditAccount:
          type: integer
          minimum: 1000
          maximum: 9999
          description: The account number of the credit account of the ledger entry.
          example: 3400
        amount:
          type: integer
          description: >-
            The gross amount of the ledger entry in cents (e.g. 108100 =
            1081.00), in CHF.


            For entries without VAT, this is the same as `netAmount`. It is also
            the same for reverse charge tax codes (acquisition tax), where the
            VAT is booked on top of the entry instead of being contained in it.
          example: 108100
        netAmount:
          type: integer
          description: >-
            The amount in cents that is booked between the debit and the credit
            account, in CHF, without the VAT booked alongside it.
          example: 100000
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: >-
            The 3-character alphanumeric currency code (ISO 4217) of `amount`
            and `netAmount`. These are always given in the accounting currency,
            which currently is always `CHF`. The currency the entry was posted
            in is reported in `fx`.
          example: CHF
        vat:
          $ref: '#/components/schemas/LedgerEntryVat'
          description: >-
            The VAT booked with this entry. Present for every entry that has a
            tax code.
        fx:
          $ref: '#/components/schemas/LedgerEntryFx'
          description: >-
            The original amount of this entry in a foreign currency. Present for
            every entry that was posted in a currency other than CHF.
        source:
          $ref: '#/components/schemas/LedgerEntrySource'
          description: Which part of Infinity this entry originates from.
        receiptIds:
          type: array
          description: >-
            The ids of the receipts attached to this ledger entry, in the order
            in which they were attached.
          items:
            type: string
            example: 686f1b2ce9500b3ffe4bbc71
        reversedBy:
          type: string
          description: >-
            The id of the ledger entry that reverses this entry (Storno). Only
            present if the entry has been reversed; such an entry can no longer
            be deleted.
          example: 6851f42ae9500b3ffe4bb0c4
        reverses:
          type: string
          description: >-
            The id of the ledger entry that this entry reverses. Only present
            for entries with the source `reversal`.
          example: 682338d9e9500b3ffe4baa5a
        createdAt:
          type: string
          format: date-time
          description: The time at which the ledger entry was created.
          example: '2025-02-05T09:12:44.000Z'
        updatedAt:
          type: string
          format: date-time
          description: >-
            The time at which the ledger entry was last changed. Use it together
            with the `updatedSince` filter to synchronise changes incrementally.
          example: '2025-02-05T09:12:44.000Z'
    LedgerEntryVat:
      title: LedgerEntryVat
      type: object
      description: >-
        The VAT that was booked with a ledger entry, as it stands in the ledger.


        With reverse charge tax codes (acquisition tax, `BZB…` and `BZM…`), the
        VAT is booked on top of the entry rather than contained in it: the
        `amount` of the entry equals its `netAmount`, and the VAT booking runs
        between two VAT accounts.
      required:
        - taxCode
        - amount
      properties:
        taxCode:
          type: string
          description: >-
            The tax code of the ledger entry, either a statutory code such as
            `UN81`, or one of the organisation's own simplified codes
            (Saldosteuersatz) such as `SS53`.
          examples:
            - UN81
            - SS53
        rate:
          type: number
          description: >-
            The VAT rate in percent that was actually booked, e.g. `8.1`. With
            the simplified method (Saldosteuersatz), this is the organisation's
            simplified rate, e.g. `5.3`.


            Absent only for tax codes that are no longer defined.
          example: 8.1
        statutoryRate:
          type: number
          description: >-
            The statutory VAT rate in percent that the tax code stands for, e.g.
            `8.1`. Only present for simplified tax codes (Saldosteuersatz),
            where the rate charged to the customer differs from the rate booked.
          example: 8.1
        amount:
          type: integer
          description: >-
            The VAT amount in cents that was booked, in CHF.


            `0` if no VAT booking was made after all, for example because the
            VAT amount rounded to zero.
          example: 8100
        debitAccount:
          type: integer
          minimum: 1000
          maximum: 9999
          description: >-
            The account number of the debit account of the VAT booking. Absent
            if no VAT booking was made.
          example: 1020
        creditAccount:
          type: integer
          minimum: 1000
          maximum: 9999
          description: >-
            The account number of the credit account of the VAT booking. Absent
            if no VAT booking was made.
          example: 2200
    LedgerEntryFx:
      title: LedgerEntryFx
      type: object
      description: >-
        The foreign currency details of a ledger entry. Only present if the
        entry has an amount in a foreign currency; the amounts of the entry
        itself are always converted to CHF.
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          description: >-
            The gross amount of the ledger entry in cents (e.g. 10000 = 100.00),
            in the foreign currency.
          example: 10000
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: >-
            The 3-character alphanumeric currency code (ISO 4217) of the foreign
            currency.
          example: EUR
        exchangeRate:
          type: number
          description: >-
            The exchange rate that was used to convert the amount, as the value
            of one unit of the foreign currency in CHF. Absent only for legacy
            entries that were posted without a rate.
          example: 0.95
    LedgerEntrySource:
      title: LedgerEntrySource
      type: string
      description: >-
        Which part of Infinity a ledger entry originates from:

        - `manual`: posted by hand in Infinity, or through this API

        - `customer-invoice`: posted by a customer invoice (Forderung), for
        example its positions, payments, discounts or rebates

        - `vendor-invoice`: posted by a vendor invoice (Kreditor), for example
        its positions or payments

        - `bank`: posted from a synchronised bank transaction in Live Accounting

        - `vat`: posted by a VAT settlement or a VAT payment

        - `closing`: posted when a fiscal year is opened or closed, for example
        accruals, depreciation or the profit appropriation

        - `reversal`: posted to reverse another ledger entry (Storno)

        - `salary`: posted by a salary payment
      enum:
        - manual
        - customer-invoice
        - vendor-invoice
        - bank
        - vat
        - closing
        - reversal
        - salary
      example: manual
  responses:
    Unauthorised:
      description: >-
        An unauthorised request was submitted. You may be using an incorrect or
        expired API token, or are attempting to access a document outside of the
        scope of the token.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                x-stoplight:
                  id: 08hkw8ukmi2lp
                description: Specific error code
          examples:
            Unauthorised request:
              value:
                code: general/unauthorised
    LedgerEntryNotFound:
      description: >-
        No ledger entry with this id exists in this organisation. This is also
        returned when the id refers to the VAT transaction that Infinity booked
        alongside an entry, rather than to the ledger entry itself.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                description: Specific error code.
          examples:
            Not found:
              value:
                code: transactions/not-found
  securitySchemes:
    apiKey:
      name: x-api-token
      type: apiKey
      in: header
      description: >-
        API token for authentication. Obtain from your Infinity account
        settings.

````