API Integration
Build the current partner integration flow against LedgerHQ REST.
This guide covers the public REST flow that exists today for partner developers. It does not document older app modules or unvalidated internal routes.
Setup
Read the OpenAPI contract
https://app.ledgerhq.pro/api/openapi.jsonConnect once with OAuth
Partner apps should use account-level OAuth from a LedgerHQ firm owner/admin. The connected token represents the firm account, not one client file:
GET /api/oauth/authorize
POST /api/oauth/tokenMap client companies
List client companies managed by the connected firm, then store the selected organization against the partner client record:
GET /api/v1/organizations?limit=250&type=client&cursor=...
Authorization: Bearer mcp_at_your_tokenResolve accounts
Call /api/v1/accounts and /api/v1/bank-accounts with the mapped
x-organization-id to connect external source accounts to chart accounts
and bank accounts.
Preferred Posting Flow
Use resource posting endpoints for normal accounting events:
- Resolve the account IDs, contact IDs, tax codes, and bill IDs needed by the source transaction.
- Send the transaction to
/api/v1/purchases,/api/v1/deposits,/api/v1/transfers,/api/v1/bill-payments, or/api/v1/journal-entries. - Include an
Idempotency-Keygenerated from the source system transaction ID. - Store the returned
journalEntryIdand anybankTransactionIdsagainst the source transaction. - Retry safely with the same idempotency key when the network or client process fails before receiving the receipt.
Posting endpoints create posted accounting entries immediately and create bank-register rows when a bank-linked account is involved.
Bank Activity Flow
Bank and card activity arrives through Plaid-connected feeds that 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".
- List bank accounts (
/api/v1/bank-accounts) and bank feeds (/api/v1/bank-feeds) to confirm connected activity. - List synced rows from
/api/v1/bank-transactionsor the bank-account transaction list. - Reclassify account/contact/tax fields when review changes a category.
- Match, split, reconcile, or exclude transactions.
- Pull
/api/v1/reports/financial-packetfor report rendering.
Reclassify
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",
"journalLineId": "journal_line_id",
"reason": "Account review"
}' \
https://app.ledgerhq.pro/api/v1/bank-transactions/bank_transaction_id/reclassifyBehavior:
- Updates the bank transaction classification fields.
- Updates the selected editable non-bank journal line when a linked entry exists.
- Requires
journalLineIdfor multi-line linked entries. - Rejects period-locked or void entries.
Financial Packet JSON
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"The API returns report packet JSON with integer-cent amounts. Partner apps render PDF or HTML packets from that JSON.