---
title: "Retrieve a ledger (general ledger account)"
method: GET
path: "/books/ledger/{ledgerId}"
tags: ["Books"]
---

# Retrieve a ledger (general ledger account)

`GET /books/ledger/{ledgerId}`

## Request

- Base URL: `https://api.mercury.com/api/v1`
- URL: `https://api.mercury.com/api/v1/books/ledger/{ledgerId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/mercurytechnologies/apis/mercury-api/docs/books/ledger/:ledgerId/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns a single ledger, i.e. a general ledger (GL) account in the organization's chart of accounts, by its ledger ID. The response includes the account's name, sort code (account number), type, subtype, normal balance (debit or credit), financial account type, and parent ledger ID, and which changes the system allows: whether it is a required ledger (`isRequired`, `requiredLedgerPurpose`), whether line entries can be manually added to or removed from it (`editable`), and whether it can be deleted now (`deletable`) and, if not, why (`deleteBlockedReason`), as described for getBooksLedgers. Use this when you already know the ledger ID, for example one referenced by a journal entry line entry. To discover ledger IDs or browse the whole chart of accounts, use the list ledgers endpoint (getBooksLedgers) instead.

## Path parameters

- `ledgerId` string, base58 (max length 22), required: unique id for a ledger; emitted as base-58, but a base-16 UUID is also accepted

## Query parameters

- `booksId` string, uuid: The Books instance to act on. Must be the token organization's own instance, which it defaults to.

## Response `200`

- GetBooksAPILedgerResponse: Response containing a single ledger.
  - `ledger` object, required: The requested ledger
    - `debitCredit` 'debit' | 'credit', required: Whether the ledger has a natural debit or credit balance.
    - `deletable` boolean, required: Whether the ledger can be deleted now. A ledger can't be deleted if it is required, has line entries, is linked to a bank or card account, or has an integration (invoicing, commerce, or a linked Plaid account) mapped to it. `deleteBlockedReason` says which.
    - `deleteBlockedReason` 'required' | 'hasActivity' | 'linkedSource' | 'integrationMapped', nullable: Why the ledger can't be deleted. Absent when `deletable` is true. When several reasons apply, only one is given: `required` first, then `linkedSource` for a ledger fed by a Mercury account, since neither can be fixed. Fixing any other reason may reveal another.
    - `editable` boolean, required: Whether line entries can be manually added to or removed from the ledger, for example by categorizing a transaction to it. False for ledgers whose activity a system controls, such as Mercury bank and card account ledgers and the accounts receivable and accounts payable required ledgers.
    - `financialAccountType` 'bankAccount' | 'creditCard' | 'payments' | 'payroll' | 'loan' | 'prepaidCard' | 'accountsReceivable' | 'accountsPayable' | 'investment' | 'treasury', nullable: The real-world financial account represented by this ledger, if any.
    - `id` string, base58 (max length 22), required: The stable identifier for the ledger.
    - `isRequired` boolean, required: Whether the ledger is a required ledger, which the accounting system needs to operate. Required ledgers can't be deleted, and only their `name`, `sortCode`, and `parentId` can be changed.
    - `name` string, size < 256, required: The ledger's display name.
    - `openingBalance` number, double, nullable: The ledger's opening balance in its natural direction (`debitCredit`): positive is a balance on the ledger's natural side, negative on the opposite side. Absent when the ledger has no opening balance. Returned by getBooksLedgers and getBooksLedger only; absent from the ledgers in create and update results. Set or clear it with setBooksLedgerOpeningBalances.
    - `parentId` string, base58 (max length 22), nullable: The identifier of the ledger's parent, if it is nested.
    - `requiredLedgerPurpose` 'uncatInflow' | 'uncatOutflow' | 'accountTransfers' | 'openingBalances' | 'accountsReceivable' | 'accountsPayable' | 'wagesExpense' | 'bonusExpense' | 'commissionsExpense' | 'contractorExpense' | 'employeeReimbursements' | 'severanceExpense' | 'payrollTaxExpense' | 'employerBenefitsExpense' | 'healthInsuranceExpense' | 'wagesPayable' | 'payrollTaxPayable' | 'employeeBenefitLiabilities' | 'payrollLiabilities' | 'payrollAdjustmentsClearing' | 'retainedEarnings' | 'currentYearEarnings' | 'benefitsExpense' | 'donationsExpense' | 'benefitsPayable' | 'payrollTaxAccruals' | 'stockExerciseClearing' | 'payrollClearing', nullable: The system function a required ledger fulfills, such as holding uncategorized inflows. Absent for ledgers that aren't required.
    - `sortCode` string, size < 21, required: The ledger/account number used for chart ordering and template mapping.
    - `subType` 'currentAssets' | 'nonCurrentAssets' | 'transfersBetweenAccounts' | 'uncategorizedAssets' | 'currentLiabilities' | 'nonCurrentLiabilities' | 'equity' | 'operatingRevenues' | 'otherIncome' | 'costOfGoodsSold' | 'operatingExpenses' | 'otherExpenses' | 'retainedEarnings', required: The ledger's more specific accounting classification. It must belong to the ledger's `type`: `asset`: `currentAssets`, `nonCurrentAssets`, `transfersBetweenAccounts`, `uncategorizedAssets`; `liability`: `currentLiabilities`, `nonCurrentLiabilities`; `equity`: `equity`, `retainedEarnings`; `revenue`: `operatingRevenues`, `otherIncome`; `expense`: `costOfGoodsSold`, `operatingExpenses`, `otherExpenses`. A child ledger has the same type and sub-type as its parent.
    - `type` 'asset' | 'liability' | 'equity' | 'revenue' | 'expense', required: The ledger's top-level accounting classification. A sub-ledger has the same type as the root of its hierarchy.

## Other responses

- `400`: Invalid `booksId`
- `404`: `ledgerId` not found

## Changes

- **2026-11-03** `95c77a617769`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mercurytechnologies/apis/mercury-api/changes/books/ledger/:ledgerId/get.md)

---

[API](https://skmtc.dev/mercurytechnologies/apis/mercury-api.md) - [All operations](https://skmtc.dev/mercurytechnologies/apis/mercury-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mercurytechnologies/apis/mercury-api/revisions/95c77a617769?raw)
