LedgerHQ

API Reference

The current LedgerHQ partner REST API contract.

LedgerHQ serves the public integration API from the same deployed app that users sign into. The current public contract is the partner accounting surface: organization scoping, accounts, posting resources, entries, Plaid-connected bank activity, transaction reclass/reconciliation actions, report packet JSON, MCP, and webhooks.

OpenAPI

Machine-readable contract:

https://app.ledgerhq.pro/api/openapi.json

The OpenAPI document covers the validated partner integration surface first. Routes outside that contract are not public partner docs yet.

Base URL

https://app.ledgerhq.pro/api/v1

Authentication

Partner apps should connect once with Authorization Code + PKCE from a LedgerHQ firm owner/admin account. The access token is anchored to the firm account and can then discover client files managed by that firm.

GET  /api/oauth/authorize
POST /api/oauth/token

Client discovery does not require an organization header:

Authorization: Bearer mcp_at_your_token

Client-specific requests include the mapped company:

Authorization: Bearer mcp_at_your_token
x-organization-id: org_id

Server-to-server requests can also use a LedgerHQ API key:

Authorization: Bearer dk_live_your_key
x-organization-id: org_id

Browser-session requests can call the same routes with the signed-in user's cookies. Include x-organization-id when the user has access to more than one organization.

Response Shape

Legacy endpoints may return simple errors:

{ "error": "Message" }

Posting endpoints return structured errors:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed.",
    "retryable": false,
    "requestId": "req_..."
  }
}

Money values in the documented integration contract are integer cents unless a field says otherwise. Example: 1250 means $12.50.

Supported REST Surface

Health

MethodPathPurpose
GET/api/healthPublic deployment health check

Organizations

MethodPathPurpose
GET/api/v1/organizationsList firm-managed client organizations for account-level OAuth mapping

Accounts

MethodPathPurpose
GET/api/v1/accountsList accounts for classification and reporting
POST/api/v1/accountsCreate an account
GET/api/v1/accounts/:idGet account and ledger detail
PATCH/api/v1/accounts/:idUpdate account metadata
DELETE/api/v1/accounts/:idDelete an unused account

Journal Entries

MethodPathPurpose
GET/api/v1/entriesList entries
POST/api/v1/entriesCreate a draft entry
GET/api/v1/entries/:idGet an entry with lines
POST/api/v1/entries/:id/postPost a draft entry
POST/api/v1/entries/:id/voidVoid a posted entry

Posting Resources

MethodPathPurpose
POST/api/v1/purchasesCreate a posted purchase and bank-register activity when source account is bank-linked
POST/api/v1/depositsCreate a posted deposit and bank-register activity when destination account is bank-linked
POST/api/v1/transfersCreate a posted transfer between two balance-sheet accounts
POST/api/v1/bill-paymentsPay an existing bill and allocate the payment
POST/api/v1/journal-entriesCreate a balanced posted journal entry

Posting routes require Idempotency-Key and return a posting receipt with the created journalEntryId, optional bankTransactionIds, status, and postedAt.

Bank Activity

MethodPathPurpose
GET/api/v1/bank-accountsList bank accounts that hold bank/card activity
POST/api/v1/bank-accountsCreate a bank account
GET/api/v1/bank-accounts/:id/transactionsList bank transactions for an account
GET/api/v1/bank-transactionsList organization bank transaction history for rules and review
GET/api/v1/bank-feedsList connected bank feeds
GET/api/v1/bank-feeds/healthPer-connection and per-account Plaid feed health

Bank and card activity arrives through Plaid-connected feeds, which sync internally on a webhook-driven basis. There is no public "import rows" endpoint; synced rows land as bank transactions with sourceType: "plaid_bank_feed", which you then classify, reclassify, and reconcile.

Bank Transaction Actions

MethodPathPurpose
POST/api/v1/bank-transactions/:id/reclassifyUpdate account/contact/tax classification and linked editable journal line
POST/api/v1/bank-transactions/:id/matchMatch a transaction to an invoice or bill payment
POST/api/v1/bank-transactions/:id/splitSplit a transaction across invoices or bills
POST/api/v1/bank-transactions/:id/reconcileMark a transaction reconciled
POST/api/v1/bank-transactions/:id/excludeMark a transaction excluded

Reports

MethodPathPurpose
GET/api/v1/reports/financial-packetFinancial packet JSON
GET/api/v1/reports/trial-balanceTrial balance
GET/api/v1/reports/balance-sheetBalance sheet
GET/api/v1/reports/profit-and-lossProfit and loss
GET/api/v1/reports/general-ledgerGeneral ledger
GET/api/v1/reports/bank-reconciliation-statusBank reconciliation status

Webhooks

MethodPathPurpose
GET/api/v1/webhooksList webhook subscriptions
POST/api/v1/webhooksCreate webhook subscription

Example: Post A Purchase

curl -X POST \
  -H "Authorization: Bearer mcp_at_your_token" \
  -H "x-organization-id: org_id" \
  -H "Idempotency-Key: ledgerhq-purchase-1001" \
  -H "Content-Type: application/json" \
  -d '{
    "txnDate": "2026-06-08",
    "payeeName": "Office Depot",
    "sourceAccountId": "checking_gl_account_id",
    "memo": "Office supplies",
    "lines": [
      {
        "accountId": "office_supplies_expense_id",
        "description": "Paper and toner",
        "amount": 4299
      }
    ]
  }' \
  https://app.ledgerhq.pro/api/v1/purchases

Example: Reclassify Transaction

curl -X POST \
  -H "Authorization: Bearer mcp_at_your_token" \
  -H "x-organization-id: org_id" \
  -H "Content-Type: application/json" \
  -d '{ "accountId": "expense_account_id", "reason": "Category review" }' \
  https://app.ledgerhq.pro/api/v1/bank-transactions/bank_transaction_id/reclassify

Example: Fetch Report Packet

curl -H "Authorization: Bearer mcp_at_your_token" \
  -H "x-organization-id: org_id" \
  "https://app.ledgerhq.pro/api/v1/reports/financial-packet?startDate=2026-01-01&endDate=2026-06-30"

On this page